ActiveDevice Property

Returns or sets the active data acquisition device.

Syntax

Variant = object.ActiveDevice( )

object.ActiveDevice = vNewValue

The ActiveDevice property syntax has these parts:

Part Description

object Required. A valid Mathcad Data Acquisition Control object.

vNewValue Variant (Integer). The number of the device to make the active device.

Remarks

The ActiveDevice property is used to determine or specify the device that will be used for all subsequent operations. The numbers for devices installed on your computer are assigned using the National Instruments Measurement & Automation Explorer. Valid ranges are from 1 to 16 inclusive.

If an invalid number is specified, such as a non-existent device or a non-numeric value, the value reverts to a known good value.

Example

Sub SetGetActiveDevice()

  Dim McadDAQ As AnalogIO

  Dim vResult as Variant

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

  ' AnalogIO1 on Form1 of a VisualBasic project

  Set McadDAQ = Form1.AnalogIO1

  'set the new active device

  McadDAQ.ActiveDevice = 2%

  vResult = McadDAQ.ActiveDevice

  MsgBox "The ActiveDevice is now: " & CStr(vResult)

End Sub