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: 

Display 2 signals on Same graph

HELLO;

I'm traying to display two signal  on same graph with case structure and for loop, but when the for loop treaty the second signal, the first signal dislayd zero, So I want to register the last value of signal in the dysplay when the for loop treaty the other case. 

0 Kudos
Message 1 of 2
(2,290 Views)

First, a few tips.

 

1.  Make sure all of your controls have labels with meaningful names.  Right now you have two charts that have no labels, and no names when I make the labels visible.

2.  The configuration of the serial port belongs outside the main while loop.  There is no reason to reconfigure it on every iteration of the inner For Loop, then repeatedly after that after time the outer while loop iterates.

3.  You don't need a separate timeout setting on that VISA resourse.  The Serial Configure already has an input where you can set the timeout.

4.  Use block diagram cleanup tool to straigten out your wiring.

 

Now to your question.  I'm not sure about displaying zero on a chart.  But what I do see is that you have two charts, one gets data when the inner for loop is on the 0th iteration, the other gets it when the inner For loop is on iteration i=1.

 

Go to Find Examples int he chart menu and search for "waveform".  There is an example called "Waveform Chart Data Types and Update Modes.vi"  You'll see in there that if you bundle together two different data points before wiring that into the chart, it will udpate two different series at once.

 

If you want to have both sets of data show on in a single chart, then that chart belongs outside of the For Loop.

0 Kudos
Message 2 of 2
(2,245 Views)