Send Method

Sends data to the active data acquisition device.

Syntax

Variant = object.Send( )

The Send method syntax has these parts:

Part Description

object Required. A valid Mathcad Data Acquisition Control object.

Remarks

The Send method sends the voltage value associated with a channel to all channels in the channel string. Each channel can have its own voltage value independent of the others. If the IOFunction property is set to send, the voltage values are remembered after the document containing the control is closed.

 The data to be sent is stored in the Data member of the Channel object. The type of data sent depends on the IOType setting and is a scalar for single point operations and a vector for waveform operations.

The Send method returns 0 if successful or -1 if there was an error in at least one of the channels having data sent to it.

Example

Sub SendData()

  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"

  'set the IOFunction and IOType to output a single point from every channel

  ' in the channel string

  McadDAQ.IOFunction = 1

  McadDAQ.IOType = 0

  'set the channel data to send

  McadDAQ.Channels("0").Data = 1.5#

  McadDAQ.Channels("1").Data = 4.25#

  'use the Send method to send the data to the output channels

  vResult = McadDAQ.Send

End Sub