LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting to a number of asynchronously called subVI front panels

Solved!
Go to solution

Hello everyone,

 

I'm working on a DAQ and monitoring program and I have a dream of doing some very flexible window management for my plot windows. Trying to make it easy to quickly open different kinds of plots and display different channels in each window. So as not to reinvent the wheel I'm trying to use Windows windows to do this by calling VIs asynchronously. The VI will be built as an EXE and used by people who don't know LabVIEW, hence trying to make it really flexible and intuitive.

 

I've set up my VI like this example and it has me real close: http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/acbr_call_clones/

 

When I run the VI it opens whatever number of plotting windows (instances of my plotting window SubVI) I've specificed but the plots don't update. Anyone have any tips as to how to get this behavior?

Xander Cesari
Automotive/Internal Combustion Test Engineer
CLAD certified, mainly focused on data acquisition
Been LabVIEWing for a few years, still a lot to learn
0 Kudos
Message 1 of 5
(2,707 Views)

It would really help to see your code, specifically snippets of the calling sequence as well as a snippet of the VI being called.

 

One way to test something you want to do asynchronously is to try it in "synchronous" mode.  Suppose your asychronous VI is called "Do Plot", and you have a routine somewhere that sets up to call Do Plot asynchronously.  Replace the setup call with Do Plot itself (a single synchronous copy) and see if it runs.  What I suspect might be happening (but can't tell as I can't see what you've done) is you might not have passed the necessary arguments into the asynchronous Call.  In particular, if Do Plot is supposed to be "fed" points to plot, how are you getting the points into the sub-VI?  You can't directly pass them in through the Front Panel, since you only call it once, and Data Flow says that's the only set of points it will get.

 

What I've done when I needed to do this is to establish a Queue into which I put the points.  I then establish the same Queue in my plotting routine, either by passing in the Queue reference or simply creating a second queue with the same name (this is the reason you can name Queues, after all).  If you do it this way, you'll need a separate named Queue for each asynchronous Plot routine and will have to enqueue new points into all of them, but this should work.

 

Bob Schor

Message 2 of 5
(2,699 Views)

Bob,

 

Thanks for the reply. I'm using a QSM-PC architecture, here's the relevant loop. Looks pretty much identical to the linked example, I hit that point and I decided I needed a bit of help wrapping my head around it. Data's coming in on a queue (the snippet broke the reference). My idea was to pop open all the windows in this state then use another state to plot data to them.

 

Calling Asynchronous VIs.png

 

In 'synchronous' mode I was able to get the desired behavior out of my subVI but it was also set right in a while loop and by playing with the Call Setup a bit I got it to do what I needed (open a new front panel and constantly plot).

 

The queue idea is very promising though! I should be able to generate queues right in the For Loop that calls my VIs synchronously then enqueue in a "RUN" state. I'll give that a try.

Xander Cesari
Automotive/Internal Combustion Test Engineer
CLAD certified, mainly focused on data acquisition
Been LabVIEWing for a few years, still a lot to learn
0 Kudos
Message 3 of 5
(2,691 Views)
Solution
Accepted by topic author xander.cesari

Hello Cesari, I attach a quick proposal which can you improve, I hope this help you.

Download All
Message 4 of 5
(2,674 Views)

Ayanez, you're psychic! I had just implemented the queue idea but the performance was very poor. Your event solution works much better. Thanks to both you and Bob!

Xander Cesari
Automotive/Internal Combustion Test Engineer
CLAD certified, mainly focused on data acquisition
Been LabVIEWing for a few years, still a lot to learn
0 Kudos
Message 5 of 5
(2,669 Views)