LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Time dependent Logging/Viewing from the same source

The problem:

I have one device, I would like one loop to run and wait a given ammount of time - this loop will query the device for the data displayed in the UI, another loop is to query the device at other differant times and log the data to a file.

Say for example the view is updated with fresh data every 1/10th of a second and the log is written with data every 1/2th a second.

How can I get these to run concurently?

For example, in java I would create two differant threads and set the sleep time in both to differant times, calling start() on each would give me two differant threads within the same program. What is the process to get this kind of "process detachment" behaviour in LabView?
0 Kudos
Message 1 of 3
(2,499 Views)
If the timing is divisible between the two queries, then simply have one server to make the data available, and divide the timing between the two clients. In otherwords, if you report the data at an interval corresponding to the viewing (the faster interval), then every nth (5th in your case?) iteration, save the data to your log file.

Don't make this more complicated then it needs to be. You don't need anything as fancy as separate threads to do this. You are merely reporting data every 100ms, and recording one out of five data points.
0 Kudos
Message 2 of 3
(2,499 Views)
> I have one device, I would like one loop to run and wait a given
> ammount of time - this loop will query the device for the data
> displayed in the UI, another loop is to query the device at other
> differant times and log the data to a file.
>
> Say for example the view is updated with fresh data every 1/10th of a
> second and the log is written with data every 1/2th a second.
>
> How can I get these to run concurently?
>
> For example, in java I would create two differant threads and set the
> sleep time in both to differant times, calling start() on each would
> give me two differant threads within the same program. What is the
> process to get this kind of "process detachment" behaviour in LabView?
>

I agree with the other post that you probably don
't need parallel tasks
here, but if you do, here goes.

Make two loops, side by side, over and under, just not one inside the
other. The two loops will multitask and run in parallel as long as they
don't have dataflow connections. Drop a Wait Ms node inside the loops
to control the loop speed, and you pretty much have the same as the Java
solution, but simpler IMO. If the loops need to synchronize for some
reason, there are synchronization primitives in the advanced palette,
but again, it will likely be easier to put the tasks in the same loop
and simply make a modulo counter to control how often the various tasks
fire.

Greg McKaskle
0 Kudos
Message 3 of 3
(2,499 Views)