How do I set an analog trigger on NI USB-6251 with session-based approach?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Vignesh Rangaishenvi
el 20 de Jun. de 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 comentarios
Giandomenico
el 3 de Nov. de 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 comentarios
Ver también
Categorías
Más información sobre Data Acquisition Toolbox Supported Hardware en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!