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: 

How to plot multichannel graph taking data from a queue (i.e. points of random channels one by one)?

Solved!
Go to solution

Hello,

I am scanning 10 resistors (measuring resistance) using a multiplexer card PXI-2503 and a soursemeter Keithley 2400. As I'm reading data one by one and from each reading create a cluster containing a channel, time, resistance value. Then every cluster is sent to a queue.

Queue is used to write data to a TDMS file and also I would like to plot resistances of all channels on a graph vs time. The question is how to plot multichannel graph taking data from a queue (i.e. points of random channels one by one)?

 

0 Kudos
Message 1 of 8
(3,368 Views)

Hi m@NI_forum,

 

You can use an XY Graph. In a shift register, you will hold an array of XY graph data, which itself is a cluster of x-array and y-array. When you receive a new point, index to the correct XY data (using the channel #), add your new X and Y points to corresponding arrays, and reassemble your data.

 

You can use a nested "in place element structure" to access the array element and the cluster elements.

0 Kudos
Message 2 of 8
(3,360 Views)

For some reason, I cannot find Build XY Graph VI in my palette. Is there a way to plot without using Build XY Graph VI? By the way, can I download Build XY Graph VI anywhere?

0 Kudos
Message 3 of 8
(3,337 Views)
Solution
Accepted by topic author m@NI_forum

You can create an XY graph without the express VI, in fact I'd prefer if you did!

Here is an example of building the plot one point at a time. Note that it is not an example of good programming practice (no errors, typedefs, queue release, loop stopping) it is just meant to get you up and running.

Capture.png

Message 4 of 8
(3,332 Views)

Thank you. Could you please write me the name of the Clipboard02.jpg tool? I cannot find it. Unfortunately, I cannot open your VI as I use an older version of LabVIEW.

0 Kudos
Message 5 of 8
(3,320 Views)

The function is called "Build Array".  It exhibits "polymorphism", changing its appearance (and behavior) depending on what is wired to its input(s).  Drop one down on a Block Diagram and read its Help entry.

 

Bob Schor

Message 6 of 8
(3,308 Views)

 

0 Kudos
Message 8 of 8
(3,257 Views)