Flowcode 4 Virtual Network Advanced Simulation
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Flowcode 4 Virtual Network Advanced Simulation
The virtual network simulation or VNet is a new feature in V4.1 of Flowcode. The VNet simulation is designed to allow multiple instances of Flowcode to communicate together whilst simulating to provide functionality similar to what would happen if the chips were running together on a single circuit board or network. This allows multiprocessor systems such as CAN bus systems to be tested in a multi node simulation environment before downloading your programs to the embedded hardware. The VNet functionality currently supports the RS232 and CAN Flowcode components with other components to hopefully follow in the near future.
To start with the VNet first you have to run a special server application on any computer in your network to create a VNet server for your network. This can be started by browsing to your "FlowcodeV4" folder (default is C:\Program Files\Matrix Multimedia\Flowcode V4) and running the executable file located inside the "VNET Server" folder. Each server instance is capable of hosting multiple individual VNet networks so if you want to run the VNet server application on your network server or a dedicated machine then this is possible.
You then need to know the IP address of the server to allow your computer and other computers to talk to the server software. To find out the IP address of your server you can click Start and Run and then type in "cmd" to launch the command prompt window. Once inside the command prompt window type in "ipconfig" to list the IP address assigned to your network card.
Once you have started the VNet server and you know the IP address of the server, you can click the VNet menu and select VNet Options in Flowcode. Here you should assign the IP address of the VNet server. You should leave the default port number set to 4360 if you have not changed it on the server.
For every VNet there must be a VNet Owner that initiates group simulations and assigns the connections of the network. The creator of each VNet becomes the Owner of that VNet by default. To create a new VNet you first have to click on the VNet menu and select Create. If your Flowcode instance can successfully connect to the VNet server on the network, you will be presented with a dialog window shown below. You should enter a name for your VNet and a name for your Flowcode instance. It is important that your VNet name is unique on the server and is not already hosted by someone else. Clicking the create button starts up the VNet on the server and makes the VNet available to other Flowcode instances.
The next step is to expose components on your instance of Flowcode to make them visible over the VNet. To do this click on the VNet menu and select manage nodes. Here you can select which components are visible on the VNet. In this example I have made one of my RS232 components available to the VNet. Note that the components list in this dialog will only show the components that are VNet enabled. Once you finished exposing the nodes available to the VNet you can close the Manage nodes window.
Now that you have started up a server, created a network and exposed some of the components over the VNet, we can start to join another Flowcode instance nodes to the VNet. In another instance of Flowcode either on the same PC or on a networked PC, set the VNet server߀™s IP address and click VNet and Join. From here you can enter a name for your Flowcode instance and also select the active VNet you wish to join. Make sure that your Flowcode instance is unique or otherwise you will not be able to join the VNet.
Again you also have to click VNet and Manage Nodes to expose components to the Vnet. Here I have made another RS232 component accessible to the VNet. When you have finished making components accessible you can close the manage nodes window.
Once all nodes have been established onto the VNet you are ready to start wiring the nodes of available Flowcode instance together. The VNet owner instance can click on VNet and View Diagram to see the nodes currently attached the VNet. The nodes appear at the bottom of the window and can be clicked to be added on to the VNet diagram. Once the Flowcode instances are on the VNet Diagram they can be dragged around and rearranged to allow for more connectivity options. Shown below are the two VNet instances I created which both have RS232 nodes available.
By clicking on the RS232 node I can draw a line to the other RS232 node. Connection lines can have multiple points and can even branch in multiple directions to allow multiple nodes to be tied together.
When you have finished editing the VNet connections click the Save button to send the connections information to the VNet Server.
Other Flowcode instances that are part of the VNet can also click the VNet menu and select View Diagram to see the interconnection between the nodes. Note that the connections cannot be edited on them however.
You are now ready to begin shared simulation. If you click the run simulation button in a VNet client Flowcode instance then you will receive this message.
If you click the run simulation button in a VNet master client Flowcode instance then you will receive this message.
When every node in the VNet is ready for the group simulation to begin then the VNet owner will receive this message from the VNet Server.
Clicking Yes will start the simulation on every Flowcode instance connected to the VNet allowing the start up to be synchronised similar to plugging the power into a real life system.
In the examples provided node 1 is constantly polling a keypad. When a key is pressed on the keypad the ASCII value for the key press is sent over the RS232 connection.
Node 2 simply listens to the RS232 for incoming data, if data is present then it gets printed onto the LCD screen.
Click here to download the examples
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 8
- Joined: Thu Mar 13, 2008 10:57 am
- Contact:
Re: Flowcode 4 Virtual Network Advanced Simulation
When a try to open the zip file it gives me a error
not in the the right dir ?
Can some one help me ?
not in the the right dir ?
Can some one help me ?
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: Flowcode 4 Virtual Network Advanced Simulation
Hi,
I got the same error ^^.
Nice feature of the V4, btw !
Rgds,
Nicolas L. F.
I got the same error ^^.
Nice feature of the V4, btw !
Rgds,
Nicolas L. F.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Flowcode 4 Virtual Network Advanced Simulation
Hello,
I have reloaded the example file and it should now work correctly when you try to download it.
I have reloaded the example file and it should now work correctly when you try to download it.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel