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: 

synchronizing VIs

Hi everybody,

I have to start 4 VIs simultaneously that collect data and display it on the
screen (wave chart). My questions are:

- how do I start the VIs simultaneously?
- how to switch between the VIs - while keep running the others at the
background?
- how do I refresh the screen when switching to another VI?
--
Have a nice day, RWS 🙂

-- PGP Fingerprint --
660F 9A2E 02B4 9E84 3A23 465B DF29 CE35 C797 F9C7
0 Kudos
Message 1 of 3
(2,722 Views)
[This followup was posted to comp.lang.labview and a copy was sent to the
cited author.]

In article <8au4b4$gr$1@news01.btx.dtag.de>, rwstrang@gmx.de says...
> Hi everybody,
>
> I have to start 4 VIs simultaneously that collect data and display it on the
> screen (wave chart). My questions are:

I'm not sure what you have in mind. Do you want four VIs on a (large)
screen each with its own chart, or one display VI displaying information
sent by/collected from four subVIs which collect the data in parallel?
e.g. using a messsage queue or reading front panel controls using VI
server?

> - how do I start the VIs simultaneously?

Have a look at the rendezvous function. It works as a "pause" in each VI
until all four reach the pause point, when the all co
ntinue in parallel.

> - how to switch between the VIs - while keep running the others at the
> background?

LV multitasking should do what you want by default. Once the VIs have
started they will run whether they have the focus or not.

> - how do I refresh the screen when switching to another VI?

Do you mean updating the front panel? If so, again this should happen by
default to all VIs which have their front panel loaded.

Regards
Bernard Treves Brown
Whaley Bridge
UK.
0 Kudos
Message 2 of 3
(2,722 Views)
> I have to start 4 VIs simultaneously that collect data and display it on the
> screen (wave chart). My questions are:
>
> - how do I start the VIs simultaneously?
> - how to switch between the VIs - while keep running the others at the
> background?
> - how do I refresh the screen when switching to another VI?
> --

There are a number of ways to do what you want, but not much information
to use to choose between them. First off, if the underlying driver that
is acquiring the data can be configured to share a trigger or otherwise
synchronize, then that will give the most synchronized results.

If this is just meant to be SW synchronized, then your choices are to
make the four calls short as possible, call them one after the other,
or place them in parallel and call them all at once. These are rather
similar assuming you have one CPU, only one can run at a time, and the
parallel case doesn't ensure which goes first whereas executing them
one after the other, you do know the order, but perhaps have bigger
gaps between the calls.

Another SW technique you can use is occurrences. Make the subVI call
wait on an occurrence that the top level diagram will set when it wants
the subVIs to measure the data. Have the top level diagram call all four
subVIs in parallel, then set the occurrence. Another thing that will be
helpful is to have the subVIs call Wait ms or wait on another occurrence
immediately after they have their data. This will give the other subVIs
time to finish. When all are finished, the top level diagram can set
the second occurrence and all four subVIs will return their data where
it can be processed, plotted, etc. Then loop back to call the subVIs
again.

A variation of this would be to have the four subVIs be four independent
VIs with their panels open, and another VI, subVI or top-level synchronises
them using an occurrence like described above.

Again, your implementation depends alot on what you mean by simultaneous.
There are no time constants mentioned, nor any mention of how the data is
being acquired.

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