Table of Contents >Quanser Rapid Control Prototyping Toolkit >Communication Protocols >
Shared Memory Protocol
The shared memory protocol supports communications through shared memory on the same machine.
Syntax
shmem://name:port?option=value,... % Communicate via shared memory called "name" on port "port"
Description
The shared memory communications protocol supports communications through shared memory. It is identified by using shmem as the protocol name in a URI. It cannot be used to communicate between two operating systems running on the same machine.
The hostname in the URI is used as the name of the shared memory. The name is extended internally so that a shared memory server can accept connections from multiple clients, much like TCP/IP sockets, with each client getting its own unique connection.
The port in the URI determines the "port" used for communications. The port is used
as part of the shared memory name so that URI's with the same hostname but different
ports refer to different shared memory channels. For example, the URI
shmem://my-memory:2
refers to a shared memory buffer called my-memory
listening on port 2. The default port number is 1.
Limitations
Shared memory under Windows 7 or Later Versions
The shared memory protocol is structured such that only the server-side of a connection creates shared memory buffers (stream_listen and stream_accept). On Windows 7 or later versions, processes must have SeCreateGlobalPrivilege rights in order to create shared memory in the global namespace. By default, only administrators and services have this privilege.
However, the RCP stream commands in LabVIEW may not be used to create a listening shared memory stream that will communicate with a VI unless LabVIEW is run with the necessary SeCreateGlobalPrivilege rights. These rights are available if LabVIEW is run as administrator or the user account rights are modified to include the SeCreateGlobalPrivilege rights.
The client-side of a stream (stream_connect) may still be established in LabVIEW however, because the client-side does not create global shared memory buffers. The same restriction applies to user applications using the Quanser Stream API. See the local option for more information.
Polling restrictions
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.
Options
backlog
timeout
memsize
sndsize
rcvsize
local
close_timeout
Driver
The driver supporting shared memory communications is called qrt_shmem
.
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.