From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering Using Analog Input and Outputting Signal Using NI DAQ USB-6210

I am using a NI USB-6210 and I code it in C++. I have another circuit that is connected to my analog input. I would like to generate a 500ms signal on analog output as soon as I see a falling edge (trigger) on analog input. And then wait for as long as needed. Then as soon as seeing the signal on analog input, generate the same 500ms signal on output.

 

I have some problem with state programming of NI DAQ. Do I have to create a state, read the input buffer, and when I see the trigger, clear and stop the old state and start a new signal generation state (finite)? Or is there a direct way to do triggering?

 

Thanks.

Farbod

0 Kudos
Message 1 of 6
(8,121 Views)

Any thought on this? Have I posted in the wrong forum?

0 Kudos
Message 2 of 6
(8,105 Views)

Hi Farbd

 

You could use the function DAQmxCfgAnlgEdgeStartTrig but in order to use it your card should be compatible or support this function and from the manual it seems that it does not supported that will mean that you will have to programmatically do the triggering

 

Regards 

Esteban R.

Message 3 of 6
(8,098 Views)

Thanks a lot for this. How do you check that in the manual that it does not support triggering? I searched the command and it wasnt there.

Actually I had tested that command, and hadn't seen any function from it. I assumed I didnt know how to use it.

 

Suppose that I have a card that supports the command. How can I use it? What does NI Card do when it sees the trigger? Starts the state task?

 

Should I set the Analog Output for write like this?

 

    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,"Dev1/ao0,Dev1/ao1","",-10.0,10.0,DAQmx_Val_Volts,NULL));    

  

    DAQmxCfgAnlgEdgeStartTrig (taskHandle, "Dev1/ai1", DAQmx_Val_RisingSlope , triggerLevel);

   // SHOULD I USE FINITIE SAMPLES? I NEED TO OUTPUT 500ms Data and then wait again to see the trigger
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,TRSAMP));
    DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));
    DAQmxErrChk (DAQmxWriteAnalogF64(taskHandle,TRSAMP,0,10.0,DAQmx_Val_GroupByChannel,outputArray,NULL,NULL));
    DAQmxErrChk (DAQmxStartTask(taskHandle));

....   
    DAQmxClearTask(taskHandle);

    DAQmxStopTask(taskHandle);

 

 

  Could you describe the logic.

 

 Thanks for the documents by the way. Very helpful.

 

Regards

Farbod

0 Kudos
Message 4 of 6
(8,072 Views)

Hi Farbd,

 

Please check to this link. This link is very helpful since it shows you the supported properties by device. 

 

Here is the supported properties of your USB-6210.

 

Best,

 

Carmen C.

Message 5 of 6
(8,062 Views)

Wondering if you have figured out a way to trigger on analog input on this usb6210, could you share? Thanks.

0 Kudos
Message 6 of 6
(6,983 Views)