Direct tags import from CODESYS PLC

Right clicking on the Driver name in the Supervisor Project explorer window and selecting “Import Device Database”, the import dialog will be shown.

This driver supports the direct tags import through PLC connection and the import from files.

On line import

Clicking on the “Import from PLC” button the driver will try the connection with the PLC. Once the connection is established, the driver fetches the variables available for the communication and show them in the dialog grid.

Import from files

Using the “Import from file” button permits to import PLC tags exported by CODESYS Workbench.

  • For CODESYS 2.3 select the file format “.sym” CODESYS files

  • For CODESYS 3 select the file format “.xml” CODESYS files

Shortening of Names

We assume here the tag names in the controller are available in the following format:

<Application name>.<POU name>.<Variable name>

Once Import Device Variable dialog grid is populated, the “Shortening of Names” combo box is enabled with the following options:

  • “No” it is the default, no changes will be applied on names.

  • “Yes”, in this case the shortening will remove from the tag name the part “<Application name>.<POU name>” (for example if the PLC variable is “Application.PLC_PRG.bPower”, the “Application.PLC_PRG” part will be removed and only “bPower” remains as Premium HMI tag name). This option is available for both import methods, PLC and file.

  • “Yes”, remove all levels”, this option is useful for the cases with multiple variable declaration levels; all levels will be then removed and only the variable name will remain (for example, assuming that <Variable name> is nested into POUs like <Application name>.<POU name>.<POU_1 name>.<Variable name> then the Premium HMI tag will be imported simply as <Variable name>). This option is available only when tags are imported from file.

Select the desired option, specify which tags have to be imported and click then the “Import” button.

WARNING! The shortening process could generate not unique tag names in case the same variable is declared in more than one POU; for those cases the tag is imported with no shortening.

Note: “Shortening of Names” is supported for CODESYS 3 “.xml” file.

Import Dialog Grid

Every Item appears in the grid as a row with the following columns: [Name] - [Type] - [Access Type] - [Size] - [Description]

  • [Name] will be used to fill the Item Name property of the dynamic string. It is used also to build the name of the correspondent Supervisor variable; dots are substituted with underscores.

  • [Type] represents the variable type, in the dynamic string.

  • [Access Type] tells the driver which kind of access is permitted: r (read only), w (write only), n (none), b (both read and write).

  • [Size] is the size in bytes of the PLC variable.

Selecting a number of rows from the list and pressing the “Import” button results in the creation, inside the Supervisor, of a correspondent number of variables, with type inherited from the PLC type and name coming from the PLC tag Item Name.

Please, take into account that the Device IP Address and the PLC Address must have valid values, in order to connect with the PLC and retrieve the variables data.