Component: Injector (COM) (Comms)
Author | Matrix Ltd |
Version | 1.2 (Release) |
Category | Comms |
This inherits from Data Injector Template |
Contents
Injector (COM) component
Comms data injector to allow a COM port peripheral to be attached to a comms component. The component will forward any outgoing bytes to the COM port and forward any incoming bytes to the comms component. Useful for controlling hardware such as Bluetooth, RS232, USB to Serial, MODBUS...
Examples
No additional examples
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
This component inherits simulation macros from Data Injector Template
InitialiseInjector
Sets up the injector ready to receive commands or send data
Parameters
- <- STRING InjectorName
- Name of the console that will be created
- This parameter may be returned back to the caller
Return value
RxByteCount
Returns the number of bytes currently sat in the receive buffer.
This call is provided by Data Injector Template
Parameters
- This macro has no parameters
Return value
TxByte
Puts a byte onto the comms channel.
Parameters
- BYTE DataByte
Return value
- This call does not return a value
RxByte
Attempt to receive a byte back from the injector
0 - 255 = Valid data
256 = RX timeout no data available
Parameters
- This macro has no parameters
Return value
GetTxConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc.
This call is provided by Data Injector Template
Parameters
- This macro has no parameters
Return value
ChangeState
Changes the state for I2C or SPI type comms where the data bytes along are not enough to go on.
This call is provided by Data Injector Template
Parameters
- BYTE NewState
- Assigns new state, 0=default
Return value
- This call does not return a value
GetRxConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc.
This call is provided by Data Injector Template
Parameters
- This macro has no parameters
Return value
GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc.
Parameters
- This macro has no parameters
Return value
Property reference
COM Port
This property is of type Fixed list of ints and can be referenced with the variable name COMPORT.
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 Rate
This property is of type Unsigned integer and can be referenced with the variable name Baud.
Baud rate passed to the COM port to control the rate of data in bits per second.
Timeout Value
This property is of type Unsigned integer and can be referenced with the variable name Timeout.
Value to specify what is returned when no incoming receive data is present.
Receive Timeout
This property is of type Unsigned integer and can be referenced with the variable name RxTout.
Maximum amount of time to wait in milliseconds before returning the timeout value