Network Extensions

Sometimes, it is necessary to interface with external applications or devices for information or extra computational purposes. In order to allow communication with external applications or devices, you must add User Datagram Protocol (UDP) extensions to your simulation. See Network Communication Add-on for more information on how these extensions are used together.

Note
If you are connecting to an external device or application (e.g., Simulink), this section and Network Communication Add-on should provide you with enough information to set it up to communicate with Vortex® Studio using UDP.

The following UDP extensions are available:

UDP Module

In order to enable UDP network communication, you must first add the UDP Module to your Setup file. The UDP Module manages all UDP send and receive extensions (see below).

To add a UDP Module:

  1. In your Setup file, select Modules in the Toolbox.
  2. Double-click UDP Module to add it to your setup.
  3. If desired, rename the UDP Module in the Name field of its Properties panel.

UDP Receive

In order to receive communications from external applications or devices using UDP, you must add a UDP Receive extension to your simulation.

To add a UDP Receive extension:

  1. In your scene or mechanism, select Network in the Toolbox.
  2. Double-click UDP Receive to add it.
  3. Right-click the UDP Receive extension in the Explorer panel, then select Edit from the menu to add output data.
    1. In the resulting window, click Add. A new output row appears in the table.
    2. Edit the name of the output.
    3. Click in the Type field to open a drop-down list of possible data types for your output field (e.g., double, int32, Boolean).
    4. Click in the Physical Dimension field to open a drop-down list of possible dimensions for your output field (e.g., length, volume, mass).
    5. Add as many output fields as required, then click Ok.

In the UDP Receive extension's Properties panel, you will see the following fields.

UDP Send

In order to send communications to external applications or devices using UDP, you must add a UDP Send extension to your simulation.

To add a UDP Send extension:

  1. In your scene or mechanism, select Network in the Toolbox.
  2. Double-click UDP Send to add it.
  3. Right-click the UDP Send extension in the Explorer panel, then select Edit from the menu to add input data.
    1. In the resulting window, click Add. A new input row appears in the table.
    2. Edit the name of the input.
    3. Click in the Type field to open a drop-down list of possible data types for your input field (e.g., double, int32, Boolean).
    4. Click in the Physical Dimension field to open a drop-down list of possible dimensions for your input field (e.g., length, volume, mass).
    5. Add as many input fields as required, then click Ok.

In the UDP Send extension's Properties panel, you will see the following fields.

Network Communication Add-on (UDP)

Network Communication Add-on is a device that allows communication with external applications or devices over User Datagram Protocol (UDP).

The Network Communication Add-on devices can be created in both the content and the application setup as a device. The protocol used is the same as the Real-Time UDP for MATLAB and Simulink.

Note
If you are connecting to an external device or application (e.g., Simulink), this section and the Network Extensions above should provide you with enough information to set it up to communicate with Vortex® Studio using UDP.

This table shows the direct conversion between the Vortex type and the external type.

Vortex Type External Type Bytes
double double 8
float single 4
int int32 4
unsigned int uint32 4
short int16 2
unsigned short uint16 2
char int8 1
unsigned char uint8 1
bool boolean 1


Adding Network Communication as a Device

In order to add Network Communication as a device, the add-on needs to be configured in the application setup.

First, open the Vortex Studio Editor and create a new setup or open an existing one.

The second step is to add the UDP Module by searching in the Toolbox and double-clicking on UDP Module.

The UDP Module manages all the UDP send and receive extensions. See Network Extensions for more information.

Similarly to the module, the send and receive extensions can be added by searching UDP Send or UDP Receive in the Toolbox.

Once an extension is added, it is possible to modify its properties in the Properties panel.

In the Properties panel, you will find the following information:

Parameters

The local address and port identifies the host IP address and port, while the remote address and port describes the IP address and port of the external application or device communicating with Vortex Studio Editor.

The Device ID lists the information concerning the device, which is used in order to identify the device. This will be filled automatically by the module.

Received and Sent Data

The list of data to be sent or received can be found in the Outputs section when dealing with the UDP Receive extension, and Inputs panel when dealing with the UDP Send extension.

As the name suggests, the UDP Receive extension will receive data, while the UDP Send will send data according to this data list.

To add data, right-click on the extension and select Edit. This window is used to add and remove fields of data, e.g., inputs and outputs.

In the example shown above, the UDP Receive extension will receive two double values (Move and Rotate) and one int32 value (Run).

Note
The order of the data in the list will dictate the structure of the sent/received data. However, the names have no impact and are simply there to identify them locally.

Mapping the Device

Once the communication device has been created in the application setup, it can be mapped in the Vortex Studio Player via The Control Presets tab.

Mapping allows you to connect data fields to a Control Interface, which in turn is connected to a mechanism.

In the previous image, the UDP Receive device is associated with "ControlInterfaceInputs".

Once the data fields are properly associated, the data will automatically be transmitted to the Control Interface.

It is also possible to set the communication device as a Control Interface's default device in Vortex Studio Editor. This means that the Control Interface will automatically associate this device when the content is loaded in Vortex Studio Player.

Creating in the Content

There must be a UDP Module located in the application setup file (editor.vxc) in order to make the extensions functional in the Vortex Studio Editor. The extensions are not functional when the name is grayed out.

In order to add the Network Communication device add-on to the content (mechanisms and scenese), it is first of all necessary to open Vortex Studio Editor and create/open a scene or mechanism.

Once the content file open, you can add the extension by searching in the Toolbox. The properties can then be modified accordingly.

Note
UDP Module must be added to the proper node of the setup used by the simulator to activate the network extensions of the content.

For example, a Connection Container can be added in the same object as the UDP extension. In the same example, a Controllable Human is also added to the content in order to demonstrate data field connections.

Data fields from the Human Control are added to Connections.

Once the data fields are added to the Connections Container, the fields can be linked together, as seen in the next image.

The data sent to the external application or device will be transferred to the Controllable Human's Body Move Speed and Bode Rotate Speed.