03-01-2009 05:32 PM
Hi
This is probably a very fundamental question but since this is my first NI-DAQmx project it is not obvious. I have created a task and I am using DAQmxCfgAnlgEdgeRefTrig. If I delay the reading (DAQmxReadAnalogF64) so I know there has been a trig everything works perfectly. I assume there is a way to check if there has been a trig or an event to attach to but I have not managed to figure it out.
How do I solve this?
Best regards
Anders Sneckenborg
03-19-2009 03:47 AM
Hi, Have you solve the problem or do you still have the problem?
/Christine
03-21-2009 11:14 AM
I still have the same problem. Any idea what to do?
Best regards
Anders
03-24-2009 03:26 AM
Hi Anders,
I'm not sure why you want to make sure there has been a trigger? Could you please describe your question a bit furhter!
Thanks
/Christine
03-25-2009 01:13 AM
Hi Christine
I set up a task with a trigger on a raising flank. In my application I would like to get the data as soon as there has been a trig and never if no trig appeared. Now I have solved it in a not perfect way by leaving it to the operator to "guess" if there has been a trig. He/she then press a button and the data is collected from the instrument.
I assume there is a much smarter way so that the application itself can figure out when there has been a trig and then collect the data.
Do you understand what I mean?
/Anders
03-25-2009 03:20 AM
Hi Anders,
I'm not sure why you are using a reference trigger and not a start trigger. To me it sound more like you need a start trigger. Look at the slides I have attached. A reference trigger will generate data before and after the trigger has been pressed and the start trigger will generate data from the moment you have pressed the triggerbutton. You have to consider the timout if using a start trigger, how long the application will wait for someone to press the trigger button. This can be configured to a specific time.
Let me know if this is what you want to achieve
/Christine
AE
NI SWEDEN
03-29-2009 04:16 PM
The signal I am measuring is only one peek so I need to be able to trig when the signal pass a threshold value. When this happen I am interested in some data before the trig and of course also after the trig.
What I really want is for the application to know when there has been a trig. If I try to read data from the board and the trig has not appeared the application is crashing. I don't mind if I have to poll the instrument but it must not crash.
/Anders
04-02-2009 04:57 AM
Hi agian Anders,
Have you looked at the example in the Example Finder: Hardware Input and Output/DAQmx/Analog Measurment/Acq-IntClk-DigRef.prj
It's for a digital trigger but should work in your case as well.
You have to make sure you set your timeout value to -1, that is, it will wait forever for a trigger.
Also a minimum of 2 predirgger data values.
If this doesn't help you I need to know a little bit more about your signal.
Is it a analog trigger you want, in that case do your card support that. Is it the analog triggering signal you want to read?
Let me know how it works out for you?
Regards
Christine
01-14-2011 10:50 PM
It's easy to solute.
delay to read = 20 samples
samples you want = 1000 samples
samples per channel= delay to read + samples you want = 1020 samples
Delete from array(index=0, length=20)