Component: Injector (SCADA Slave Digital Output) (Comms Data Injectors)

From Flowcode Help
Jump to navigationJump to search


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


Image Injector (SCADA Slave Digital Output) component

Data injector to allow a physical digital output pin to be attached to a simulated component. The component will forward any output state changes through to a SCADA Slave enabled hardware. Enabling the Flowcode simulation runtime to directly interface with a physical I/O pin.

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, 3=LastRx


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

Number of Pins

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

Specifies the number of pins the component can monitor and control.

Simulation I/O Pin

This property is of type Single digital pin and can be referenced with the variable name Pin0.

Pin monitored by the simulation

SCADA Slave Pin

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

Pin used by the connected SCADA Slave hardware

Simulation I/O Pin

This property is of type Single digital pin and can be referenced with the variable name Pin1.

Pin monitored by the simulation

SCADA Slave Pin

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

Pin used by the connected SCADA Slave hardware

Simulation I/O Pin

This property is of type Single digital pin and can be referenced with the variable name Pin2.

Pin monitored by the simulation

SCADA Slave Pin

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

Pin used by the connected SCADA Slave hardware

Simulation I/O Pin

This property is of type Single digital pin and can be referenced with the variable name Pin3.

Pin monitored by the simulation

SCADA Slave Pin

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

Pin used by the connected SCADA Slave hardware

Simulation I/O Pin

This property is of type Single digital pin and can be referenced with the variable name Pin4.

Pin monitored by the simulation

SCADA Slave Pin

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

Pin used by the connected SCADA Slave hardware

Simulation I/O Pin

This property is of type Single digital pin and can be referenced with the variable name Pin5.

Pin monitored by the simulation

SCADA Slave Pin

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

Pin used by the connected SCADA Slave hardware

Simulation I/O Pin

This property is of type Single digital pin and can be referenced with the variable name Pin6.

Pin monitored by the simulation

SCADA Slave Pin

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

Pin used by the connected SCADA Slave hardware

Simulation I/O Pin

This property is of type Single digital pin and can be referenced with the variable name Pin7.

Pin monitored by the simulation

SCADA Slave Pin

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

Pin used by the connected SCADA Slave hardware