|
|
Line 16: |
Line 16: |
| | | |
| ==Detailed description== | | ==Detailed description== |
| + | |
| + | |
| | | |
| | | |
Line 22: |
Line 24: |
| | | |
| ==Examples== | | ==Examples== |
| + | |
| + | |
| | | |
| | | |
Line 649: |
Line 653: |
| |- | | |- |
| | colspan="2" | Max number of bytes to try and read | | | colspan="2" | Max number of bytes to try and read |
− | |-
| |
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− |
| |
− |
| |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
| |
− | |-
| |
− | | colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | EnableMask
| |
− | |-
| |
− | | colspan="2" | Range 0-63 or 0b00000 to 0b111111
| |
− | |-
| |
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− |
| |
− |
| |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| |
− | |-
| |
− | | colspan="2" |
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− |
| |
− |
| |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetProp'''
| |
− | |-
| |
− | | colspan="2" | Allows the property filter for the COM port list to be copied to a parent component.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| |
− | | width="90%" | PropName
| |
− | |-
| |
− | | colspan="2" |
| |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING |
Author
|
Matrix Ltd
|
Version
|
3.0
|
Category
|
Runtime Tools
|
COM Port component
Serial based simulation component for use with systems such as RS232, Bluetooth and USB Serial.
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.
Auto Detect Example
Downloadable macro reference
|
ReceiveByte
|
Attempts to receive a byte using the COM port No valid return data is provided by the timeout value property.
|
- UINT
|
Timeout
|
Time to wait for incoming data in milliseconds
|
- UINT
|
Return
|
|
ConfigureConsole
|
|
- BYTE
|
Status
|
|
- VOID
|
Return
|
|
SendString
|
Sends an string of characters to the COM port.
|
- STRING
|
Data
|
Data byte array to send
|
- VOID
|
Return
|
|
ReceiveINTArray
|
Receives an array of 16-bit INT/UINT values and returns the number of values received.
|
- UINT
|
Data
|
Array to store the incoming data
|
- BYTE
|
NumValues
|
Maximum number of values to try and receive
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- BYTE
|
Return
|
|
ReceiveNumber
|
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.
|
- BYTE
|
Timeout
|
Max time in ms to wait in between bytes
|
[[File:]] -
|
IgnoreData
|
0=Dont ignore any data, 1=Ignore any initial none numeric data
|
[[File:]] -
|
Return
|
|
SendBinary16Bit
|
Sends out a 16-bit binary value split across two bytes.
|
- UINT
|
Value
|
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
SendINTArray
|
Transmits an array of 16-bit INT/UINT values via the UART peripheral
|
- UINT
|
Data
|
Data to transmit
|
- BYTE
|
NumValues
|
Number of 16-bit values to send from the array
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
SendNumber
|
Sends out a number as an ASCII String from the UART interface.
|
[[File:]] -
|
Number
|
|
- VOID
|
Return
|
|
ReceiveBinary32Bit
|
Receives a binary 32-bit value split across four bytes.
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- ULONG
|
Return
|
|
ClosePort
|
Closes the currently open COM port, ending communications and allowing it to be accessed via another application.
|
- VOID
|
Return
|
|
ReceiveBinaryFloat
|
Receives a binary 32-bit floating point value split across four bytes.
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
[[File:]] -
|
Return
|
|
SendByte
|
Sends a single byte to be sent out via the COM port.
|
- BYTE
|
Data
|
|
- VOID
|
Return
|
|
SetDTRState
|
Allows the DTR signal to be enabled or disabled.
|
- BYTE
|
State
|
A value of 0 disables the DTR, 1 or above willl enable the DTR.
|
- VOID
|
Return
|
|
ScanForDeviceID
|
Checks to see if a device VID/PID string is present and returns the COM port number. Returns 0 if device not found.
|
- STRING
|
HWID
|
Example: "VID_12BF&PID_0101"
|
- BYTE
|
Return
|
|
GetConsoleHandle
|
Gets the handle to the console allowing data displaying on the panel etc.
|
[[File:]] -
|
Return
|
|
SendByteArray
|
Sends an array of bytes to the COM port.
|
- BYTE
|
Data
|
Data byte array to send
|
- UINT
|
Length
|
Number of bytes to send
|
- VOID
|
Return
|
|
ReceiveBinary16Bit
|
Receives a binary 16-bit value split across two bytes.
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- UINT
|
Return
|
|
ReceiveFloat
|
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.
|
- BYTE
|
Timeout
|
Max time in ms to wait in between bytes
|
[[File:]] -
|
IgnoreData
|
0=Dont ignore any data, 1=Ignore any initial none numeric data
|
[[File:]] -
|
Return
|
|
SendFloat
|
Sends out a floating point number as an ASCII String from the UART interface.
|
[[File:]] -
|
Number
|
|
- VOID
|
Return
|
|
SendHexNumber
|
Sends out a number as an ASCII hexadecimal String from the UART interface.
|
- ULONG
|
Number
|
|
- BYTE
|
NumChars
|
Number of characters in the string data, 0 for auto, 2 for 0x00, 4 for 0x0000
|
[[File:]] -
|
Prefix
|
Generate hexadecimal prefix 0x e.g. 1= 0xFF, 0= FF
|
- VOID
|
Return
|
|
SetFlowControl
|
Allows the Flowcontrol signals to be enabled or disabled.
|
- BYTE
|
State
|
A value of 0 disables flow control, 1 or above willl enable flow control.
|
- VOID
|
Return
|
|
OpenPort
|
Opens the currently selected COM port, allowing data to be sent and received.
|
- VOID
|
Return
|
|
ReceiveHexNumber
|
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.
|
- BYTE
|
Timeout
|
Max time in ms to wait in between bytes
|
[[File:]] -
|
IgnoreData
|
0=Dont ignore any data, 1=Ignore any initial none numeric data
|
[[File:]] -
|
Prefix
|
Look for prefix before receiving, 1=0xFF, 0=FF
|
- ULONG
|
Return
|
|
SetProp
|
Allows the COM port property to be set from a parent component.
|
- STRING
|
PropName
|
|
- ULONG
|
PropVal
|
|
- VOID
|
Return
|
|
SendBinary32Bit
|
Sends out a 32-bit binary value split across four bytes.
|
- ULONG
|
Value
|
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
SendBinaryFloat
|
Sends out a 32-bit binary floating point value split across four bytes.
|
[[File:]] -
|
Value
|
|
[[File:]] -
|
MSBfirst
|
0=Least significant byte first, 1=Most significant byte first
|
- VOID
|
Return
|
|
GetProp
|
Allows the property filter for the COM port list to be copied to a parent component.
|
- STRING
|
PropName
|
|
- STRING
|
Return
|
|
ReceiveByteArray
|
Attempts to receive an array of bytes using the COM port Returns the number of bytes received.
|
- BYTE
|
Data
|
|
- UINT
|
MaxLength
|
Max number of bytes to try and read
|
- UINT
|
Timeout
|
Time to wait for incoming data in milliseconds
|
- UINT
|
Return
|
|
ReceiveString
|
Attempts to receive an string using the COM port Returns the number of bytes received.
|
- UINT
|
Timeout
|
Time to wait for incoming data in milliseconds
|
- UINT
|
MaxLength
|
Max number of bytes to try and read
|
- STRING
|
Return
|
Property reference
|
Properties
|
|
COM Port
|
Selects which port to communicate with, only lists ports which are currently available.
|
|
Refresh COM Ports
|
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
|
Baud rate passed to the COM port to control the rate of data.
|
|
Timeout Value
|
Value to specify what is returned when no incoming receive data is present.
|
|
Console Data
|
|
|
Auto Close
|
Auto close the port on Sim stop event
|
|
Connections
|
|
Simulations
|