Component: Injector (SCADA Slave UART) (Comms)

From Flowcode Help
Jump to navigationJump to search


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


Image Injector (SCADA Slave UART) component

Comms data injector to allow a Serial UART peripheral to be attached to a comms component. The component will forward any byte transactions through to a SCADA Slave enabled hardware. Enabling the Flowcode simulation runtime to directly drive a physical UART.

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

BYTE


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

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

Sets the state of the bus.

SPI - Controls the chip select pin

I2C - Controls the start/restart/stop status

Parameters

BYTE State
SPI: 0=CSLow, 1=CSHigh I2C: 0=Stop, 1=Start, 2=Restart


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

SCADA Slave

This property is of type Panel object and can be referenced with the variable name SCADASlave.

SCADA Slave component to use to pipe data to a physical SPI bus

BAUD Rate

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

Sets the data bit rate of the Serial UART.

See the SCADA Slave UART Baud macro for valid values,

RS485 Direction Control

This property is of type True or false and can be referenced with the variable name RS485DirCon.

Allows an I/O pin to be automatically assigned when transmitting and receiving.

RS485 Pin Number

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

Digital I/O pin number to use for the RS485 data direction pin

TX Pin State

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

Decides the state of the RS485 data direction pin when transmitting data.

RX Pin State

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

Decides the state of the RS485 data direction pin when receiving data.