This tutorial provides information about the MODBUS usage.

Install WP ConneX Workbench and Runtime Service

Download and install from:

https://xxxx.com

Create a new Modbus Master configuration

To create a new Modbus Master configuration:

  1. Open the IO Drivers ()window.
  2. Insert a configuration ().

  1. Select the MODBUS Master driver:
  2. Insert a Master/Port ( ) corresponding to your MODBUS settings:

  1. Insert a Slave/Datablock () and enter the corresponding information.

Note: It is possible to automatically declare the variables by checking the Declare variables

checkbox. The name of the declared variables must be filled in the Prefix cell.

  1. Variables can be inserted one by one. Use the Insert Variable button () and enter the corresponding information.

When a variable is mapped to a data block in a master configuration you can select it to be:

๐Ÿž‚โ€‹        An exchange of data (exchange between the MODBUS map and the T5 variables).

๐Ÿž‚โ€‹        A status (diagnostic information provided to the application).

๐Ÿž‚โ€‹        A command (using a variable for driving the stack).

  1. Variable information within a data block can also be edited in the grid. From this grid it is also possible to declare variables in the database doing a right-click on a variable.

  1. The import/export in a CSV format is available using the right-click mouse button on an element of the configuration and then choosing to Import/Export Children.

This feature will import/export the sub-level. For example, a right-click on the Datablock (#1) and then Export Children (#2) will export all the blockโ€™s variables (#3). An export from the Port will export only the Datablock configuration, etc.

Modbus communication through TLS

Since the version 12 of straton our MODBUS-TCP protocol is equipped with a TLS option.

This part of the tutorial assumes that you already have certificates ready to use on your targets, if this is not the case please refer to tutorial TLS_security_for_straton.


Master configuration

On the driverโ€™s first level, select Enable TLS.

On the level 2, double-click on the parameter TLS which should be to Disabled then click on Enable Transport Layer Security (TLS).

Certificate path (Private/CA) => path to the โ€œPrivateโ€ and โ€œCAโ€ folders.

Private Certificate (.pem) => certificate complete name.

Peer certificate Subject (CN) (optional) => Common name of the server certificate following this

model โ€œ/CN=<common_name>โ€.

Slave configuration

Unlike the Master, the configuration of the Slave is not done through the configurator but in an file which should be stored at the same location than the Runtime Service binary.

Create the file โ€œt5secure.datโ€ (/!\ do not change the name).

Example:

[*:1100] 

KEY_CERT=SERVER.pem 

PEER_CN=/CN=CLIENT

PUB_CERT=

TLS_MIN=2 

TLS_MAX=3

PKI_PATH=<path to the โ€œPrivateโ€ and โ€œCAโ€ folders>

CIPHERS= 

CIPHERS13=

 [TRACE] 

LEVEL=1

Please refer to the following table to adapt your file according to your needs


Parameters

Key Words

Values

Private key file

KEY_CERT

STRING - Certificate filename (without path) /!\ Mandatory /!\

Public certificate file

PUB_CERT

STRING โ€“ Public certificate filename (with path)

Hardcoded : EMPTY โ€“ use the same as โ€œKEY_CERTโ€

Min TLS version allowed

TLS_MIN

(TLS_NONE)        0

(TLS_11) 1

(TLS_12)        2(Hardcoded/Default)

(TLS_13)        3

Max TLS version allowed

TLS_MAX

(TLS_NONE)        0

(TLS_11)        1

(TLS_12)        2

(TLS_13)        3 (Hardcoded/Default)



Parameters

Key Words

Values

Certificates path

PKI_PATH

STRING - Path (to /CA & /PRIVATE folders)

Permissive ciphers

CIPHERS

STRING - Enumeration separate by colons (OpenSSL format)

Hardcoded : EMPTY โ€“ no restriction

Permissive ciphers TLS1.3

CIPHERS13

STRING - Enumeration separate by colons (OpenSSL format)

Hardcoded : EMPTY โ€“ no restriction

Expected subject of the peer's certificate

PEER_CN

STRING - Common name (/CN=xxxxxx)

Hardcoded : EMPTY โ€“ peer certificate subject not considered


NOTES : โ€œ[*:1100]โ€ is used to specify the communication port. You can change it with the MBSLAVETCP block.


Download the application

Download the application to the Runtime Service:

๐Ÿž‚โ€‹        Select the communication parameters in Menu Tools/Communication Parameters

๐Ÿž‚โ€‹        Establish the connection through Menu Project/Online RESULT IS:

The download is successful and application starts correctly.

The Runtime Service is not started or communication parameters are wrong.

The application is not yet downloaded or an error occurs during startup. More detail can be found in the output view.

Created with the Personal Edition of HelpNDoc: Easily share your documentation with the world through a beautiful website