Component: COM Port (Misc)
Author | Matrix Ltd |
Version | 1.5 (Release) |
Category | Misc |
Contents
COM Port component
Serial based simulation component for use with systems such as RS232, Bluetooth and USB Serial.
Examples
No additional examples
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
ReceiveByte
Attempts to receive a byte using the COM port
No valid return data is provided by the return value 256.
0 - 255 indicates valid data.
Parameters
- BYTE Timeout
Return value
ClosePort
Closes the currently open COM port, ending communications and allowing it to be accessed via another application.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
SendByte
Sends a single byte to be sent out via the COM port.
Parameters
- BYTE Data
Return value
- This call does not return a value
SetDTRState
Allows the DTR signal to be enabled or disabled.
Parameters
- BYTE State
- A value of 0 disables the DTR, 1 or above willl enable the DTR.
Return value
- This call does not return a value
GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc.
Parameters
- This macro has no parameters
Return value
SetFlowControl
Allows the Flowcontrol signals to be enabled or disabled.
Parameters
- BYTE State
- A value of 0 disables flow control, 1 or above willl enable flow control.
Return value
- This call does not return a value
OpenPort
Opens the currently selected COM port, allowing data to be sent and received.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
SetProp
Allows the COM port property to be set from a parent component.
Parameters
- <- STRING PropName
- This parameter may be returned back to the caller
- ULONG PropVal
Return value
- This call does not return a value
GetProp
Allows the property filter for the COM port list to be copied to a parent component.
Parameters
- <- STRING PropName
- This parameter may be returned back to the caller
Return value
Property reference
COM Port
This property is of type Fixed list of ints and can be referenced with the variable name COM_port.
Selects which port to communicate with, only lists ports which are currently available.
Refresh COM Ports
This property is of type True or false and can be referenced with the variable name Refresh.
When set to yes the COM port list is rescanned for newly connected or available ports.
Note that refreshing the ports list may take a few seconds depending on the number of connected ports.
Baud
This property is of type Signed integer and can be referenced with the variable name baud_rate.
Baud rate passed to the COM port to control the rate of data.
Timeout Value
This property is of type Signed integer and can be referenced with the variable name Tout_Val.
Value to specify what is returned when no incoming receive data is present.