LabWindows/CVI

Organizing Network Stream Endpoint Names

You can organize endpoints by adding segments to their names that describe the data they stream, the computer on which they reside, or other characteristics. When you have multiple endpoints on different computers, organizing endpoints in this way helps ensure that you connect each writer endpoint to its corresponding reader endpoint.

The following example illustrates how to organize endpoints by name. Assume you have three writer endpoints within the same application on a real-time (RT) target. One measures temperature, and the other two measure voltage signals. These endpoints connect to three corresponding reader endpoints in an application on a desktop computer.

Code on the RT target Code on the desktop computer with IP address 10.0.0.62

CNSNewScalarEndpoint ("RT Target/Temperature/Writer", "//10.0.0.62/Desktop/Temperature/Reader", CNSTypeInt32, 100, 0, CNSDirectionWriter, CNSWaitForever, 0, &writerEndpoint);

CNSNewScalarEndpoint ("//10.0.0.62/Desktop/Temperature/Reader", "RT Target/Temperature/Writer", CNSTypeInt32, 100, 0, CNSDirectionReader, CNSWaitForever, 0, &readerEndpoint);

CNSNewScalarEndpoint ("RT Target/Voltage/Writer 1", "//10.0.0.62/Desktop/Voltage/Reader 1", CNSTypeInt32, 100, 0, CNSDirectionWriter, CNSWaitForever, 0, &writerEndpoint);

CNSNewScalarEndpoint ("//10.0.0.62/Desktop/Voltage/Reader 1", "RT Target/Voltage/Writer 1", CNSTypeInt32, 100, 0, CNSDirectionReader, CNSWaitForever, 0, &readerEndpoint);

CNSNewScalarEndpoint ("RT Target/Voltage/Reader 2", "//10.0.0.62/Desktop/Voltage/Reader 2", CNSTypeInt32, 100, 0, CNSDirectionWriter, CNSWaitForever, 0, &writerEndpoint);

CNSNewScalarEndpoint ("//10.0.0.62/Desktop/Voltage/Reader 2", "RT Target/Voltage/Writer 2", CNSTypeInt32, 100, 0, CNSDirectionReader, CNSWaitForever, 0, &readerEndpoint);

Notice the slash between each segment of the name that you specify in these parameters.

In the example code, the name of each endpoint describes the target the endpoint resides on, the type of data the endpoint streams, and whether the endpoint reads or writes that data. This naming scheme shows which endpoints correspond with each other.

Note  The name of one endpoint cannot be the partial name of another endpoint within the same application. For instance, in the example code, if you name one of the writer endpoints RT Target/Voltage and the other RT Target/Voltage/Writer 1, these endpoints return an error instead of creating network streams.