Acquire Method

Reads data from the active data acquisition device.

Syntax

Variant = object.Acquire( )

The Acquire method syntax has these parts:

Part Description

object Required. A valid Mathcad Data Acquisition Control object.

Remarks

The Acquire method retrieves a reading, in volts, from every channel in the channel string. The data is stored in the Data member of the Channel object. The type of data returned depends on the IOType setting and is a scalar for single point operations and a vector for waveform operations.

The Acquire method returns 0 if successful or -1 if there was an error in at least one of the channels being acquired.

Example

Sub AcquireData()

  Dim McadDAQ As AnalogIO

  Dim vResult as Variant

  'the next statement assumes there is a Mathcad Data Acquisition control called

  ' AnalogIO1 on Form1 of a VisualBasic project

  Set McadDAQ = Form1.AnalogIO1

  'set the channel string

  McadDAQ.ChannelString = "0,1,3"

  'set the IOFunction and IOType to input a single point from every channel in the channel string

  McadDAQ.IOFunction = 0

  McadDAQ.IOType = 0

  'use the Acquire method to get the data

  vResult = McadDAQ.Acquire

End Sub