09-07-2018 04:48 AM
Hello there,
I'm currently working in a project that the data acquired from the sensors should have been monitored in a test panel.
I got the front panel design and i also made this vi re enterant.
Now I need a solution to pass sensor data continuously to a dynamic vi? Is it possible to make it by using set.control.value node within a for loop, or is there any elegant and safer approach?
thank you
09-07-2018 08:09 AM
Why is a simple monitoring VI re-entrant?
You can pass data to a parallel loop via a Queue -- if nothing new comes in, it will just output the "old" values. As always when running parallel loops, you need to give some thought about how to shut them down properly.
Bob Schor
09-07-2018 08:22 AM
Hi Ademirel, I recommend you to check out User Events or Queues for this task.
I wrote a quick example to demonstrate one way on how you can achieve this. Run Sensors.vi first and then Read Sensors.vi and see how the process communication is handled by the unitary lossy queue. Any VI that lives in the same memory space as your main will be able to access the queue reference and get the sensor data.
The example was written in LV 2015.
Hope this helps.
09-07-2018 09:28 AM
@Ademirel wrote:
I'm currently working in a project that the data acquired from the sensors should have been monitored in a test panel.
Now I need a solution to pass sensor data continuously to a dynamic vi? Is it possible to make it by using set.control.value node within a for loop, or is there any elegant and safer approach?
thank you
What do you mean by "to pass sensor data continuously to a dynamic VI"?
What exactly are you trying to do?
Also see below...
09-10-2018 02:54 AM
Sorry for the late reply,
I'm trying to monitor my data in a monitoring loop by streaming them in real time.
Due to the circumstances, i may call the monitor loop in different times with different channels, therefore 'Im trying to do it by using dynamic call.
09-10-2018 06:11 PM
I've done this two different ways. In one situation, I was monitoring multiple analog channels, all sampled at the same time (e.g. 16 channels at 1kHz), but displayed at a much slower rate (20 updates/sec, so about 30 seconds scrolled across the screen). All of the data were streamed to the Host PC, but controls on the Chart enabled me to select which one (or ones) of the Channels to view. We typically looked at 3-5 at the same time, and largely ignored the others.
The other example was monitoring 24 behavioral stations, each of which was acquiring data at 10 points/sec and displaying it on a Graph showing the last 5 minutes, last 25 minutes, or last 125 minutes of data. We actually had 24 "clones" (identical VIs called with Start Asynchronous Call), each of which had a Graph as its entire visible Front Panel. If we wanted to view Station 5, say, instead of Station 9, we sent Station 9 a signal saying "stop updating your Graph, we don't need to see it" (which saves lots of time) and told Station 5 to "start updating your Graph". We also (in the Main) removed Station 9 from the sub-Panel and connected Station 5. So the Front Panel decided which Station it wanted to view, told the Station to display its data, then viewed the Station's Front Panel in a sub-Panel. No moving parts, and (I think, though I'm not 100% certain of the terminology) no Dynamic Calls.
Bob Schor