Jump to content

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

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(8 intermediate revisions by 2 users not shown)
Line 126: Line 126:


{{Fcfile|ModBusSlaveDemo.fcfx|ModBusSlaveDemo}}
{{Fcfile|ModBusSlaveDemo.fcfx|ModBusSlaveDemo}}




Line 134: Line 140:
==Macro reference==
==Macro reference==


===UARTBaud===
===IOGetInputPin===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTBaud'''
| width="90%" class="mtx-class-macrohead" | '''IOGetInputPin'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 144: Line 150:
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
| width="90%" | Pin
|-
|-
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Rate
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




===IOGetInputPin===
===IOSetOutputPin===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOGetInputPin'''
| width="90%" class="mtx-class-macrohead" | '''IOSetOutputPin'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 172: Line 173:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | State
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
| colspan="2" | Sets up the injector ready to receive commands or send data 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




===UARTCheckRX===
===UARTBaud===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTCheckRX'''
| width="90%" class="mtx-class-macrohead" | '''UARTBaud'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 191: Line 211:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Rate
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




===UARTInitialise===
===UARTCheckRX===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTInitialise'''
| width="90%" class="mtx-class-macrohead" | '''UARTCheckRX'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 210: Line 235:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




===UARTReceive===
===UARTInitialise===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTReceive'''
| width="90%" class="mtx-class-macrohead" | '''UARTInitialise'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 229: Line 254:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




===IOSetOutputPin===
===UARTReceive===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOSetOutputPin'''
| width="90%" class="mtx-class-macrohead" | '''UARTReceive'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 244: Line 269:
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pin
| width="90%" | Channel
|-
|-
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
Line 259: Line 279:


===UARTSend===
===UARTSend===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTSend'''
| width="90%" class="mtx-class-macrohead" | '''UARTSend'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 280: Line 300:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
===Initialise===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Sets up the injector ready to receive commands or send data 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | vNet Injector Settings
| width="90%" class="mtx-class-propfolder" | vNet Injector Settings
|-
|-
|-
|-
Line 345: Line 349:
| 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" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Local IP
| width="90%" class="mtx-class-propfolder" | Local IP
|-
|-
|-
|-
Line 369: Line 373:
| colspan="2" | Local IP address byte 3 
| colspan="2" | Local IP address byte 3 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-

Latest revision as of 14:36, 13 July 2026

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

IOGetInputPin

IOGetInputPin
 
- BYTE Pin
 
- BOOL Return


IOSetOutputPin

IOSetOutputPin
 
- BYTE Pin
 
- BOOL State
 
- VOID Return


Initialise

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


UARTBaud

UARTBaud
 
- BYTE Channel
 
- BYTE Rate
 
- VOID Return


UARTCheckRX

UARTCheckRX
 
- BYTE Channel
 
- BYTE Return


UARTInitialise

UARTInitialise
 
- BYTE Channel
 
- VOID Return


UARTReceive

UARTReceive
 
- BYTE Channel
 
- BYTE Return


UARTSend

UARTSend
 
- BYTE Channel
 
- BYTE 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