Writes analog outputs
mdaqAOWrite(channels, range, data) mdaqAOWrite(linkID, channels, range, data)
This function writes MicroDAQ analog outputs. The channels argument can be a scalar or vector and it should contain channels numbers according to MicroDAQ hardware configuration. The range argument specifies channel output range. Matrix n-by-2 where n is number of used channels shall be provided. If 1x2 matrix is provided, the range setting will be used for all channels. In order to obtain supported ranges use mdaqHWInfo().
linkID: Valid connection link ID
channels: Single channel or array of channels numbers to read
range: Range matrix - single row matrix e.g. [-10,10] sets -10 to 10V output range which will be used for all channels. If multi-range used, row number must match selected channels e.g. range matrix for 3 channels [-10,10; -5,5; -2,2]
data : Output data values
Calling function without linkID
// set 1, 2, 3, 4V on 1, 2, 3, 4 channel with range 0 to 5V mdaqAOWrite([1, 2, 3, 4], [0,5], [1, 2, 3, 4]); |
Calling function with linkID for shorter access time