Class
SerialDevice
Description
Used to access serial devices.
Properties
Name |
Type |
Read-Only |
Shared |
---|---|---|---|
✓ |
✓ |
||
✓ |
|||
✓ |
✓ |
||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
index As Integer |
SerialDevice |
✓ |
|
deviceName As String |
SerialDevice |
✓ |
Property descriptions
SerialDevice.Count
Count As Integer
Returns the number of serial devices available.
This property is read-only.
This property is shared.
The following displays the names of the serial devices on the computer:
For i As Integer = 0 To SerialDevice.LastIndex
MessageBox(SerialDevice.At(i).Name)
Next
SerialDevice.InputDriverName
InputDriverName As String
The name of the input driver.
This property is read-only.
This example gets the name of serial device 0.
TextField1.Text = SerialDevice.At(0).InputDriverName
SerialDevice.LastIndex
LastIndex As Integer
Returns the index of the last serial device.
This property is read-only.
This property is shared.
The following displays the names of the serial devices on the computer:
For i As Integer = 0 To SerialDevice.LastIndex
MessageBox(SerialDevice.At(i).Name)
Next
SerialDevice.MaximumSpeed
MaximumSpeed As Integer
The maximum speed (baud) at which you can communicate with the device.
This property is read-only.
This example reads the maximum speed of the serial device at index 0.
TextField1.Text = SerialDevice.At(0).MaximumSpeed.ToString
SerialDevice.Name
Name As String
The name of the serial device.
This property is read-only.
This example gets the name of serial device at index 0.
TextField1.Text = SerialDevice.At(0).Name
SerialDevice.OutputDriverName
OutputDriverName As String
The name of the output driver.
This property is read-only.
This example gets the name of the output drive for the serial device at index 0.
TextField1.Text = SerialDevice.At(0).OutputDriverName
SerialDevice.RatedSpeed
RatedSpeed As Integer
The rated speed (baud) at which you can communicate with the serial device.
This property is read-only.
This example reads the rated speed of the serial device at index 0.
TextField1.Text = SerialDevice.At(0).RatedSpeed.ToString
Method descriptions
SerialDevice.At
At(index As Integer) As SerialDevice
Gets the serial device by its index.
This method is shared.
TextField1.Text = SerialDevice.At(0).InputDriverName
The following displays the names of the serial devices on the computer:
For i As Integer = 0 To SerialDevice.LastIndex
MessageBox(SerialDevice.At(i).Name)
Next
SerialDevice.WithName
WithName(deviceName As String) As SerialDevice
Gets the serial device by its name.
This method is shared.
If you're unsure what the names of the various serial devices are, you can loop through them to get the names. See the example below.
The following displays the names of the serial devices on the computer:
For i As Integer = 0 To SerialDevice.LastIndex
MessageBox(SerialDevice.At(i).InputDriverName)
Next
Compatibility
All project types on all supported operating systems.
See also
Object parent class; SerialConnection class, Connecting To A Serial Device