Component: Injector (COM) (Simulation)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.2 (Release)
Category Simulation
This inherits from Data Injector


Image 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

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

BYTE


TxByte

Puts a byte onto the comms channel.

Parameters

BYTE DataByte


Return value

This call does not return a value


RxByte

Gets a byte from the comms channel - 255 signifies no more data available

Parameters

This macro has no parameters


Return value

BYTE


GetTxConsoleHandle

Gets the handle to the console allowing data displaying on the panel etc.

This call is provided by Data Injector

Parameters

This macro has no parameters


Return value

HANDLE


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

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

Parameters

This macro has no parameters


Return value

HANDLE


GetConsoleHandle

Gets the handle to the console allowing data displaying on the panel etc.

Parameters

This macro has no parameters


Return value

HANDLE



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