Daqdevice.writescandata(), Daqdevice.enablecallback(), Writescandata() – Measurement Computing DAQFlex User Guide User Manual
Page 28: Enablecallback()

DAQFlex Software User's Guide
DAQFlex Software Reference
28
DaqDevice.WriteScanData()
Outputs scan data.
C#:
void WriteScanData(double[,] scanData, int numberOfSamplesPerChannel,
int timeOut);
VB:
Sub WriteScanData(ByVal ScanData(,) As Double, ByVal
NumberOfSamplesPerChannel As Integer, ByVal TimeOut As Integer)
Parameter
scanData
Array of data samples to output.
numberOfSamplesPerChannel
The number of data samples per channel to transfer from the scanData array to the device's output
buffer.
timeOut
The number of milliseconds to wait for available space in the buffer to write to. This only takes
effect when an output scan is running.
Remarks
WriteScanData may be called while a scan is running. However, the maximum number of total
samples must be less than or equal to half the number of samples for which the buffer is allocated.
Set the buffer size with the "AOSCAN:BUFSIZE" message.
DaqDevice.EnableCallback()
Enables a user-defined callback method to be invoked when a certain condition is met.
C#:
void EnableCallback(ErrorCodes errorCode, InputScanCallbackDelegate
callback, CallbackType callbackType, Object callbackData
VB:
Sub EnableCallback(ByVal errorCode as ErrorCodes, ByVal callback as
InputScanCallbackDelegate, ByVal callbackType As CallbackType, ByVal
callbackData As Object)
Parameter
callback
The method to be invoked when the condition specified by callbackType is met. Refer to
on page 29 for the format of the method.
callbackType
The condition that invokes the callback method. Callback types are defined by the CallbackType
enumeration. The supported types are:
o CallbackType.OnDataAvailable – Invokes the callback method when the number of samples
available for reading data is ≥ the number of samples specified by the callbackData parameter.
o CallbackType.OnInputScanComplete – Invokes the callback method when an input scan
completes or is stopped.
o CallbackType.OnInputScanError – Invokes the callback method when an input scan error
occurs.
callbackData
When callbackType is set to OnDataAvailable, set callbackData to the number of samples per
channel to acquire before invoking the user-defined callback method. When callbackType is set to
OnInputScanComplete or OnInputScanError, set callbackData to null or Nothing.