LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to event dump from a running buffer

Solved!
Go to solution

I am looking for efficient ideas on an event dump.  Right now I have a basic datalogger.  it takes data at 100Hz and discards all but the last datapoint for a specified time frame. eg: one sample every two seconds, not two hundred.  I am looking to record discontinuity events without sacrificing the basic datalog function.

 

I am thinking that I want the channels of interest to be stored in a running buffer at the full 100Hz.  maybe a lossy queue or an running array of specified length?  Another concern is how to add this data after the basic datalog colums but not have the datalog dequeue wait on data from the possible event? Would there be a diffference between putting the event structure around enqueue element in the process loop and placing it around the dequeue element in the datalog loop?  I am relatively new to labview so if I get it working, it will probably not be a "best practice" answer.   I am going to start playing with the code, but high speed, low drag answers are really appreciated.

0 Kudos
Message 1 of 6
(2,864 Views)

Hi comedygene,

 

I’m not sure what you mean by an event dump and discontinuity events, but it sounds like you have the right idea with using a queue and a producer/consumer architecture (that appears to be what you’re using). You can definitely try putting your event structure around the Enqueue Element function. The Dequeue Element function in a loop will just repeatedly wait and timeout if the queue is empty, then dequeue elements as soon as they’re queued up.

 

Regards,

Kelsey Johnson

Applications Engineering

National Instruments

0 Kudos
Message 2 of 6
(2,820 Views)
The bottom is a flush Q. Outputs array. I get what I want by running array in for loop. Inside loop. Use index array then split signal to get one channel of one element. In this case an element is a set of ten points, or a waveform of one channel with ten points comprising it. Also inside loop is append array with shift register. After for loop, I have four long waveforms that are the length of the Q. Great so far. Problem is that append array strips time stamp. Tried to get tO and dt before loop, then use set property to reset time stamp after loop. Tried other things too. No avail. Tried build waveform. Oddly did not see append array. That leaves me with 2D array, reshape array, get t0 and dt, set waveform properties, build array as a process. Running out of ideas and that is too darn complicated to be a best answer. I'll try to upload most recent vi so you can see what I'm trying to do. I tried to describe it but a picture is worth......something.
0 Kudos
Message 3 of 6
(2,802 Views)
You asked about event dump. The Q holds a running buffer. If my signals are out of spec, the entire buffer writes to file. This way, instead of seeing the event at the scan rate, which is 1-15 sec (long term test), I can graph the out of spec event at the full 100 Hz resolution. Better troubleshooting. I chose a running buffer instead of logic in the process loop because I want the data immediately preceding the event. If I handled it in the process loop, I would only see the data after the problem starts.
0 Kudos
Message 4 of 6
(2,799 Views)

comedygene,

 

Go ahead and post the newest version of your code so I can take a look. There should be a way to build an array without losing the timestamp (2D array?) but I might get a better idea if I can see what you're trying to do.

 

Kelsey Johnson

National Instruments

0 Kudos
Message 5 of 6
(2,775 Views)
Solution
Accepted by comedygene

Good news! it works.  I tuned how the logic works so it catches small interrupts.  it took some time, but it works.  i tried a local variable for the data dump, but it didnt catch quick events.  I had to put it into the Q and split it off in the logging loop. another thing is the case structure for the append array.  the first iteration feeds the first element into the top of append array so the timestamp is preserved. all subsequent iterations shift thenew element down to the next slot, making room for the appended array in slot 1 .

0 Kudos
Message 6 of 6
(2,763 Views)