10-18-2017 10:02 AM
I am trying to have an event structure that increments a value to work on a real time VI. I had it decreasing the value by polling, but it wasn't decreasing once per click, now it won't decrease at all. The event structure is in the RT.vi on the cRIO and the increment button is on the host PC.
10-18-2017 10:07 AM - edited 10-18-2017 10:08 AM
Hi atokad,
several fails…
- an event structure will NOT fire on programmatic change of indicators
- an event structure will NOT fire on changes of indicators - instead it will react on user interaction in the frontpanel and so only on changes of controls…
- the event structure will NOT work at all (atleast for frontpanel elements) on the cRIO as the cRIOs work "headless" without frontpanels…
Why don't you just test for value changes of your "increment" shared variable? Maybe by using the PtByPt-BooleanCrossing function?
10-18-2017 10:18 AM
Event Structures do not work on indicators and they do not work with writing to controls with local variables.
In general, I find Network Published Shared Variables to be truly evil (and I am the one who defended Global Variables at NI Week). You should use explicit TCP/IP or Network Streams to send data back and forth between your cRIO and PC. I found this to make things more responsive, use less network bandwidth, and it is more of a command based instead of polling.
10-23-2017 12:03 PM
@crossrulz wrote:
Event Structures do not work on indicators and they do not work with writing to controls with local variables.
In general, I find Network Published Shared Variables to be truly evil (and I am the one who defended Global Variables at NI Week). You should use explicit TCP/IP or Network Streams to send data back and forth between your cRIO and PC. I found this to make things more responsive, use less network bandwidth, and it is more of a command based instead of polling.
I am self taught in Labview and shared variables were the easiest for me to understand, could you maybe give me an example of how I would convert this VI from shared variables to TCP/IP because I've tried to do it in the past and have had no luck.
Sorry it took me so long to respond I was out of town for the past couple of days attending a football game!
10-23-2017 09:16 PM
@atokad wrote:
I am self taught in Labview and shared variables were the easiest for me to understand, could you maybe give me an example of how I would convert this VI from shared variables to TCP/IP because I've tried to do it in the past and have had no luck.
I recommend using the STM library (free in the LabVIEW Tools Network). It contains a couple of good examples.