Jump to content

Component: Injector (Flowcode vNet) (Test Injectors): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 15: Line 15:
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.
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 Pack==
==Component Source Code==


FREE
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_InjectorVnet.fcfx FC_Comp_Source_InjectorVnet.fcfx]


==Detailed description==
==Detailed description==




Line 34: Line 36:


==Examples==
==Examples==




Line 275: Line 279:
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | vNet Injector Settings
|-
|-
|-
|-
Line 312: Line 320:
| colspan="2" | Size of the circular buffers used to temporarily store the incoming and outgoing data. 
| colspan="2" | Size of the circular buffers used to temporarily store the incoming and outgoing data. 
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Remote IP0
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Local IP
|-
| colspan="2" | Remotel IP address to connect to byte 0 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Remote IP1
|-
|-
| colspan="2" | Remotel IP address to connect to byte 1 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Remote IP2
|-
| colspan="2" | Remotel IP address to connect to byte 2 
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Remote IP3
|-
| colspan="2" | Remotel IP address to connect to byte 3 
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
Line 352: Line 344:
| colspan="2" | Local IP address byte 3 
| colspan="2" | Local IP address byte 3 
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|-
|-
|-

Revision as of 17:47, 9 November 2022

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 for the component source code: 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


Downloadable macro reference

UARTBaud
 
- BYTE Channel
 
- BYTE Rate
 
- VOID Return


IOGetInputPin
 
- BYTE Pin
 
- BOOL Return


UARTCheckRX
 
- BYTE Channel
 
- BYTE Return


UARTInitialise
 
- BYTE Channel
 
- VOID Return


GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
- HANDLE 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