|
14 | 14 | % vidrio.AO.hardwareContinuousVoltage |
15 | 15 | % |
16 | 16 | % 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: |
19 | 19 | % vidrio.mixed.AOandAI_OO_sharedClock |
20 | 20 | % |
21 | 21 | % |
| 22 | + % Wiring instructions: |
| 23 | + % connect AI0 to AO0 on the DAQ device you are working on. |
| 24 | + % |
| 25 | + % |
22 | 26 | % Demonstrated steps: |
23 | 27 | % 1. Create the AI and AO tasks and waveform to play. |
24 | 28 | % 2. Create an analog input and an analog output voltage channel. |
|
47 | 51 | % Basic AO digital triggering: vidrio.AO.hardwareContinuousVoltageNoRegen_DigTrig |
48 | 52 | % AO and AI with a class rather than a functio: vidrio.mixed.AOandAI_OO |
49 | 53 |
|
50 | | - AIDevice = 'Dev1'; |
| 54 | + DAQdevice = 'Dev1'; |
| 55 | + |
51 | 56 | AIChans = 0; |
52 | 57 | 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'; |
54 | 58 | AOChan = 0; |
55 | 59 |
|
56 | 60 | minVoltage = -10; |
|
83 | 87 | % More details at: "help dabs.ni.daqmx.Task.createAOVoltageChan" and "help dabs.ni.daqmx.Task.createAIVoltageChan" |
84 | 88 | % C equivalent - DAQmxCreateAOVoltageChan |
85 | 89 | % 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); |
88 | 92 |
|
89 | 93 |
|
90 | 94 | %-------------------------------------------------------------------------------- |
|
130 | 134 | % More details at: "help dabs.ni.daqmx.Task.cfgDigEdgeStartTrig" |
131 | 135 | % DAQmxCfgDigEdgeStartTrig |
132 | 136 | % 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') |
134 | 138 |
|
135 | 139 | hAOTask.start(); |
136 | 140 | hAITask.start(); |
|
0 commit comments