Component: Injector (Human Interface) (Comms)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.0 (Release)
Category Comms
This inherits from Data Injector Template


Image Injector (Human Interface) component

Comms data injector to allow typed data values to be inserted into a component. Allows data to be input in raw ASCII form or as numeric byte data 0-255.

Examples

This example receives a character via the RS232 component and outputs it to the LCD, an injector has been added to allow you to type data into the console. FC6 Icon.png Human Interface Injector Example The Console window has tabs for the human interface data injector allowing you to type in data that will be received by the component.

RS2322.jpg


Again the RS232 console tabs reflect the data as it is sent and received.

RS2323.jpg


LCD showing received data.

RS2324.jpg

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

BYTE


RxByteCount

Returns the number of bytes currently sat in the receive buffer.

Parameters

This macro has no parameters


Return value

UINT


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

UINT


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

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 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

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

Buffer Size

This property is of type Unsigned integer and can be referenced with the variable name CircularBufferSize.

Max number of bytes that can be stored in the components circular buffer

Data Mode

This property is of type Fixed list of ints and can be referenced with the variable name DataMode.

Sets the console data to interperete the data as ASCII or as Numbers 0-255