LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Value as trigger??? USB 6221

Hi everybody,

 

I have a problem. I have 8 DO and 8 AI and I want to record my AI but I want to start recording at a specific point. For example of an rising edge of my signal which should at least reach 4 Volts. Is this possible and how to do it.

Another question is I want to know how long it is going to take my device to send out a signal and when I can receive it ( I connected DO with AI). Hoiw can I accomplish this test.

 

thanks for answering

0 Kudos
Message 1 of 6
(3,373 Views)

Hi,

 

1.Before you can set the trigger use for the channel settings

 

DAQmxErrChk (DAQmxCfgSampClkTiming(g_AItaskHandle,"",g_d_AIFreq,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,g_i_NumOfSampelsToRead)); 

 

2.This is for the trigger....

 

DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(g_AItaskHandle,g_c_triggerSource,g_i_triggerEdge));  

 

3.This function will give you retrigger option....by the g_c_triggerSource ( Digital Soruce )

 

DAQmxErrChk (DAQmxSetTrigAttribute(g_AItaskHandle,DAQmx_StartTrig_Retriggerable,1));  

 

Hope it helps...

 

  

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 2 of 6
(3,364 Views)

Hmm,

 

my Do and Ai are synced. They are using the same clock. So how do I tell my record that it should start recording when it sees a value over 4 volts.

0 Kudos
Message 3 of 6
(3,360 Views)

Hi Leee,

 

you only need to place the triggerfunction before the start function.

You can see it in several examples fron the LabVIEW-Examples library like the Acq&Graph Voltage-Int Clk-Retriggerable.vi.If you use an analog Edge, you can choose a channel and and a level for this function to start.

 

Regards,

 

Philipp

 

AE | NI Germany

0 Kudos
Message 4 of 6
(3,359 Views)

DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(g_AItaskHandle,g_c_triggerSource,g_i_triggerEdge));

 

youer DO needs to be read by onw of the DI in the decive then g_c_triggerSource is your DI and g_i_triggerEdge is falling or rising.

 

when youer seeting this function it's basiclly saing the device when you aquice and DI falling q rising start the g_AItaskHandle Task.

 

as Philipp said you can use alot of exmples from ni help center or the cvi examples and they will be very helpfull

 

 

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 5 of 6
(3,355 Views)

I'm sorry.

 

I haven't watch the toppic of this thread.

But there are almost the same functions in CVI like Kobi has mentioned.

 

Regards,

 

Philipp

 

 

 

 

0 Kudos
Message 6 of 6
(3,352 Views)