How do I set an analog trigger on NI USB-6251 with session-based approach?
4 views (last 30 days)
Show older comments
Hello, I am trying to alter my MatLab code to use the new 64-bit R2013 session-based approach. I'm unable to set up an analog trigger through the ai0 connection on my NI USB-6251 DAQ board. Here is a bit of the code and error I receive:
PAG_autorec3_64bit(0.1,0.1,10)
Error using PAG_autorec3_64bit (line 67)
Terminal 'ai0' is not known on 'Dev1'
Ultimately, my bigger question is how to re-create the code below in the session-based approach:
set(AI, 'TriggerType', 'Software');
set(AI, 'TriggerCondition', 'Rising');
set(AI, 'SamplesPerTrigger', samplenum);
set(AI, 'TriggerChannel', chand);;
set(AI, 'TriggerConditionValue', strikeThreshold)
set(AI, 'TriggerDelay', ratioForTriggerDelay * duration);
set(AI, 'Timeout', nidaqtimeout)
Thanks in advance for the help!
Patrick Green
0 Comments
Answers (2)
Vignesh Rangaishenvi
on 20 Jun 2014
Use the MATLAB function addTriggerConnection to add a trigger connection. For example, the following MATLAB command would add a trigger connection from an external device to terminal PFI1 on Dev1 :
addTriggerConnection(s,'external','Dev1/PFI1','StartTrigger')
From the error snippet you specified above, I believe the ai0 input channel is not added from Dev1 to the session. To add the analog input channel from Dev1 , use the following MATLAB command:
addAnalogInputChannel(s,'Dev1','ai0', 'Voltage');
You can re-create the code you specified above on MATLAB. For instance, you can set TriggerCondition to 'Rising' using the following MATLAB command:
s.Connections(1).TriggerCondition = 'Rising';
where 's' is the session object. For more information on setting up trigger connections, refer to trigger connections.
0 Comments
Giandomenico
on 3 Nov 2014
I have the same problem, I want set up an analog trigger through the ai0 connection on my NI PCI 6070E board with the session-based approach, enabling the trigger when ai0 rises a "value". But I don't find how to do that...
0 Comments
See Also
Categories
Find more on Data Acquisition Toolbox Supported Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!