Help with addTriggerConnection error?

조회 수: 1 (최근 30일)
jon smith
jon smith 2012년 8월 31일
I have a NI usb daq
I want to plot data from channel 0 continuously, triggered my itself. when i try to use the trigger setup as described in many online documents i've found i get an error that that property does not exist
im using:
s=daq.createSession('ni')
s.addAnalogInputChannel('Dev1','ai0', 'Voltage');
s.addTriggerConnection('external','Dev1/PFI1','StartTrigger')
The last line does not work, and i dont quite understand how to set it up to do what i want.
I'm using R2011b and the error is: no appropriate method, property, or field addtriggerconection for class ni.daq.session.

채택된 답변

Manisha
Manisha 2012년 9월 5일
Hi Jon,
What version of MATLAB are you using? And what is the exact error that you get?
If you want to manually trigger your acquisition using a software command, you do not need to add a trigger connection. You can simply call
s.startForeground
to get your data. The command that you mentioned
s.addTriggerConnection('external','Dev1/PFI1','StartTrigger')
will add an start trigger with source as 'external' and destination as 'Dev1/PFI1'. Meaning that when you start your acquisition, the hardware will wait for a rising edge signal at PFI1 terminal on Dev1 before collecting any data.
Hope this helps,
Manisha
  댓글 수: 1
jon smith
jon smith 2012년 9월 6일
the error i get is: no appropriate method, property, or field addtriggerconection for class ni.daq.session.
what i want to do is trigger on a input to 1. sync display and 2. be able to compare two inputs eg. phase.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 9월 6일
addTriggerConnection is new in R2012a.
(You accidentally said you have R2001b, so we are not sure what you have, but if the "b" part is accurate then you must be before R2012a as R2012b is not quite released yet.)

카테고리

Help CenterFile Exchange에서 Simultaneous and Synchronized Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by