Component: Data Injector (Simulation)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.0 (Release)
Category Simulation


Image Data Injector component

A base data injector used as a placeholder in components which reference the data injector interface. Not recommended for use in projects.

This component can be used as a base to create child components

The following components all inherit the traits of Data Injector:

-
Image Injector (AT) Comms data injector to replicate basic AT command syntax.

The component will record each incoming character until the termination character is received. Once this happens the component will respond by echoing back the received data followed by an "OK" reply.

Image Injector (CAN) Comms data injector to allow CAN message identifiers to be decoded to specific message strings.

Uses an external CSV file to specify the IDs and descriptive strings.

Image Injector (COM) 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...

Image Injector (DS1307 RTC) Comms data injector to allow simulation of a DS1307 Real Time Clock and RAM.
Image Injector (File) Comms data injector to allow data to be streamed to and from a file during simulation.

The component will read data from the incoming file and write data to the outgoing file.

Image Injector (GPS NMEA) Comms data injector to allow simulation of NMEA style GPS messages
Image Injector (Human Interface) 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.

Image Injector (Loopback) Comms data injector to replicate a basic loopback setup.

The component will return any outgoing data back to the receiver.

Image Injector (vNet) Comms data injector to allow components to talk to each other between instances of Flowcode.

The injector allows the data to be sent and received between multiple instances of Flowcode either running on a single machine, across a network or via the internet.

Examples

Here are some example Injector source files which go a good way towards demonstrating how to create your own injector component.


DS1307 I2C Device Example Injector Source FC6 Icon.png InjectorDS1307 AT Device Example Injector Source FC6 Icon.png InjectorAT

Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

InitialiseInjector

No additional information


Parameters

<- STRING InjectorName
This parameter may be returned back to the caller


Return value

BYTE


TxByte

Transmit a byte out to the Injector

Parameters

BYTE Data


Return value

This call does not return a value


RxByte

Attempt to receive a byte back from the injector

Parameters

This macro has no parameters


Return value

BYTE


GetTxConsoleHandle

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

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.

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.

Parameters

This macro has no parameters


Return value

HANDLE



Property reference

This component does not contain any properties