Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

How to delay reading

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

 

 

0 Kudos
Message 1 of 9
(7,970 Views)

Hi, Have you solve the problem or do you still have the problem?

 

/Christine

0 Kudos
Message 2 of 9
(7,901 Views)

I still have the same problem. Any idea what to do?

 

Best regards

Anders

 

0 Kudos
Message 3 of 9
(7,883 Views)

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

0 Kudos
Message 4 of 9
(7,860 Views)

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

 

0 Kudos
Message 5 of 9
(7,849 Views)

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

0 Kudos
Message 6 of 9
(7,845 Views)

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

 

0 Kudos
Message 7 of 9
(7,803 Views)

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

0 Kudos
Message 8 of 9
(7,775 Views)

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)

0 Kudos
Message 9 of 9
(6,336 Views)