LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

chart x values normalized

Solved!
Go to solution

Can I normalize the chart x axis range from 0 to 100 regardless of the number of samples while the program is running ?  I think it needs to be done dynamically each time a point of data after 100 is plotted.  I don't want to reinitialize the chart each time it collects the 100th data point if that means the chart clears and starts from 0 again.

 

Is there a property node/s that I can use to dynamically change the chart / graph maximum y value?

 

Thx

0 Kudos
Message 1 of 8
(4,739 Views)

There is a way to programatically change the number of points in the chart history without having to use property nodes:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YI6UCAW&l=en-US


If you want to use a property node you can set the x-axis min or max and a number of other properties dynamically. To create a property node simply right click the Waveform chart in the block diagram and click create > property node, then choose the approriate property. Here is a help file on property nodes in case you are not familiar with them: https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/property-node.html

 

Attached is a screenshot of one I made on your vi, please let me know if this helps or if this is not what you're asking about. You may also try playing with the chart types to see if there is a simple way to do what you want: https://www.ni.com/docs/en-US/bundle/labview/page/types-of-graphs-and-charts.html

 

Hope this helps!

 

 

 

Rob B
FlexRIO Product Manager
0 Kudos
Message 2 of 8
(4,695 Views)

Rob,

 

The xscalemin and max do not work.  It looks like it is trying to write all the points from 0 to 100 after it exceeds 100 back to the chart.  This creates a two plots, the data that is being charted and the initial data between 0 and 100.

 

I believe I need to do something with an array or the Xscalemarkervalues{} property node.  I think each point after 100 has to replace the point at 100.  The rest of the data points would be shifted toward zero.  Each time the previous 0th data point would be discarded.  I don't know how to execute this but will work on it later when I get a chance. 

 

My code has a DAQ assistant but you can replace it with the control to simulate 0-5vdc input . 

 

Thx

0 Kudos
Message 3 of 8
(4,661 Views)

I think this link describes how to do it but I am struggling with the implementation.

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YI6UCAW&l=en-US

0 Kudos
Message 4 of 8
(4,639 Views)

I believe this does what you want, I simply selected the last 100 values from the data array and plotted those. Let me know if this helps.

Rob B
FlexRIO Product Manager
Message 5 of 8
(4,616 Views)
Solution
Accepted by topic author ggress1

Rob,

 

You nailed it !!! Thanks for your help !!!

 

I removed xmin / max and x / y autoscaling to polish chart behavior.

 

Thanks

0 Kudos
Message 6 of 8
(4,598 Views)

Rob,

 

You nailed it !!! Thanks for your help !!!

 

I removed xmin / max and x / y autoscaling to polish chart behavior.

 

Thanks

Download All
0 Kudos
Message 7 of 8
(4,598 Views)

A graph was used in the previous solution.  My original question was how can I normalize the x axis range between 0 and 100.

 

Attached is my solution using a chart. 

0 Kudos
Message 8 of 8
(4,491 Views)