Table of Contents >Quanser Rapid Control Prototyping Toolkit >Communication Protocols >
Pipe Protocol
The bidirectional pipe communications protocol supports communications over local Unix domain sockets (Unix variants) or named pipes (Windows).
Syntax
pipe:name?option=value,... % Use a local pipe named "name" pipe://server/name?option=value,... % Use a named pipe named "name" on server "server" (Windows only)
Description
The bidirectional pipe communications protocol supports communications over local Unix domain sockets (Unix variants) or named pipes (Windows). It is identified by using pipe as the protocol name in a URI. The pipe communications protocol may be used to communicate between applications on the same computer. On Windows targets, it may also be used to communicate between computers. It may also be used for communicating between models running in a real-time kernel under Windows and a Windows application. It has the principal benefit that the Windows application does not have to have any knowledge of the real-time kernel and the same protocol may be used with the RCP Windows target.
The pipe URI takes the form:
pipe:name
where name is the name of the pipe. On Windows targets, it may also take the form:
pipe://server/name
where name is the name of the pipe and server is the name of the machine running the server-side of the pipe.
The name of the pipe should not include forward or back slashes, and should be valid
as a filename on the target operating system. On Unix variants, the full name of
the pipe will be /var/pipes/<pipename>
. For example, the URI
pipe://mypipe creates a local domain socket with the full
path of /var/pipes/mypipe
.
On Windows, or real-time kernels running under Windows, the full name of the pipe will be \\.\pipe\<pipename>. If a server is specified using the second form of the URI, then the full name of the pipe will be \\server\pipe\<pipename>. For example, the URI pipe:mypipe creates a named pipe with the full name of \\.\pipe\mypipe, while the URI pipe://remhost/mypipe creates a named pipe with the full name of \\remhost\pipe\mypipe.
The port in the URI is not used and should be omitted.
For listening streams, the pipe name should not be used by other components in the system. In particular, two stream server VIs cannot share the same pipe name if they will be running at the same time on the same target.
Limitations
Reserved pipe names
On the Windows target, the pipe name "localhost" appears to be used by the system. Hence, it is not possible to use "localhost" as the pipe name for the named pipe under Windows. |
Polling restrictions
The pipe protocol on the Windows target can only poll for data available to receive or client connections ready to be accepted. It cannot poll for space available in the pipe buffer to send data. Attempting to do so will return success whether there is space available or not. Listening streams can only poll for client connections ready to be accepted, because listening streams cannot send or receive data. Likewise, streams created with the CL Stream Connect or CL Stream Accept VIs cannot poll for pending client connections because such streams are not listening streams.
Send and receive buffer sizes
The target operating system may limit the send and receive buffers to a specific range of values. Also, setting the send and/or receive buffer sizes to a value less than the system default has been known to cause severe performance degradation on some systems.
Options
backlog
timeout
memsize
sndsize
rcvsize
close_timeout
Driver
The driver supporting pipe communications is called qrt_pipe
.
Targets
Target |
Supported |
Comments |
---|---|---|
Yes |
Fully supported. |
See Also
Copyright © Quanser Inc. This page was generated 2021-09-24. Submit feedback to Quanser about this page.
Link to this page.