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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Events between Host and RT

Hi
 
  how do I generate events in the RT and send them to the HOST or how do I pass events between Host and RT instead of booleans. My RT reads a set of DIs and I am exploring ways to see if I can generate events when the values of the booleans change and use that events in the Host
0 Kudos
Message 1 of 2
(2,576 Views)
You could generate an event on the host machine from the RT target using VI Server, but I don't believe this would be the most optimal thing to do. VI Server allows for automating VIs across application and computer boundaries as if they were running on the same machine, but it does a lot of abstraction under the hood that makes it a slower communication mechanism than others.

I would strongly recommend using TCP functions. They're a little more complicated, but they will offer you much more in terms of performance, and they're essentially event-based themselves. In other words, your TCP Read function can go to sleep while it waits for incoming messages (events), just like an Event Structure would do. The biggest complication is that TCP functions only operate on string data, so you'll have to flatten your digital data to string on the RT side then unflatten it back to digital data on the host side. Check the Example Finder for TCP examples (just search for TCP or browse to the Networking section).

If you are using Shared Variables, then there's no way to have an event telling you when new data is arriving. You have to continually poll the shared variables for new data. You can tell the old data from the new data, however, by comparing the timestamp output from the previous timestamp. Hope this helps!

Jarrod S.
National Instruments
0 Kudos
Message 2 of 2
(2,568 Views)