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: 

Adding cycle count to a labview chart programatically

Solved!
Go to solution

Hi Folks,

I’m in the process of designing a small test stand to evaluate wheelchair components under accelerated test conditions.

Often these tests run into the hundreds of thousands of cycles so to save post test processing time I take a front panel snapshot every n cycles (or if the unit fails).

The final report consists of a series of jpegs containing all the relevant information without the need to touch excel.

I would like to add the cycle numbers directly into the chart so  I’m looking for a method to combine the cycle count with its corresponding peak on the graph and ideally have a procession of cycle numbers.

(Dummy example attached LV17)

Thanks in advance

Si

 

 

0 Kudos
Message 1 of 16
(3,717 Views)

Why not use the cycle count as your X axis in your chart instead of time?

========================
=== Engineer Ambiguously ===
========================
Message 2 of 16
(3,669 Views)

Instead of trying to display the Cycle Count as part of your Waveform Chart, just take the Indicator and drag it on the Front Panel so that it "sits on top" of the Waveform Chart, for example, in the lower right part of the chart under the X Axis.Waveform + Cycle CounterWaveform + Cycle Counter

Bob Schor

Message 3 of 16
(3,661 Views)

I have needed to do this before, and it'll probably save you some time in the long run to just make a "display" VI that has the plot, a cycle count indicator, test notes, test start time, whatever else you think you might need, then use a Front Panel.Get Image invoke node to get a screenshot of all of the front panel controls and indicators:

 

getfpimage.png

 

I would recommend making a subVI that does this instead of calling that on your main front panel, as you can make it look nicer if you're only using that VI to generate a picture to save. Do like Bob said and add some more indicators and such and you should be good to go.

 

Another way to do this would be to use a property node and change the label of the X axis (or the plot) to "Time (cycle 53)" or "Plot 0 (cycle 53)" or something.

Message 4 of 16
(3,647 Views)

It seems like a gigantic waste of disk space to save pictures, because they cannot really be read back by code for further analysis. Since your chart scale is not set to autoscale, you only see the last 60 points (of the 4000 stored in the history buffer). Why not just append three values (timestamp or iteration, chart value, count)  to a plain text file whenever the chart value or count changes? You could even write a program to playback the file at any desired speed or create a detailed report.

Message 5 of 16
(3,639 Views)

Hi Bob,

I didn’t include it in my example because I thought it would confuse matters but I’ve been using the front panel grab idea where all the relevant data is captured which is similar to your suggestion. (which reassures me it’s an acceptable method)

 Ideally, I would take the markers (which are basically time values) and get the graph to display the cycle instead of the time value. Just how to do that is my problem.

 

Regards

Si

0 Kudos
Message 6 of 16
(3,603 Views)

Hi Bert,

I believe you posted this suggestion some time back and it has saved me some much work since. So a massive thankyou if it did come from you. I’ve not looked at the property node Idea but it’s worth pursuing. Especially if I can programmatically identify something like cycle 67 – 72 as the base. The fly in the ointment is variable cycle time will have an impact upon the calculation.  

 

Regards

 

Si

0 Kudos
Message 7 of 16
(3,601 Views)

Hi  Altenbach

While if this was a research project I would agree with you this application is for production acceptance testing. This example was bases upon a linear actuator sub-assembly bought in from China.

As with all this type of work we have to check functionally and longevity of components, so I use a state machine where exceeding predetermined limits (i.e. excessive current, over temp, operating to slowly/fast) leads to an error state. I use a circular buffer to hold an hours’ worth of data which is written to disk on either an error or specified interval. I have been using BertMcMahan front screen grab for some time (I stole the idea from this forum ages ago so I guess it’s not the first time he proposed it).

99% of the time the units fly through, we have evidence of due diligence and nobody ever looks at the data. If it does fail then I have snapshots of data to analyse including the period leading up to failure.

It works quite well I just want to spruce up how I present the data.

 

Regards

 

Si

0 Kudos
Message 8 of 16
(3,599 Views)

By adding the following (and updating the initial History write):

changingValue.png

 

I was able to add vertical lines, like so:

graph.png

which helps highlight the location of the changes to the "Cycle Count" counter. I haven't found a way to label them as they move though...

Perhaps this helps at least by showing the position of the current value as the rightmost line? (here, cycle count = 2).


GCentral
Message 9 of 16
(3,565 Views)

Actually, following some reconsideration, probably the following is better:

alternative.png

Here I added a shift register for the 2nd plot value and just flip the sign when the increment is true. This produces only a single line each time (instead of the double-line that was in the previous post):

screen capture of front panel rather than chart to clipboard - perhaps easier to seescreen capture of front panel rather than chart to clipboard - perhaps easier to see


GCentral
Message 10 of 16
(3,558 Views)