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.
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.
03-01-2013 08:19 PM
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
03-04-2013 12:24 PM
Any thought on this? Have I posted in the wrong forum?
03-04-2013 03:02 PM
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.
03-06-2013 02:29 PM
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
03-07-2013 11:33 AM
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.
06-06-2014 06:25 PM
Wondering if you have figured out a way to trigger on analog input on this usb6210, could you share? Thanks.