From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if CNSEndpoint exists?

Hi! How can I check whether my Network Stream endpoint "exists" or not? I'm running into problems when I try using CNSFlush after losing my connection and get error messages like "The endpoint doesn't exist" or "You're passing NULL pointers to the CNS Library". I have tried some things, but none have worked so far.

 

// endpoint is of type CNSEndpoint

if (endpoint) //Doesn't work
{...

if (endpoint != NULL) //Doesn't work
{...

int test = 0;
CNSGetEndpointAttribute(endpoint, CNSAttributeIsEndpointConnected, &test);
...
//Crashes and burns because "A NULL pointer was passed to the Network Streams Library".

The endpoint seems to contain some value (for instance 3145729), maybe an address or an ID? This is probably why just checking if it itself is NULL doesn't work. Any ideas?

 

Thanks.

0 Kudos
Message 1 of 1
(625 Views)