LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ahhh!!! Time on X-scale for Waveform Chart!! Please help

Charts and graphs are very different animals.

 

A graph just displays the contents of an array (or other compatible datatypes). A chart accepts scalars or arrays and appends the new data to an internal buffer to be displayed. Once the buffer is filled, the oldest data is discarded.

 

If you want to use a chart as a graph, you should match the size of the history buffer to your array data or take some other measures to prevent mixing of old and new data and also to prevent truncation if the array is larger than the history buffer.

 

Do you show the Y axis? If not, you can stack graphs by just offsetting each trace in a single waveform graph.

 

 

0 Kudos
Message 11 of 18
(4,944 Views)

 However, if you think that things should behave differently, feel free to formulate a concise proposed "standards document" and post it over in the LabVIEW ideas exchange for comments, votes, and reviews.

 

Done two days ago  Smiley Happy

 


Defining the time axis of a chart is not trivial. Typical chart data has no time information, so the axis needs to be defined with t0 and dt, assuming equal spacing between points. What should t0 be? The time the program is started? The time the first data point is acquired? The time the data point is first sent to the graph? The time the data point is read from an old file? What should happen if the points are not equally spaced? Should the time be absolute (zero is Jan 1 1904, allowing the display of the correct months and year, etc.) or relative (zero is a time value of 0).


 Okay, makes sense.  Smiley Surprised  Right now, I'd be happy with just time incrementing on a boolean input ("Scopes On" switch in my program).  When the switch is on, increment the time on the Chart, otherwise don't increment the time on the chart.  .

 



We are here to help, so please ask when you get stuck.

 Great, because I'm stuck again.  I've modified the code to that I now have the time incrementing correctly (well, sort of, read on).  Two questions: 

1.  How do I expand the time span on the X-scale.  For now, I'd be happy with just having a 5 second span in there.  I've played around with the Min/Max but it's not working.  I have "autoscaling" de-selected. 

2.  I want to stop the time from incrementing from a boolean input, but retain the time.  When "Scopes On" input switch is on, the chart should stream data in and time starts (with 5 second span window).  When the "Scopes" switch is off, the chart stops populating and time stops incrementing.  Currently, once it starts it just keeps incrementing.  Is there a property somewhere that I need to set?

 

Thanks,

D



 

0 Kudos
Message 12 of 18
(4,939 Views)

Done two days ago  Smiley Happy


Correction.  I didn't submit an "official standards document" for review.  Only an idea proposal.  

0 Kudos
Message 13 of 18
(4,929 Views)

Sorry, I am currently on the bus and cannot see your code. We are in the middle of moving the lab to a new building, but hopefully I can find time later. Stay tuned...

0 Kudos
Message 14 of 18
(4,925 Views)

No problem.  I've found one obvious problem already that I'll work on.  I need a one shot type of code to set the time on each switch toggle of the Chart.  I found an example and will try to implement that and see how that goes.  

0 Kudos
Message 15 of 18
(4,922 Views)

<ignore this>

0 Kudos
Message 16 of 18
(4,909 Views)

Hi,

 

Bear in mind, I'm a noob at LabVIEW Smiley Wink

 

I found your post while having the same problem. This migt be a bit late, but then agin useful for others reading the post.

 

The Time axis on the chart is not really the time, it is simply the index of the datapoint in the dynamically created array. But the axis has a scaling property. In your loop you probably have something controlling the sample rate. Connect this to the 'multiplier'-property of the chart and you should be good to go.

 

BR

Sereda

0 Kudos
Message 17 of 18
(4,436 Views)

@SeredaStarseeker wrote:

The Time axis on the chart is not really the time, it is simply the index of the datapoint in the dynamically created array.


That is true when you wire an array (or single point) to a chart.  But if you wire up a waveform, the X-axis is based on the T0 and dt in the waveform.  You can gleam more of this if you check out this nugget: Sporatic Waveform Chart.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 18 of 18
(4,430 Views)