Component: Injector (Flowcode vNet) (Test Injectors)

From Flowcode Help
Jump to navigationJump to search
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.

FC6 Icon.png SingleInstanceVnet


Simple Multi Instance

The first program sends out data.

FC6 Icon.png UartVnetDemoTx


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

FC6 Icon.png 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.

FC6 Icon.png vNet Example Node 1

FC6 Icon.png vNet Example Node 2

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

VnetSim.jpg


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.

FC6 Icon.png ModbusMasterDemo

FC6 Icon.png ModBusSlaveDemo







Macro reference

IOGetInputPin

Fc9-comp-macro.png IOGetInputPin
 
Fc9-u8-icon.png - BYTE Pin
 
Fc9-bool-icon.png - BOOL Return


IOSetOutputPin

Fc9-comp-macro.png IOSetOutputPin
 
Fc9-u8-icon.png - BYTE Pin
 
Fc9-bool-icon.png - BOOL State
 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png Initialise
Sets up the injector ready to receive commands or send data 
Fc9-void-icon.png - VOID Return


UARTBaud

Fc9-comp-macro.png UARTBaud
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Rate
 
Fc9-void-icon.png - VOID Return


UARTCheckRX

Fc9-comp-macro.png UARTCheckRX
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Return


UARTInitialise

Fc9-comp-macro.png UARTInitialise
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-void-icon.png - VOID Return


UARTReceive

Fc9-comp-macro.png UARTReceive
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Return


UARTSend

Fc9-comp-macro.png UARTSend
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png vNet Injector Settings
Fc9-type-16-icon.png Network Interface
Allows different network interfaces to be selected. The current network interface can be determined by looking at the My IP properties. 
Fc9-type-16-icon.png Incoming Channel
TCP Channel Instance, allows multiple servers and clients to run on the same machine or inside the same simulation. 
Fc9-type-21-icon.png Incoming Port
Port used for incoming communications. 80=HTTP Ports have to match up to allow communications to be sent and received. 
Fc9-type-16-icon.png Outgoing Channel
TCP Channel Instance, allows multiple servers and clients to run on the same machine or inside the same simulation. 
Fc9-type-21-icon.png Outgoing Port
Port used for outgoing communications. 80=HTTP Ports have to match up to allow communications to be sent and received. 
Fc9-type-16-icon.png Connection Mode
Specified if this Vnet node is going to connect to another instance of Flowcode running on this PC or a networked PC.  
Fc9-type-21-icon.png Circular Buffer Size
Size of the circular buffers used to temporarily store the incoming and outgoing data. 
Fc9-conn-icon.png Local IP
Fc9-type-21-icon.png My IP0
Local IP address byte 0 
Fc9-type-21-icon.png My IP1
Local IP address byte 1 
Fc9-type-21-icon.png My IP2
Local IP address byte 2 
Fc9-type-21-icon.png My IP3
Local IP address byte 3 
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Show Console