LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

self programmed pre- and post trigger

Hello,

 

I am planning a measurement system and search some ideas for programming how to realize it.

 

I have an older NI PCI-6024E and want to measure 8 voltage signals with 2 kHz. When task is started it should run some hours without task stop.

 

Every 2000th sample (= every second), I want to store this sample (all 8 voltages) into a continuous file with printf.

 

For this I do not need the sampling rate of 2 kHz, 1 Hz would be enough but I want to do more:

 

Every time when voltage_1 increases over 1.1 V, I want to store all data – and 100 samples before – with 2 kHz into an other file till voltage_1 decreases under 0.9 V – and 100 samples after –. It will be like a self programmed pre- and post trigger with continious running measurement task.

 

I think I can work with an fifo-buffer (double fifo[10000 samples][8 channels]) but do not know how to do this on a smart way 😉

 

Do you have any ideas how to mange it?

 

chemph

0 Kudos
Message 1 of 2
(3,611 Views)

Hi Chemph,

 

since you have to use a DAQmx task to realize the data acqisition you can not change the sampling rate when the task is acquiring data. So I think the idea you mentioned is quite good.

 

You can implement a lossy queue so samples are deleted when they are not needed anymore.

 

For the logging you can keep keep over 100 samples in the queue and look for the 101st sample if it fits the rage you want. Then dequeue all elements from the queue and save them into a file. Afterwards save all elements in the queue until you find a value that does not match your requirements. Them you save another 100 samples and then continue from the beginning. I guess the file writing can be implemented in a state machine that represents the modi you want to save the measurement data.

 

I hope, this helps you with the concept.

 

Regards,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 2 of 2
(3,567 Views)