LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Represent single and multiple values in a Chart

Solved!
Go to solution

Hi,

 

I am trying to program 2 conditions using a case structure and a switch. Switch has 2 values, i.e when switch is on it sets the multiple case and when switch is of it sets the single case. Now what are the multiple and single cases. I have a while loop around the whole program with a wait of 500ms. Now in the single case a random number generator generates values every 500 ms and when the case is in multiple 3 random number generates values every 500 ms. What I want to do is represent these conditions in a waveform chart. So when the switch is in the single position then the waveform chart will show the single random number generators value over time and similarly when the switch is in the multiple position the waveform chart must be able to show all 3 values varying over time. But when i dont know how to do this. I have attached the vi which I attempted called sample.vi. Kindly do help me. Thanking you in advance. 

0 Kudos
Message 1 of 25
(3,766 Views)
Solution
Accepted by topic author govindsankar

Hi govind,

 

both cases need to output the very same data type (think DATAFLOW!).

So your "single" case needs to hide those two additional plots by filling them with NaN values!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 25
(3,742 Views)
Solution
Accepted by topic author govindsankar

Hi govind,

 

you have to build data into an array for waveform chart display. check the block diagram which i have attached in this post.

 

i'm using labview 2015. so, i was not able to check your VI. i hope my solution would be helpful. 

Download All
Message 3 of 25
(3,740 Views)
Solution
Accepted by topic author govindsankar

Here is basically what Gerd was suggesting.

 

Charting.png

 

NaN values are not shown on charts and graphs. Make sure to correctly set the cluster size of array-to-cluster.

(You only need exactly one "10" diagram constant. You can use a FOR loop to repeat a certain operation (e.g. generate random number and multiply it). No need for all that duplicate code.)

Message 4 of 25
(3,737 Views)

I have an array of values and I need to represent them in a waveform chart. The thing is I dont want to represent them all at once. I want to select values. For eg if there are 10 values, i select 5, the waveform shows the 5th value change over time. If i select 2 next without deselecting 5, then it shows both 5 and 2 and so on. It doesnt have to be an array. I just tried. The thing is I have different values and I need to represent them in a waveform chart over time and I need to select values according to my interest, like if there are 30 values and I need to 5,12,21 and 29, then I will select them and the chart shows all of them vary over time. I just tried to practice with array. It can be anything which helps to select the value. I have attached something which I have been trying. I dont know how much of it is ok. It could all be wrong since I have just connected array to a waveform chart. Please help on how to solve this problem. Kindly awaiting the reply. Thank You very much.

0 Kudos
Message 5 of 25
(3,713 Views)

Hi govind,

 

to select elements of an array you should use the IndexArray function...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 25
(3,700 Views)

Right click on the Waveform chart > Visible items > enable plot legend.

Right click on the plot legend > Visible items > Enable plot visibility check box.

you can drag the plot legend either vertically or horizontally for choosing multiple plots.

 

There you can select the plots, you want to see in waveform chart.

 

Thanks,

Manikandan.

Message 7 of 25
(3,697 Views)

I will explain once again. Consider I have 5 different numerical values say a,b,c,d,e. Now my task is to represent these values in a Waveform Chart. Lets say there are 5 buttons also for eg. A button for each numerical value. If i click on button 3 three numerical value 3 i.e c will be shown in waveform chart. If i deselect the button the wave form chart will be empty again. If i select both button 3 and 5 then numerical values 3 and 5 i.e c and e must be shown in waveform chart and so on. Anyway can be done. By forming these 5 values into an array or forming them into a cluster etc. Kindly please help me. 

0 Kudos
Message 8 of 25
(3,690 Views)

I know the index array function but with the index array function I am only able to insert one value in the chart at a time. 

0 Kudos
Message 9 of 25
(3,688 Views)

Just connect all data to the waveform chart. And follow what i have posted above.

0 Kudos
Message 10 of 25
(3,686 Views)