02-21-2014 02:12 PM
Tony,
Why are you stuck on the term "wirelessly?" You really should use wires & dataflow to make sure your data is intact.
Can you give us a real world example on where you would need this "wireless" functionality?
Eric
02-21-2014 02:20 PM
My simple reason is the same one as why the local varible is used to push stop (wirelessly) in 2 different loops.
Real application:
I have a DAQLoop (prod-cons) constantly acquiring data, and UILoop (prod-cons) waiting for user events.
And, they're mutually exclusive, and in my UILoop there is graph update, alarm processing, etc.
Are these solutions correct:
1. If you can't solve it wirelessly, how do people usually pass the data globally by global i guess for critical signals?
2. and, to pass waveform data (which is huge & continously) i guess by using functional global right?
02-21-2014 04:14 PM
Perhaps this is what you are looking for...
02-21-2014 04:15 PM
Same code, posted as a screenshot...
02-21-2014 04:18 PM
Note that the FGV absolutely MUST be non-re-entrant.
02-22-2014 07:06 AM
Give this nugget a good read:Action Engine
02-24-2014 06:41 AM
Thanks Chris, i like this solution. 🙂
02-24-2014 06:42 AM
Thanks Cross, i will read Action engine too 🙂
02-24-2014 08:53 AM
There is another paradigm which usually works better. In any given loop, your best way to stop the loop is to use its native control mechanism. In your example, you have a data acquisition loop and a UI loop. Data acquisition loops are typically controlled by some sort of state machine or command processor, often queue based. UI loops are controlled by an event structure. The acquisition loop should exit when it gets a command or state transition to exit. In this case, it should fire a user event which will cause the UI loop to exit. The UI loop can exit due to a variety of control, menu, or user events. In this case, it should send a command to the DAQ loop to exit.
But wait, you say, my DAQ loop does not have a command processor, so using the functional global is far easier. If true, you need to refactor your DAQ loop so it is a command processor, state machine, or something similar. Using any global, including functional globals, for control purposes usually points to a place you could have a better design. Virtually all LabVIEW users go through the Global/Local » Functional Global » Queue/Notifier/Event command passing phases. I certainly did, and I don't want to go back. I consider functional global command and control variables a hack to use when you are in a hurry, but something to be solved with proper messaging in the future. Simply put, globals break data flow and should be used only when absolutely needed. The more you learn data flow, the more you avoid globals - by choice. You simply do not need them in virtually all cases.