Skip to content

Commit 4a28f81

Browse files
committed
Minor doc changes. Use one DAQ device ID.
1 parent 5b0d884 commit 4a28f81

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

code/+vidrio/+mixed/AOandAI.m

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
% vidrio.AO.hardwareContinuousVoltage
1515
%
1616
% Note that in this example the AI and AO do not share a clock. They are set to run at
17-
% at the same rate, but they won't be running on the same clock. This can create jitter
18-
% and, for some desired sample rates, continuously variable phase delays. See:
17+
% at the same sample rate, but they won't be running on the same clock. This can create
18+
% jitter and, for some desired sample rates, continuously variable phase delays. See:
1919
% vidrio.mixed.AOandAI_OO_sharedClock
2020
%
2121
%
22+
% Wiring instructions:
23+
% connect AI0 to AO0 on the DAQ device you are working on.
24+
%
25+
%
2226
% Demonstrated steps:
2327
% 1. Create the AI and AO tasks and waveform to play.
2428
% 2. Create an analog input and an analog output voltage channel.
@@ -47,10 +51,10 @@
4751
% Basic AO digital triggering: vidrio.AO.hardwareContinuousVoltageNoRegen_DigTrig
4852
% AO and AI with a class rather than a functio: vidrio.mixed.AOandAI_OO
4953

50-
AIDevice = 'Dev1';
54+
DAQdevice = 'Dev1';
55+
5156
AIChans = 0;
5257
AIterminalConfig = 'DAQmx_Val_Cfg_Default'; %Valid values: 'DAQmx_Val_Cfg_Default', 'DAQmx_Val_RSE', 'DAQmx_Val_NRSE', 'DAQmx_Val_Diff', 'DAQmx_Val_PseudoDiff'
53-
AODevice = 'Dev1';
5458
AOChan = 0;
5559

5660
minVoltage = -10;
@@ -83,8 +87,8 @@
8387
% More details at: "help dabs.ni.daqmx.Task.createAOVoltageChan" and "help dabs.ni.daqmx.Task.createAIVoltageChan"
8488
% C equivalent - DAQmxCreateAOVoltageChan
8589
% http://zone.ni.com/reference/en-XX/help/370471AE-01/daqmxcfunc/daqmxcreateaovoltagechan/
86-
hAITask.createAIVoltageChan(AIDevice, AIChans, [], minVoltage, maxVoltage, [], [], AIterminalConfig);
87-
hAOTask.createAOVoltageChan(AODevice, AOChan);
90+
hAITask.createAIVoltageChan(DAQdevice, AIChans, [], minVoltage, maxVoltage, [], [], AIterminalConfig);
91+
hAOTask.createAOVoltageChan(DAQdevice, AOChan);
8892

8993

9094
%--------------------------------------------------------------------------------
@@ -130,7 +134,7 @@
130134
% More details at: "help dabs.ni.daqmx.Task.cfgDigEdgeStartTrig"
131135
% DAQmxCfgDigEdgeStartTrig
132136
% http://zone.ni.com/reference/en-XX/help/370471AE-01/daqmxcfunc/daqmxcfgdigedgestarttrig/
133-
hAOTask.cfgDigEdgeStartTrig(['/',AIDevice,'/ai/StartTrigger'], 'DAQmx_Val_Rising')
137+
hAOTask.cfgDigEdgeStartTrig(['/',DAQdevice,'/ai/StartTrigger'], 'DAQmx_Val_Rising')
134138

135139
hAOTask.start();
136140
hAITask.start();

0 commit comments

Comments
 (0)