10-29-2015 01:26 PM
Hi I'm doing a project that needs to acquire data from a simulated data file and show it on a GUI. Both of them are made in a state machine. I'm wondering if there is a good way to communicate data between two state machines? It would be very much appreciated if you can provide with some examples. Thanks a lot.
Solved! Go to Solution.
10-29-2015 01:34 PM
Hi Xinghe,
what is a "simulated file"? 😄
There are several ways to communicate between parallel loops. All of them are explained in the LabVIEW help!
(queues, notifier, globals, locals, shared variables, DVR, AE aka FGV, …)
10-29-2015 01:40 PM
Ok, there are lots of ways to communicate, but are these state machines in the same project? Same VI? All in LabVIEW?
I like functional global variables due to the functionality that can be included in them. If they are used wrong, like most things when coding, you will create races and break your code.
Local variable work, but I try to stear clear of them when possible. If they are used wrong, like most things when coding, you will create races and break your code.
Queues are pretty popular for communicating, but try to stay with fixed size data if you think memory limits might be a problem.
If you are talking across a network look into Network Published Shared Variables (don't use these unless you have a stable network,) Network Streams, TCP/IP, UDP, or Web Services (you need experience in this arena. It doesn't just fall together.
LabVIEW is a good way to program, but this kind of touches the available options.
10-29-2015 01:42 PM
Thank you for your reply. The simulated data is the data saved from the equipment, and I want to test the GUI by that data first before I go to DLL. I know how to communicate data by queue, but how should I use queue to communicate between two state machines that located in their Sub-VIs?
10-29-2015 01:45 PM
The state machines are in the same project. Is there any tutorial or examples available to use queue funciton between state machines in the same project?
10-29-2015 02:02 PM
Check these:
Are you a subscriber and have the training available in your account?
10-29-2015 02:11 PM
Thanks! I found this that is very helpful: