LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform chart timestamp max and min not set to the value I needed

Solved!
Go to solution

So I have a waveform chart. That plots only when I press plot for a certain time period. I decide the time period and click plot. There will be like a minimum value and maximum value. I select that and then give it to the maximum and minimum of xscale like this.

govindsankar_1-1716900473829.png

 

So min value is 0 and max value is 2. So I want the x scale to show from 0 to 2. But it is showing a difference of two instead of from 0 to 2. That is start value is some value, for eg. 52 and end value will be 54. After some time update it from 0 to 3. And now X value will show for eg 152 to 155. Why is this? Thank you. 

 

 

0 Kudos
Message 1 of 11
(750 Views)

Hi govindsankar,

 


@govindsankar wrote:

Why is this?


Because it is a chart (with limited history length)…

What is your history size?

 

Using a graph you get full control over all the data to be displayed!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(731 Views)

I dont know what history size is. So every time I click plot, the first thing program does is clear the waveform chart, i did that by wiring an empty array to history data of the waveform chart.  Is this what you mean by history length.

 

govindsankar_0-1716905109185.png

 

0 Kudos
Message 3 of 11
(715 Views)

If the history is full after x=2, it means that your dx is around 2ms. This is either set manually, via property node, or via waveform or dynamic data parameters. Since you failed to show us your code, we can only guess.

 

Once your chart runs out of history, only the most recent 1024 points show, but x0 is still based on the very first point. If you would later again set xmin, xmax, you would no longer see any data.

 

Wring an empty array to the history data just clears the history, it does not define the history size. The history size cannot be changed at runtime.

 

As a first step, explain your experiment in more detail. Do you acquire a fixed number of points? What is the chart datatype (waveform, dynamic, scalar, cluster, array, etc.). What do you actually want to see?

 

 

 

Also please explain why you think you need local variables. Where are the terminals???

 

govindsankar_1-1716900473829.png

0 Kudos
Message 4 of 11
(684 Views)

for me dx is not a problem, it is changing to how much i want, but not the x0 and x1. Ok i will explain it in detail. 

My program is recording cell voltages. 84 cells. So its an array of 84 doubles. And every loop cell voltage changes. So I am storing this in a 2d array and every loop the next set of 84 values gets added. Also at the same time i am creating a time array, each loop takes 50ms and that is added to the array like 50, 100,150 etc but not in ms, i convert it to minutes. So now lets say the user wants to plot from 2 minutes to 6 minutes. They can set the value and click plot and what the program does is it looks for the index of time array for 2 minuts and 6 minutes and they find the corresponding values in the cell voltage 2d array using the same index and i get a new 2d array out of it which is cell voltages value from 2 to 6 minutes. And this 2d array is ploted to the waveform chart. Now in x axis i want the chart show as 2 and 6. So but it is not. Instead the dx is 4 and it will show something like 54 and 58, where the dx is again 4. That 2 and 6 are the local variable values which i have wired to XScale.Minimum and XScale.Maximum. This is the program.

0 Kudos
Message 5 of 11
(663 Views)
Solution
Accepted by topic author govindsankar

A chart is definitely the wrong indicator for that. Use a graph! (... and know the difference! 😄 )

0 Kudos
Message 6 of 11
(661 Views)

Ok, I will use a graph tomorrow after going to work and try to understand the difference. Thank you. 

0 Kudos
Message 7 of 11
(657 Views)

So I used a graph and finally got it to work. But still there is one small problem. I tried seperately on a different VI where I just put a waveform graph and gave values to Scale.Max and Scale.Min for X axis as fractional values, but waveform graph is not displaying it. The values I gave were 1.6 and 3.2, but it is showing 2 and 3 twice, that is 1.6 rounded off to two, the actual two, the actual 3 and 3.2 rounded off to 3. 

govindsankar_0-1717053171012.png

How can I make Waveform graph display the actual fractional values. 

0 Kudos
Message 8 of 11
(619 Views)

Never mind, I figured it out. There is a property node called XScale. Precision and I set it to 2 and I get the values. I tried to delete my post above but thats not possible. NI forum should allow us to delete our post if no one has replied under it and if we already found the solution ourselves.

0 Kudos
Message 9 of 11
(616 Views)

Hi govindsankar,

 


@govindsankar wrote:

NI forum should allow us to delete our post if no one has replied under it and if we already found the solution ourselves.


No, it should not allow to delete posts.

Reason: you got the chance to provide a solution to your question in case someone else has the same problem and stumbles over your thread!

What's wrong with posting solutions? After all it is a public forum to provide solutions to problems/questions and you are allowed to answer your own questions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 11
(603 Views)