Component: COM Port (Runtime Tools)
From Flowcode Help
Jump to navigationJump to searchAuthor | Matrix Ltd |
Version | 3.0 |
Category | Runtime Tools |
Contents
- 1 COM Port component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 ReceiveByte
- 5.2 ConfigureConsole
- 5.3 SendString
- 5.4 ReceiveINTArray
- 5.5 ReceiveNumber
- 5.6 SendBinary16Bit
- 5.7 SendINTArray
- 5.8 SendNumber
- 5.9 ReceiveBinary32Bit
- 5.10 ClosePort
- 5.11 ReceiveBinaryFloat
- 5.12 SendByte
- 5.13 SetDTRState
- 5.14 ScanForDeviceID
- 5.15 GetConsoleHandle
- 5.16 SendByteArray
- 5.17 ReceiveBinary16Bit
- 5.18 ReceiveFloat
- 5.19 SendFloat
- 5.20 SendHexNumber
- 5.21 SetFlowControl
- 5.22 OpenPort
- 5.23 ReceiveHexNumber
- 5.24 SetProp
- 5.25 SendBinary32Bit
- 5.26 SendBinaryFloat
- 5.27 GetProp
- 5.28 ReceiveByteArray
- 5.29 ReceiveString
- 6 Property reference
COM Port component
Serial based simulation component for use with systems such as RS232, Bluetooth and USB Serial.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_COM_Port.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_COM_Port.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Auto Detect Port Number
This example auto detects and opens a COM Port based on preassigned USB Identifiers VID/PID.
For a known device the VID and PID can be found via Windows device manager.
Macro reference
ReceiveByte
![]() |
ReceiveByte |
Attempts to receive a byte using the COM port No valid return data is provided by the timeout value property. | |
![]() |
Timeout |
Time to wait for incoming data in milliseconds | |
![]() |
Return |
ConfigureConsole
![]() |
ConfigureConsole |
![]() |
Status |
![]() |
Return |
SendString
![]() |
SendString |
Sends an string of characters to the COM port. | |
![]() |
Data |
Data byte array to send | |
![]() |
Return |
ReceiveINTArray
ReceiveNumber
SendBinary16Bit
![]() |
SendBinary16Bit |
Sends out a 16-bit binary value split across two bytes. | |
![]() |
Value |
![]() |
MSBfirst |
0=Least significant byte first, 1=Most significant byte first | |
![]() |
Return |
SendINTArray
SendNumber
![]() |
SendNumber |
Sends out a number as an ASCII String from the UART interface. | |
![]() |
Number |
![]() |
Return |
ReceiveBinary32Bit
ClosePort
![]() |
ClosePort |
Closes the currently open COM port, ending communications and allowing it to be accessed via another application. | |
![]() |
Return |
ReceiveBinaryFloat
SendByte
![]() |
SendByte |
Sends a single byte to be sent out via the COM port. | |
![]() |
Data |
![]() |
Return |
SetDTRState
![]() |
SetDTRState |
Allows the DTR signal to be enabled or disabled. | |
![]() |
State |
A value of 0 disables the DTR, 1 or above willl enable the DTR. | |
![]() |
Return |
ScanForDeviceID
![]() |
ScanForDeviceID |
Checks to see if a device VID/PID string is present and returns the COM port number. Returns 0 if device not found. | |
![]() |
HWID |
Example: "VID_12BF&PID_0101" | |
![]() |
Return |
GetConsoleHandle
![]() |
GetConsoleHandle |
Gets the handle to the console allowing data displaying on the panel etc. | |
![]() |
Return |
SendByteArray
![]() |
SendByteArray |
Sends an array of bytes to the COM port. | |
![]() |
Data |
Data byte array to send | |
![]() |
Length |
Number of bytes to send | |
![]() |
Return |
ReceiveBinary16Bit
ReceiveFloat
SendFloat
![]() |
SendFloat |
Sends out a floating point number as an ASCII String from the UART interface. | |
![]() |
Number |
![]() |
Return |
SendHexNumber
SetFlowControl
![]() |
SetFlowControl |
Allows the Flowcontrol signals to be enabled or disabled. | |
![]() |
State |
A value of 0 disables flow control, 1 or above willl enable flow control. | |
![]() |
Return |
OpenPort
![]() |
OpenPort |
Opens the currently selected COM port, allowing data to be sent and received. | |
![]() |
Return |
ReceiveHexNumber
SetProp
![]() |
SetProp |
Allows the COM port property to be set from a parent component. | |
![]() |
PropName |
![]() |
PropVal |
![]() |
Return |
SendBinary32Bit
![]() |
SendBinary32Bit |
Sends out a 32-bit binary value split across four bytes. | |
![]() |
Value |
![]() |
MSBfirst |
0=Least significant byte first, 1=Most significant byte first | |
![]() |
Return |
SendBinaryFloat
![]() |
SendBinaryFloat |
Sends out a 32-bit binary floating point value split across four bytes. | |
![]() |
Value |
![]() |
MSBfirst |
0=Least significant byte first, 1=Most significant byte first | |
![]() |
Return |
GetProp
![]() |
GetProp |
Allows the property filter for the COM port list to be copied to a parent component. | |
![]() |
PropName |
![]() |
Return |
ReceiveByteArray
ReceiveString