Skip to main content

Action: SetCommunicationPath

Function: The action updates the communication parameters of a device object in the project so that a connection can be established later with the correct target device. In order to select the correct target device here, various options are provided by the action.

Call: Devices test driver

Tab: Configuration

Device name

Device with configuration to be updated

tm_storefullobjectname.png: Copies the settings of an object, which is selected in the device tree, to the input field

_cds_icon_arrow_down.png: Opens a list box with suitable objects which are configured in the open project

Hint: You can also drag the settings of a selected object to the input field (Drag&Drop).

Gateway name

Name of the gateway

_cds_icon_three_dots.png: Opens the gateway selection dialog

You can apply the data of a selected gateway to the configuration.

Use one of the following four options to scan the network for the target device to which the connection should be established. The two restriction options below can be used to refine the search when the operation is performed by means of Target address, Target name, or Local PLC.

Target address

New CODESYS address to be set in the format "[0101.A185]"

The network is scanned for the address specified here. With the possible restrictions regarding device type and device ID listed below, the detected selection of target devices in the network can be refined even more. However, if more than one device is detected nevertheless, then an attempt is made to establish a connection to the first device in the list of detected devices.

Target name

The network is scanned for target devices with this name which are running at least one PLC instance. The CODESYS address of the PLC instance is stored in the device object.

The Restrict to device type and Restrict to device ID options can be used to fine-tune the search. If, however, more than one result is found, then it is likely that more than one PLC instance is running on a device. Then the desired instance can be selected using Specify instance of PLC. If this is not specified, then an attempt is made to connect using the first search result.

Local PLC

The computer where the test script is executed is scanned for PLC instances. The CODESYS address of the PLC instance is stored in the device object.

The Restrict to device type and Restrict to device ID options can be used to fine-tune the search. If, however, more than one result is found, then it is likely that more than one PLC instance is running on a device. Then the desired instance can be selected using Specify instance of PLC. If this is not specified, then an attempt is made to connect using the first search result.

Target IP/DNS

IP address or DNS name of the target device

Optionally, the port can also be specified.

Examples: 192.168.0.1:1170, <host name>:1170

Note: With this option, the network is not scanned, but the IP address is stored directly in the device object. Therefore, no additional restriction to device type or device ID is possible. As a result, no check is performed before establishing the actual connection as to whether or not the specified device really exists or matches the device description.

Specify instance of PLC

standard icon: If multiple CODESYS runtime systems are running on the same system or network, then the instance which should be used can be specified here (list box). The instances are sorted in ascending order by the CODESYS target device address.

Restrict to device type

Specifies the scanned device type, which is stored in the device description and which is displayed when manually scanning the network

Example: 4096

This additional information is applied as a restriction after the network has been scanned according to the information specified above for Target address, Target name, or Local PLC.

Restrict to device ID

Specifies the scanned device ID, which is stored in the device description and which is displayed when manually scanning the network

Example: 00000001

This additional information is applied as a restriction after the network has been scanned according to the information specified above for Target address, Target name, or Local PLC.

Encrypted communication certificate

What should happen when encrypted communication is required and the target device has a certificate for it?

  • Do not trust certificate automatically: A dialog opens asking whether or not the certificate should be trusted or not.

  • Connect to device immediately and trust certificate: The certificate is trusted for the duration of the test run and a connection to the device is established immediately.

  • Trust certificate with next connection: The certificate is trusted for the duration of the test run at the next connection setup.

Tab: Credentials

Use the credentials

standard icon: The credentials are saved for a device or as default for all devices in the online manager. The device has to require authentication when logging in. The credentials remain active for the entire test run.

User

Credentials for authentication

Password

Table 36. Use the credentials

Only for the specified device

The credentials are used only for the specified device.

As default for all devices with no specific password set

The credentials are used for all devices which do not have explicitly configured credentials.



Tab: Parameters

The parameters defined on the Parameters tab are used to exchange values between test script variables and parameters of test actions. Parameters can be used as placeholders on the Configuration tab. For this, the name of the parameter is set in braces in the configuration dialog. Example: {name}.

Tip

Variables defined globally in the script (with the prefix $GLOBALS.) can be used directly in the test action. It is not necessary to use input parameters for passing. Using output parameters is necessary for writing global variables.

Input parameters: When executing the test action, the values of the test script variables are passed to the input parameters of the test action and can be used in the configuration of the test action.

Output parameters: When executing the test action, the values of the output parameters of the test action are passed to the test script variables and can be used (for example, in other test actions).

Name

Name of the input/output parameter

This name is defined in addition to the variable name to identify the origin of the parameter when it is passed to another script. During the test run, this name is displayed as the Outer name on the Variables (scope #<n>) tab in the Test progress window.

Background: When a script A calls another script B, and its variable x passes y as a parameter to the script B, then the parameter y is the variable y from the point of view of script B.

To see that this variable is recognized as variable x "outside" of script B, there is the Name column ("Outer name"). The variable y has the name x in the scope pf script B because it has been passed as variable x to the parameter y in the scope of the calling script A.

Variable

Name of the test script variable

Example: TS_CaseA_Result

Move Up

Moves the selected variable one line up

Move Down

Moves the selected variable one line down

Remove

Removes the selected variable from the list