Channels Collection |
Returns a collection containing MDAQChannel members.
Syntax
Channel = object.Channels(index)
The Channels collection syntax has these parts:
object Required. A valid Mathcad Data Acquisition Control object.
index Required. A string or integer value representing the channel object to return. Specifying a string for index returns information for the channel having the same name. Specifying an integer for index returns that item of the collection.
Channel Required. MDAQChannel. A variable used to store the collection member.
Remarks
The Channels collection is composed of MDAQChannel class objects. The collection is accessed to set or retrieve data for the particular operation. If a non-existent channel index is specified a VB run time error occurs.
Example
Sub GetChannelObject()
Dim McadDAQ As AnalogIO
Dim MyChannel as MDAQChannel
'the next statement assumes there is a Mathcad Data Acquisition control called
' AnalogIO1 on Form1 of a VisualBasic project
Set McadDAQ = Form1.AnalogIO1
'get the information for channel 0
Set MyChannel = McadDAQ.Channels("0")
If IsArray(MyChannel.Data) Then
MsgBox "Channel 0 contains array data"
Else
MsgBox "Channel 0 contains scalar data"
End If
End Sub