Session base level trigger of analog input NI USB daq.

I'd like to set up an analog input channel of an NI USB daq to level trigger with a session based approach. What is the session based equivalent of the following?
set(s1,'SamplesPerTrigger',500000)
set(s1,'TriggerChannel',chan4) %Trigger Channel
set(s1,'TriggerType','Software')%Immediate, Manual, or Software
set(s1,'TriggerCondition','Rising')%Rising, None
set(s1,'TriggerConditionValue',1.5)% Trigger level
set(s1,'TriggerRepeat',0)
set(s1,'TriggerDelay',-1.0)% pretrigger (seconds)
Thanks, Jon R2012a

Answers (1)

Hi,
As far as I know, triggering to a certain level is not possible with the session based approach.
In principle, the equivalent to the legacy approach starts like this: (assuming session is already created, 'CHANNEL' would be the trigger channel on your card)
trig = session.addTriggerConnection('External','CHANNEL','StartTrigger');
session.TriggersPerRun = 1;
trig.TriggerCondition = 'RisingEdge';
Now you would have to change
trig.TriggerType
to 'Analog' in order to be able to do leveled triggering, but as far as I know that is not yet possible.
Best, Tim

Categories

Asked:

Jon
on 9 May 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!