Starts analog input data acquisition
mdaqAIScanStart() mdaqAIScanStart(linkID) mdaqAIScanStart(sync) mdaqAIScanStart(linkID, sync)
This function is part of analog scan functionality and has to be called in the following sequence:
Initialize scanning session - mdaqAIScanInit()
Start scanning session - mdaqAIScanStart()
Read data - mdaqAIScanRead()
Stop scanning session - mdaqAIScanStop()
This function starts analog input scanning. A function call has to be preceded with mdaqAIScanInit() which initiates analog input scanning session parameters. Function starts data acquisistion on channels configured with initialization fucntion. In order to stop scanning, function mdaqAIScanStop() has to be called.
Limitation: ADC1-DAC01 MicroDAQ configuration doesn't support running simultaneously AI and AO scanning sessions.
linkID: Valid connection link ID (optional)
sync: Synchronize data acquisition start with AO or DSP start ("ai" | "dsp")
Perform blocking data acquisition from 8 single-ended analog input channels, one analog input range, scan frequency of 10kHz and 1 second duration.
mdaqAIScanInit(1:8, [-10,10], %F, 10000, 1) plot(mdaqAIScanRead(10000, 2)); | ![]() | ![]() |
Data acquisition from 8 single-ended analog input channels, one analog input range, scan frequency of 10kHz and 1 second duration.
aiData = []; dataCount = 0; mdaqAIScanInit(1:8, [-10,10], %F, 10000, 1) for i=1:10 [data result] = mdaqAIScanRead(1000, 1); aiData = [aiData; data]; dataCount = dataCount + result; mprintf('Acquired %d scans (total: %d scans)\n', result, dataCount); end mdaqAIScanStop(); plot(aiData); | ![]() | ![]() |
Data acquisition from 2 single-ended and 1 differential analog input channels, different input ranges, scan frequency of 10kHz and 1 second duration.
NOTE: Example will work if applicable for MicroDAQ analog input configuration
aiData = []; dataCount = 0; mdaqAIScanInit([1 3 4], [-10,10; -5,5; -5,5], [%T %F %F], 10000, 1) for i=1:10 [data result] = mdaqAIScanRead(1000, 1); aiData = [aiData; data]; dataCount = dataCount + result; mprintf('Acquired %d scans (total: %d scans)\n', result, dataCount); end mdaqAIScanStop(); plot(aiData); | ![]() | ![]() |
Continuous data acquisition from 8 single-ended analog input channels, one analog input range, scan frequency of 1kHz. Stop when MicroDAQ F1 button pressed.
NOTE: For long acquisition Scilab stack can be exceeded!
aiData = []; dataCount = 0; mdaqAIScanInit(1:8, [-10,10], %F, 1000, -1) while(mdaqKeyRead(1) == %F) [data result] = mdaqAIScanRead(100, 1); aiData = [aiData; data]; dataCount = dataCount + result; mprintf('Acquired %d scans (total: %d scans)\n', result, dataCount); end mdaqAIScanStop(); plot(aiData); | ![]() | ![]() |