Acquiring data after trigger with c
Posted: Mon Nov 26, 2018 3:52 pm
Hi all,
I need to run a c program which continuously monitors the input on analog input 1 and saves data if a pulse occurs. The pulses last around 10 ms and I would like to save data before and after the pulse. Therefore I believe that a decimation of 1024 (buffer length = 134.218 ms) is the best.
I have tried to modify the acquire_trigger_pose_edge,c program from the Examples folder, but a few things don't make sense to me.
I test my program with a pulse generator that sends a 1V pulse every 5 seconds.
The value I choose for the trigger in: rp_AcqSetTriggerLevel(RP_CH_1,1); does not change anything. I get the output even though my data has not reached the trigger value. Why is that?
Also, I cannot change the decimation, I tried with rp_AcqSetDecimation(65536); which I believe should give me more than 8 seconds of data for a 16k buffer. This would mean at least one pulse. But that does not happen. Why??
Whatever I do, I just get 16k of values very close to 0V.
I hope someone can help me understand what I am doing wrong.
Cheers,
Maja
I need to run a c program which continuously monitors the input on analog input 1 and saves data if a pulse occurs. The pulses last around 10 ms and I would like to save data before and after the pulse. Therefore I believe that a decimation of 1024 (buffer length = 134.218 ms) is the best.
I have tried to modify the acquire_trigger_pose_edge,c program from the Examples folder, but a few things don't make sense to me.
I test my program with a pulse generator that sends a 1V pulse every 5 seconds.
The value I choose for the trigger in: rp_AcqSetTriggerLevel(RP_CH_1,1); does not change anything. I get the output even though my data has not reached the trigger value. Why is that?
Also, I cannot change the decimation, I tried with rp_AcqSetDecimation(65536); which I believe should give me more than 8 seconds of data for a 16k buffer. This would mean at least one pulse. But that does not happen. Why??
Whatever I do, I just get 16k of values very close to 0V.
I hope someone can help me understand what I am doing wrong.
Cheers,
Maja