Component: Injector (Flowcode vNet) (Comms)
Author | Matrix Ltd |
Version | 1.0 (Release) |
Category | Comms |
This inherits from Data Injector Template |
Contents
Injector (Flowcode vNet) component
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 is an example of using the vNet injector to simulate a multi microcontroller system.
Microcontroller 1 is connected to a keypad and has a RS232 communications connection.
Microcontroller 2 is connected to a solenoid and has a RS232 communications connection.
Any key presses detected on microcontroller 1 will be sent via RS232 to microcontroller 2. If the correct byte sequence (1234) is received by microcontroller 2 then the solenoid is fired to unlock a door for 5 seconds.
Communications over the vNet injector can be monitored using the console.
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
RxByteCount
Returns the number of bytes currently sat in the receive buffer.
Parameters
- This macro has no parameters
Return value
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
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
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
GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc.
Parameters
- This macro has no parameters
Return value
Property reference
Network Interface
This property is of type Fixed list of ints and can be referenced with the variable name Interface.
Allows different network interfaces to be selected.
The current network interface can be determined by looking at the My IP properties.
TCP Channel
This property is of type Fixed list of ints and can be referenced with the variable name TCPChannel.
TCP Channel Instance, allows multiple servers and clients to run on the same machine or inside the same simulation.
Incoming Port
This property is of type Unsigned integer and can be referenced with the variable name IPort.
Port used for incoming communications. 80=HTTP
Ports have to match up to allow communications to be sent and received.
Outgoing Port
This property is of type Unsigned integer and can be referenced with the variable name Port.
Port used for outgoing communications. 80=HTTP
Ports have to match up to allow communications to be sent and received.
Connection Mode
This property is of type Fixed list of ints and can be referenced with the variable name Mode.
Specified if this Vnet node is going to connect to another instance of Flowcode running on this PC or a networked PC.
Circular Buffer Size
This property is of type Unsigned integer and can be referenced with the variable name CircularBufferSize.
Size of the circular buffers used to temporarily store the incoming and outgoing data.
Remote IP0
This property is of type Unsigned integer and can be referenced with the variable name ServerIP0.
Remotel IP address to connect to byte 0
Remote IP1
This property is of type Unsigned integer and can be referenced with the variable name ServerIP1.
Remotel IP address to connect to byte 1
Remote IP2
This property is of type Unsigned integer and can be referenced with the variable name ServerIP2.
Remotel IP address to connect to byte 2
Remote IP3
This property is of type Unsigned integer and can be referenced with the variable name ServerIP3.
Remotel IP address to connect to byte 3
My IP0
This property is of type Unsigned integer and can be referenced with the variable name MyIP0.
Local IP address byte 0
My IP1
This property is of type Unsigned integer and can be referenced with the variable name MyIP1.
Local IP address byte 1
My IP2
This property is of type Unsigned integer and can be referenced with the variable name MyIP2.
Local IP address byte 2
My IP3
This property is of type Unsigned integer and can be referenced with the variable name MyIP3.
Local IP address byte 3