3636
3737 % Define properties that we will use for the acquisition
3838 properties
39+ DAQdevice = ' Dev1'
40+
3941 % Properties for the analog input end of things
4042 hAITask % The AI task will be kept here
41- AIDevice = ' Dev1'
4243 AIChans = 0 : 1
4344 AIterminalConfig = ' DAQmx_Val_RSE' % Valid values: 'DAQmx_Val_Cfg_Default', 'DAQmx_Val_RSE', 'DAQmx_Val_NRSE', 'DAQmx_Val_Diff', 'DAQmx_Val_PseudoDiff'
4445
4546 % Properties for the analog output end of things
4647 hAOTask % The AO task will be kept here
47- AODevice = ' Dev1'
4848 AOChans = 0 : 1
4949
5050 % Shared properties
@@ -141,16 +141,16 @@ function connectToDAQandSetUpChannels(obj)
141141 obj.hAOTask = dabs .ni .daqmx .Task(' mixedAO' );
142142
143143 % Set up analog input and output voltage channels
144- obj .hAITask .createAIVoltageChan(obj .AIDevice , obj .AIChans , [], obj .minVoltage , obj .maxVoltage , [], [], obj .AIterminalConfig );
145- obj .hAOTask .createAOVoltageChan(obj .AODevice , obj .AOChans );
144+ obj .hAITask .createAIVoltageChan(obj .DAQdevice , obj .AIChans , [], obj .minVoltage , obj .maxVoltage , [], [], obj .AIterminalConfig );
145+ obj .hAOTask .createAOVoltageChan(obj .DAQdevice , obj .AOChans );
146146
147147
148148 % * Set up the AI task
149149
150150 % Configure the sampling rate and the buffer size
151151 % ===> SET UP THE SHARED CLOCK: Use the AO sample clock for the AI task <===
152152 % The supplied sample rate for the AI task is a nominal value. It will in fact use the AO sample clock.
153- obj .hAITask .cfgSampClkTiming(obj .sampleRateAO , ' DAQmx_Val_ContSamps' , [], [' /' ,obj .AODevice ,' /ao/SampleClock' ]);
153+ obj .hAITask .cfgSampClkTiming(obj .sampleRateAO , ' DAQmx_Val_ContSamps' , [], [' /' ,obj .DAQdevice ,' /ao/SampleClock' ]);
154154
155155 % Read back the data with a callback function at an interval defined by updatePeriod
156156 % Also see: basicConcepts/anonymousFunctionExample.
@@ -169,7 +169,7 @@ function connectToDAQandSetUpChannels(obj)
169169 obj .hAOTask .writeAnalogData(obj .waveforms , 5 )
170170
171171 % Configure the AO task to start as soon as the AI task starts
172- obj .hAOTask .cfgDigEdgeStartTrig([' /' ,obj .AIDevice ,' /ai/StartTrigger' ], ' DAQmx_Val_Rising' );
172+ obj .hAOTask .cfgDigEdgeStartTrig([' /' ,obj .DAQdevice ,' /ai/StartTrigger' ], ' DAQmx_Val_Rising' );
173173 catch ME
174174 daqDemosHelpers .errorDisplay(ME )
175175 % Tidy up if we fail
0 commit comments