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: 

Represent single and multiple values in a Chart

Solved!
Go to solution

Here is my attached VI. I have an array of elements which I get with some random numbers in the beginning since I am lazy to create one myself, so that part is not important. The part that is important is what comes next. When I select a value from the array using the index and click add element it adds to an array that will show in the waveform graph. Similary when I press delete then it deletes the value which we have selected. My program is currently working as I wanted and I have used your suggestions to create this code. Now please go through it and see if anything is wrong with the code or whether anything can be done to make it better. Currently I am able to add and remove elements according to my wish, which is what I have been trying to do. But I see there is another problem, i.e the array of elements are shown as 1 in the waveform chart. Is there any way where I can show different values of the array as different waveforms in the waveform chart. Thanking You.

0 Kudos
Message 21 of 25
(615 Views)

Hi govind,

 

can you attach a downconverted version of the VI (LV2017 preferred)?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 22 of 25
(613 Views)
0 Kudos
Message 23 of 25
(609 Views)
Solution
Accepted by topic author govindsankar

Hi govind,

 

- when you want to prepend a new element to your array you should use the BuildArray function instead of InsertIntoArray!

- what's the point of that inner FOR loop? Remove it!

- I recommend to use a shift register in favor of the feedback node to get a better overview (aka THINK DATAFLOW) of your block diagram. (Using the shift register you don't get backward wires…)

- it would help to initialize the array shown on your chart…

- it would help to use an event structure instead of your polling loop…

 

Some of those suggestions:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 24 of 25
(601 Views)

Thank You very much

0 Kudos
Message 25 of 25
(597 Views)