08-09-2013 08:52 AM
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.
Solved! Go to Solution.
08-13-2013 06:48 AM
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
08-13-2013 07:43 PM
08-13-2013 07:50 PM
08-14-2013 08:10 PM
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
08-15-2013 12:40 PM
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 .