10-26-2010 03:51 AM
I've been using CNVCreateSubscriber( ) to create a read subscription to a Network Variable: every time the variable value changes, the DataCallback is called and I'm able to get the new value of the variable.
But how can I get the value that the variable has when the subscription is created?
I read in the help that CNVCreateBufferedSubscriber( ) returns this information, but I wonder if using CNVGetDataFromBuffer( ) in a polling loop has the same performance as the DataCallback approach of the CNVCreateSubscriber( ).
Moreover, the dataStatus parameter of CNVGetDataFromBuffer( ) is different for different subscribers? (i.e. if I have multiple subscribers, CNVStaleData is related to the specific subscriber or is a global property of the variable?)
Solved! Go to Solution.
10-26-2010 09:41 AM
CNVData data;
CNVGetConnectionAttribute (subscriber, CNVMostRecentDataAttribute, &data);
02-16-2011 08:57 AM
Is it possible to wrap the CNVCreateSubscriber as a DLL that would allow a LV vi to call and register a NSV as well as a LV vi callback or maybe even passing back a LV User Event.
Thank You
02-17-2011 09:03 AM
LabVIEW has its own implementation of Network Variables - they are called Shared Variables in LabVIEW. While you can wrap the CVI Network Variable function calls in a DLL and call them from LabVIEW, it will be easier and better to instead use the shared variables nodes and VIs that are native to LabVIEW. The members of this forum may not know much about the LabVIEW event model - you will get better answers about LabVIEW events and callbacks in the LabVIEW forum.
02-17-2011 09:06 AM
The problem with the LV SV API is that they do not expose the callback capability. It is offered by the DSC but not natively in LV. Wrapping these CVI functions in LV callable dll's would be a powerful addition to the LV SV API.