LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bar graph time change

Hello Forum Members

 

In the attached vi a graph simply plots two values side by side in bar format. What I would like to see happen, and need some assistance with is:

 

1. Any bars plotted to remain on the graph for historical visualisation

2. When the date changes, another two data points will present themselves to the graph, and I would like to plot these next to the previous plot group (with a space in between the two plot groups)

 

Thats it. Would anybody be able to show me this? I've looked through the previous posts, but have been unable to find something close enough to my requirement

 

Thanks and best regards

Ray

 

ps....does anybody see the red line at the bottom of the second (white) bar (at the 0 x point, and across the width of the plot)......what is this artifact?

0 Kudos
Message 1 of 5
(2,400 Views)

Hi Ray,

 

look at this:

check.png

When you spot the difference (in your older version at the bottom) you will know how to prevent the "red line" glitch... At the top you will find a different solution for your 2-nested-FOR-loops coding Smiley Wink

("What is this artefact?": Well you wired a zero - and this zero is plotted as expected. Or did you expect something different when wiring a zero for plotting?)

 

For your other problem: a graph doesn't has it's own buffer for data. It only shows the data provided at last write access. So you have to make your own buffer (use a 2D array for your two plots)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,386 Views)

Hi Rayclout,

 

I created a sample program for you. It doesn't follow the exact same architecture as your original code. It does however produce what you have laid out in your post.

 

I used an event structure inside a while loop instead of for loops. This architecture allows the user to record data after every input. The data points are stored as a 2D array which is displayed in a waveform chart. The main difference between a waveform chart and a waveform graph is that the waveform chart stores its data history. 

 

The thin line at the bottom of the bars in your graph is due to the fact that there is still a data at 0. I was able to hide it by assigning a -1 constant to the array and uncheck auto scaling in the y axis chart of the waveform chart properties. 

 

It's not perfect, but this should give you a good start.

 

I hope it helps.

 

Josh L.

Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(2,350 Views)

Thanks Josh, however I can't open with my LV version.

 

I am using LV2009 Version 9.0.1 SP1

 

Would you mind doing a downconversion for me please.

 

Regards

0 Kudos
Message 4 of 5
(2,337 Views)

Hi Rayclout,

 

Attached is the LabVIEW 2009 version of the code. Hope this works.

 

Regards.

 

Josh L.

Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(2,321 Views)