Component: COM Port (Runtime Tools): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (One intermediate revision by the same user not shown) | |||
| Line 37: | Line 37: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ClosePort''' | ||
|- | |- | ||
| colspan="2" | Closes the currently open COM port, ending communications and allowing it to be accessed via another application. | | colspan="2" | Closes the currently open COM port, ending communications and allowing it to be accessed via another application. | ||
| Line 51: | Line 51: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ConfigureConsole''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 70: | Line 70: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetConsoleHandle''' | ||
|- | |- | ||
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. | | colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. | ||
| Line 84: | Line 84: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetProp''' | ||
|- | |- | ||
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. | | colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. | ||
| Line 103: | Line 103: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''OpenPort''' | ||
|- | |- | ||
| colspan="2" | Opens the currently selected COM port, allowing data to be sent and received. | | colspan="2" | Opens the currently selected COM port, allowing data to be sent and received. | ||
| Line 117: | Line 117: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveBinary16Bit''' | ||
|- | |- | ||
| colspan="2" | Receives a binary 16-bit value split across two bytes. | | colspan="2" | Receives a binary 16-bit value split across two bytes. | ||
| Line 141: | Line 141: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveBinary32Bit''' | ||
|- | |- | ||
| colspan="2" | Receives a binary 32-bit value split across four bytes. | | colspan="2" | Receives a binary 32-bit value split across four bytes. | ||
| Line 165: | Line 165: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveBinaryFloat''' | ||
|- | |- | ||
| colspan="2" | Receives a binary 32-bit floating point value split across four bytes. | | colspan="2" | Receives a binary 32-bit floating point value split across four bytes. | ||
| Line 189: | Line 189: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveByte''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a byte using the COM port No valid return data is provided by the timeout value property. | | colspan="2" | Attempts to receive a byte using the COM port No valid return data is provided by the timeout value property. | ||
| Line 208: | Line 208: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveByteArray''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive an array of bytes using the COM port Returns the number of bytes received. | | colspan="2" | Attempts to receive an array of bytes using the COM port Returns the number of bytes received. | ||
| Line 237: | Line 237: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveFloat''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a floating point number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none numeric char is received, the none numeric char will be lost. | | colspan="2" | Attempts to receive a floating point number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none numeric char is received, the none numeric char will be lost. | ||
| Line 261: | Line 261: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveHexNumber''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a hex number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none hexadecimal char is received, the none numeric char will be lost. | | colspan="2" | Attempts to receive a hex number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none hexadecimal char is received, the none numeric char will be lost. | ||
| Line 290: | Line 290: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveINTArray''' | ||
|- | |- | ||
| colspan="2" | Receives an array of 16-bit INT/UINT values and returns the number of values received. | | colspan="2" | Receives an array of 16-bit INT/UINT values and returns the number of values received. | ||
| Line 324: | Line 324: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveNumber''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none numeric char is received, the none numeric char will be lost. | | colspan="2" | Attempts to receive a number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none numeric char is received, the none numeric char will be lost. | ||
| Line 348: | Line 348: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveString''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a string using the COM port. MaxLength sets the maximum number of bytes that can be received, Timeout is the max time between characters. | | colspan="2" | Attempts to receive a string using the COM port. MaxLength sets the maximum number of bytes that can be received, Timeout is the max time between characters. | ||
| Line 372: | Line 372: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveStringWithTermination''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive an string using the COM port. Will return if the selected termination characters are received. Returns the number of bytes received. | | colspan="2" | Attempts to receive an string using the COM port. Will return if the selected termination characters are received. Returns the number of bytes received. | ||
| Line 406: | Line 406: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ScanForDeviceID''' | ||
|- | |- | ||
| colspan="2" | Checks to see if a device VID/PID string is present and returns the COM port number. Returns 0 if device not found. | | colspan="2" | Checks to see if a device VID/PID string is present and returns the COM port number. Returns 0 if device not found. | ||
| Line 425: | Line 425: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ScanForDeviceIDEx''' | ||
|- | |- | ||
| colspan="2" | Checks to see if a device VID/PID string is present and returns the COM port number, allows multiple devices with the same details to be detected. Returns 0 if device not found. | | colspan="2" | Checks to see if a device VID/PID string is present and returns the COM port number, allows multiple devices with the same details to be detected. Returns 0 if device not found. | ||
| Line 454: | Line 454: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendBinary16Bit''' | ||
|- | |- | ||
| colspan="2" | Sends out a 16-bit binary value split across two bytes. | | colspan="2" | Sends out a 16-bit binary value split across two bytes. | ||
| Line 478: | Line 478: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendBinary32Bit''' | ||
|- | |- | ||
| colspan="2" | Sends out a 32-bit binary value split across four bytes. | | colspan="2" | Sends out a 32-bit binary value split across four bytes. | ||
| Line 502: | Line 502: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendBinaryFloat''' | ||
|- | |- | ||
| colspan="2" | Sends out a 32-bit binary floating point value split across four bytes. | | colspan="2" | Sends out a 32-bit binary floating point value split across four bytes. | ||
| Line 526: | Line 526: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendByte''' | ||
|- | |- | ||
| colspan="2" | Sends a single byte to be sent out via the COM port. | | colspan="2" | Sends a single byte to be sent out via the COM port. | ||
| Line 545: | Line 545: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendByteArray''' | ||
|- | |- | ||
| colspan="2" | Sends an array of bytes to the COM port. | | colspan="2" | Sends an array of bytes to the COM port. | ||
| Line 569: | Line 569: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendFloat''' | ||
|- | |- | ||
| colspan="2" | Sends out a floating point number as an ASCII String from the UART interface. | | colspan="2" | Sends out a floating point number as an ASCII String from the UART interface. | ||
| Line 588: | Line 588: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendHexNumber''' | ||
|- | |- | ||
| colspan="2" | Sends out a number as an ASCII hexadecimal String from the UART interface. | | colspan="2" | Sends out a number as an ASCII hexadecimal String from the UART interface. | ||
| Line 617: | Line 617: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendINTArray''' | ||
|- | |- | ||
| colspan="2" | Transmits an array of 16-bit INT/UINT values via the UART peripheral | | colspan="2" | Transmits an array of 16-bit INT/UINT values via the UART peripheral | ||
| Line 646: | Line 646: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendNumber''' | ||
|- | |- | ||
| colspan="2" | Sends out a number as an ASCII String from the UART interface. | | colspan="2" | Sends out a number as an ASCII String from the UART interface. | ||
| Line 665: | Line 665: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendString''' | ||
|- | |- | ||
| colspan="2" | Sends an string of characters to the COM port. | | colspan="2" | Sends an string of characters to the COM port. | ||
| Line 684: | Line 684: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetDTRState''' | ||
|- | |- | ||
| colspan="2" | Allows the DTR signal to be enabled or disabled. | | colspan="2" | Allows the DTR signal to be enabled or disabled. | ||
| Line 703: | Line 703: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetFlowControl''' | ||
|- | |- | ||
| colspan="2" | Allows the Flowcontrol signals to be enabled or disabled. | | colspan="2" | Allows the Flowcontrol signals to be enabled or disabled. | ||
| Line 722: | Line 722: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetProp''' | ||
|- | |- | ||
| colspan="2" | Allows the COM port property to be set from a parent component. | | colspan="2" | Allows the COM port property to be set from a parent component. | ||
| Line 746: | Line 746: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:23, 13 July 2026
| Author | Matrix Ltd |
| Version | 103.11 |
| Category | Runtime Tools |
COM Port component
Serial based simulation component for use with systems such as RS232, Bluetooth and USB Serial.
Version information
Library Version, Component Version, Date, Author, Info 10, 103.10, 07-04-25, MW, Modified ReceiveArray NumValues from Byte to UInt 11, 103.11, 01-05-25, BR, Changed SendString macro to make it more efficient
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
ClosePort
| ClosePort | |
| Closes the currently open COM port, ending communications and allowing it to be accessed via another application. | |
| Return | |
ConfigureConsole
| ConfigureConsole | |
| Status | |
| Return | |
GetConsoleHandle
| GetConsoleHandle | |
| Gets the handle to the console allowing data displaying on the panel etc. | |
| Return | |
GetProp
| GetProp | |
| Allows the property filter for the COM port list to be copied to a parent component. | |
| PropName | |
| Return | |
OpenPort
| OpenPort | |
| Opens the currently selected COM port, allowing data to be sent and received. | |
| Return | |
ReceiveBinary16Bit
ReceiveBinary32Bit
ReceiveBinaryFloat
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 | |
ReceiveByteArray
ReceiveFloat
ReceiveHexNumber
ReceiveINTArray
ReceiveNumber
ReceiveString
ReceiveStringWithTermination
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 | |
ScanForDeviceIDEx
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 | |
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 | |
SendByte
| SendByte | |
| Sends a single byte to be sent out via the COM port. | |
| Data | |
| 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 | |
SendFloat
| SendFloat | |
| Sends out a floating point number as an ASCII String from the UART interface. | |
| Number | |
| Return | |
SendHexNumber
SendINTArray
SendNumber
| SendNumber | |
| Sends out a number as an ASCII String from the UART interface. | |
| Number | |
| Return | |
SendString
| SendString | |
| Sends an string of characters to the COM port. | |
| Data | |
| Data byte array to send | |
| 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 | |
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 | |
SetProp
| SetProp | |
| Allows the COM port property to be set from a parent component. | |
| PropName | |
| PropVal | |
| Return | |
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_COM_Port_1.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_COM_Port_1.fcfx