Jump to content

Component: Injector (Flowcode vNet) (Test Injectors)

From Flowcode Help
Revision as of 16:48, 30 January 2023 by Wiki bot (talk | contribs)
Author Matrix Ltd
Version 1.0
Category Test Injectors


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.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_InjectorVnet.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_InjectorVnet.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Simple Single Instance

Sends out data and prints incoming data to an LCD. Uses the same port number for transmit and receive.

SingleInstanceVnet


Simple Multi Instance

The first program sends out data.

UartVnetDemoTx


The second program receives the data and prints to an LCD.

UartVnetDemoRx


Remote Lock

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.

vNet Example Node 1

vNet Example Node 2

Communications over the vNet injector can be monitored using the console.


Modbus Master and Slave example using vNet

Example of communicating using Modbus Master and Slave using two instances of Flowcode and the vNet injector component.

ModbusMasterDemo

ModBusSlaveDemo



Macro reference

UARTBaud
 
- BYTE Channel
 
- BYTE Rate
 
- VOID Return


IOGetInputPin
 
- BYTE Pin
 
- BOOL Return


UARTCheckRX
 
- BYTE Channel
 
- BYTE Return


UARTInitialise
 
- BYTE Channel
 
- VOID Return


UARTReceive
 
- BYTE Channel
 
- BYTE Return


IOSetOutputPin
 
- BYTE Pin
 
- BOOL State
 
- VOID Return


UARTSend
 
- BYTE Channel
 
- BYTE Data
 
- VOID Return


Initialise
Sets up the injector ready to receive commands or send data 
- VOID Return



Property reference

Properties
vNet Injector Settings
Network Interface
Allows different network interfaces to be selected. The current network interface can be determined by looking at the My IP properties. 
Incoming Channel
TCP Channel Instance, allows multiple servers and clients to run on the same machine or inside the same simulation. 
Incoming Port
Port used for incoming communications. 80=HTTP Ports have to match up to allow communications to be sent and received. 
Outgoing Channel
TCP Channel Instance, allows multiple servers and clients to run on the same machine or inside the same simulation. 
Outgoing Port
Port used for outgoing communications. 80=HTTP Ports have to match up to allow communications to be sent and received. 
Connection 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
Size of the circular buffers used to temporarily store the incoming and outgoing data. 
Local IP
My IP0
Local IP address byte 0 
My IP1
Local IP address byte 1 
My IP2
Local IP address byte 2 
My IP3
Local IP address byte 3 
Simulation
Show Console