03-04-2011 01:52 PM - edited 03-04-2011 01:53 PM
Hi,
I wonder if it is possible to generate a user event when a network published shared variable value change?
Thanks a lot!
Regards,
Tom
03-04-2011 02:17 PM
You generate an event for the SV change using dynamic event registration.
There are several examples out there on using dynamic events. Have a look at this one that could be easily modified for your case.
http://decibel.ni.com/content/docs/DOC-5265
Replace the switch with your shared variable node and edit the event case as desired. If you need to monitor the SV for T-F or F-T change then just add a shift register.
Dan
03-04-2011 02:55 PM
Hi Dan,
In your example you still need to poll the shared variable to generate the event. I try to avoid polling the data and would like to have shared variable generate user event when its value change.
Thanks!
Tom
03-04-2011 06:06 PM
Tom,
I understand not wanting to waster resources on polling but I am not aware that LabVIEW can automatically generate an event on a SV change.
Maybe a better solution...
You could implement lower level TCP communication (i.e. have a look at STM - simple messaging protocol) for passing data betweeen RT and PC (instead of using a SV). You could send a generic command (boolean trigger maybe?) from your RT system when the value of whatever it is the SV is storing has changed. You can avoid polling on the non-RT system this way.
Dan
03-07-2011 07:51 AM
Unfortunately in LV you need the DSC toolkit to register for NSV events. This will only work for windows hosted NSV's. It appears that CVI natively supports NSV events
on any platform but as of yet there are no LV wrappers for this functionality.