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: 

append waveform not resetting

Solved!
Go to solution

here is the high level explanation.  I want 100Hz samples, groups of 10.  I want to check for discontinuities then take the last datapoint in each group of ten.  then take that last datapoint so I have 1sample/sec if all goes well.  add up my 1S/s to a "scan rate in seconds" (usually 15 sec) and if there are no data anomalies, take the last data point and write it to file. if there is an anomaly, I want the typical scans plus an additional column of the event logged at the full 100S/s.

Specifically, I am using Get Waveform Subset succesfully, I think, but when I Append Waveform, the timestamp is stripped. I was about to try Get XY of Waveform, but I thought posting this to the forums might get me ahead faster than slogging through it.  So how can I easily cherrypick the last datapoint of these subgroups successfully?

I'll take other ideas, too.  I seem to get tripped up on little things like this.  Also, plz forgive the mess. it is a work in progress.  Thermal cycling rig 8-2-13 v2.vi is the base code and TDMStoExcel and RunMacro vis can be deleted if you are trying to run it. they work

 

thanks in advance

0 Kudos
Message 1 of 4
(2,172 Views)

sorry forgot to mention.  the append array function is appending continuously.  i want it to reset after the for loop.  if I can get that, that would allow me to proceed to a hopefully workable phase of this project

0 Kudos
Message 2 of 4
(2,169 Views)

Hi comedygene,

 

For "cherry-picking" the data have you considered using a conditional terminal on the for loop that analyzes the data?

 

A good example is below:

https://decibel.ni.com/content/docs/DOC-25442

 

Additionally, you may want to consider creating sub-VI's for some of the functions you are working with to make the framework easier to organize and adjust.

Evan See
National Instruments
0 Kudos
Message 3 of 4
(2,112 Views)
Solution
Accepted by topic author comedygene

the for loop is just to dequeue ten sets of ten, resulting in a one second base sample rate.  that way I can run a "scan rate in seconds" to the while loop with the option to capture events at 100Hz.  i solved the problem of the array not reinitializing by using the auto index function.  I had shyed away from that initially because, when I expand the data process to all of the channels, I was unsure of how it would affect the waveform arrays.  I didnt want to manipulate 3d arrays if I could help it.  not my forte.  next, I will try the Get Waveform Subarray on the full nine channels and see if it works. after that, the data dump.  I need it to write to file for the nine channels and hopefully not wait to write until the data dump event.  I want it to tick away at the scan rate and then create an additional column only if there is an event.  I am trying to capture functions in sub vis.   the first data process subvi will do much of the limits checking and boolean logic responsible for motion control.

 

The example you gave is a great idea for the logic I wish to implement.  thanks for the suggestion!

 

Tom

0 Kudos
Message 4 of 4
(2,101 Views)