3S_V3

3S_V3

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

General

The 3S_V3 driver uses the PLC-Handler from CoDeSys to connect to the PLC. The PLC-Handler is an interface to controllers with software versions V2.3 and V3.

info Information

From zenon 7.50, the driver supports both CoDeSys software version 2.3 as well as version 3.

PLC-Handler

Different versions of the PLC Handler are not compatible. The correct PLC handler for the respective driver version must always be used. PLC-Handlers of other versions must be replaced. For details see the PC chapter:

Connection

Version V3 and version V2.3 controllers are addressed by means of the node address, which is unique in the network that can be contacted.

A connection to the control can be established.

  • using ARTI (Asynchronous RunTime Interface) via the local network card
    or
  • a gateway on the local computer or a remote computer

The driver can address several controllers at the same time. In doing so, a separate PLC handler instance is created for each connection.

Symbolic addressing

The PLC-Handler only addresses variables in the controller using its symbolic name. Addressing using the offset of the variables is not possible. However, for complex variables (structures, arrays) the whole (binary) data block of the variable can be addressed using the base name. This is used by the driver for RDA.

In zenon versions up to 7.00, variables are addressed using variable identification. From version 7.10 onwards, it is possible to select whether the identification or the symbolic address option is used.

In order for the PLC handler to find the variables via the symbolic name in the controller, you must select the variables used in the zenon project in the CoDeSys project configuration software using a symbol configuration object and transfer this to the controller. In doing so, a symbol file in XML format is created at the same time. This can be used for offline importing of variables.

Note: The connection is broken if there are no symbols in the controller.

Other topics in this chapter

3S_V3 - Data sheet

Driver history

Requirements

Configuration

Creating variables

Driver-specific functions

Driver commands

Error analysis


3S_V3 - Data sheet

3S_V3 -> 3S_V3 - Data sheet

General: |
Driver file name | 3S_V3.exe
Driver name | 3S v3 driver for PLC Handler
PLC types | 3S CoDeSys v3 based PLCs ; Schneider Electric PAC Drive LMC; V2 PLCs from Version: V2.3.9.33
PLC manufacturer | 3S; Elau; Schneider; Bosch Rexroth;

Driver supports: |
Protocol | 3S-Arti; 3S-Gateway;
Addressing: Address-based | --
Addressing: Name-based | X
Spontaneous communication | --
Polling communication | X
Online browsing | X
Offline browsing | X
Real-time capable | X
Blockwrite | --
Modem capable | --
Serial logging | --
RDA numerical | X
RDA String | --

Requirements: |
Hardware PC | --
Software PC | PLC Handler from 3S; The file 'PLCHandlerDll.dll' will be installed automatically with the setup. The file "GDrvABBTcpIpL2X.dll" is required when using the "TCP L2ABB" Gateway protocol for V2.3. This has to be ordered from ABB.
Hardware PLC | --
Software PLC | --
Requires v-dll | X

Platforms: |
Operating systems | Windows CE 6.0, Embedded Compact 7; Windows 7, 8, 8.1, 10, Server 2008R2, Server 2012, Server 2012R2;
CE platforms | x86; ARM;


Driver history

3S_V3 -> Driver history

Date

Build number

Change

21.06.13

7.11.0.7498

Created driver documentation

17.08.15

7.50.0.21651

Driver supports:

  • Selection of the origin of the time stamp
  • Block arrays
  • Amendable prefix for imported variable names
  • Exception handling

30.09.15

7.20.0.21830

Driver supports and requires PLC Handler 3.5.7.0.

10.1.2016

7.50.0.25589

Additional support of CoDeSys version 2.3.

Driver versioning

The versioning of the drivers was changed with zenon 7.10. There is a cross-version build number as of this version. This is the number in the 4th position of the file version,
For example: 7.10.0.4228 means: The driver is for version 7.10 service pack 0, and has the build number 4228.

Expansions or error rectifications will be incorporated into a build in the future and are then available form the next consecutive build number.

Example Example

A driver extension was implemented in build 4228. The driver that you are using is build number 8322. Because the build number of your driver is higher than the build number of the extension, the extension is included. The version number of the driver (the first three digits of the file version) do not have any significance in relation to this. The drivers are version-agnostic


Requirements

3S_V3 -> Requirements

This chapter contains information on the requirements that are necessary for use of this driver.

Other topics in this chapter

PC

PLC


PC

3S_V3 -> Requirements -> PC

Additional software

PC

The driver needs the PLCHandlerDll.dll, which is produced by 3S and contains PLCHandler-SDK. The required version depends on the version of zenon used:

zenon 7.50

From version 7.50, zenon supports the communication of both V3 and V2 connections.

The following rules are applicable for a connection to the PLC with version 2:

  • If the connection is established using ARTI (peer-to-peer), no additional software is required.
  • If the connection is established by means of a gateway, the following files must be present in the same directory in which the driver .exe file is also located:
    • GClient.dll
    • GDrvBase.dll
    • GHandle.dll
    • GHandleStdcall.dll
    • GSymbol.dll
    • GUtil.dll

    Note: The directory can also be stated with the PATH environment variable.

  • If the gateway is to be started automatically on the driver (with the driver at the latest), the following files must be in the same directory in which the client DLLs are located for a connection to V 2 (see above):
    • Gateway.exe
    • GatewayDDE.exe
    • CommSym.dll
    • CommUsr.dll
  • The version of the gateway software and the DLLs is 2.3.9.33 (or higher).

Note on compatibility

Communication to controllers with version 2 software is only possible from zenon 7.50. Note the following requirements for older versions:

From zenon version

Required PLC handler version

Notes

7.00

3.5.3.60

The PLCHandlerDll.dll must be present in the Windows folder.

7.11

3.5.4.0

The PLC Handler is installed in the Windows folder.

7.20 Build 21830

3.5.7.0

From zenon 7.20, the respective current version of the PLCHandlerDll.dll is installed automatically. The installation folder is now the same folder as that of the driver.

info Information

Ensure that PLC firmware and PLC-Handler have the same version number. Only this way can correct communication be guaranteed.

Note: You can find an overview of the versions used on the computer in the driver dialog in the Information tab.

CE

No software needs to be installed for CE; PLCHandler-SDK has a fixed link to the driver.

Under Windows CE it is not possible to use several drivers of the same type.

attention Attention

CE is only supported up to version 7.20.
From version 7.50, Runtime files for 7.20 must be created.


PLC

3S_V3 -> Requirements -> PLC

controls

The 3S_V3 driver is to connect a PLC that uses 3S CoDeSys V3 or V2.3 software.

Examples: 3S CoDeSys, Control Win V3, or Schneider LMC PacDrive.

The connection to the PLC is possible via

  • The ARTI interface (Asynchronous RunTime Interface)
  • A local or a remote gateway.

info Information

From zenon 7.50, both CoDeSys software version 3 and version 2 are supported by the driver.


Configuration

3S_V3 -> Configuration

In this chapter you will learn how to use the driver in a project and which settings you can change.

info Information

Find out more about further settings for zenon variables in the chapter Variables of the online manual.

Other topics in this chapter

Creating a driver

Settings in the driver dialog


Creating a driver

3S_V3 -> Configuration -> Creating a driver

In the Create driver dialog, you create a list of the new drivers that you want to create.

Parameters | Description
Available drivers | List of all available drivers. The display is in a tree structure: [+] expands the folder structure and shows the drivers contained therein. [-] reduces the folder structure Default: no selection
Driver name | Unique Identification of the driver. Default: Empty The input field is pre-filled with the pre-defined Identification after selecting a driver from the list of available drivers.
Driver information | Further information on the selected driver. Default: Empty The information on the selected driver is shown in this area after selecting a driver.

Close dialog

Options | Description
OK | Accepts all settings and opens the driver configuration dialog of the selected driver.
Cancel | Discards all changes and closes the dialog.
Help | Opens online help.
info Information
The content of this dialog is saved in the file called Treiber_[Language].xml. You can find this file in the following folder: C:\ProgramData\COPA-DATA\zenon[version number].

Create new driver

In order to create a new driver:

  1. Right-click on Driver in the Project Manager and select New driver in the context menu.
    Optional: Select the New driver button from the toolbar of the detail view of the Variables.
    The Create driver dialog is opened.
  2. The dialog offers a list of all available drivers.

  3. Select the desired driver and name it in the Driver designation input field.
    This input field corresponds to the Identification property. The name of the selected driver is automatically inserted into this input field by default.
    The following is applicable for the driver designation:
    • The driver name must be unique.
      If a driver is used more than once in a project, a new name has to be given each time.
      This is evaluated by clicking on the OK button. If the driver is already present in the project, this is shown with a warning dialog.
    • The driver name is part of the file name.
      Therefore it may only contain characters which are supported by the operating system. Invalid characters are replaced by an underscore (_).
    • Attention: This name cannot be changed later on.
  4. Confirm the dialog by clicking on the OK button.
    The configuration dialog for the selected driver is opened.

Driver name already exists

If there is already a driver in the project, this is shown in a dialog. The warning dialog is closed by clicking on the OK button. The driver can be named correctly.

<CD_PRODUCNTAME> project

The following drivers are created automatically for newly-created projects:

  • Intern
  • MathDr32
  • SysDrv

info Information

Only the required drivers need to be present in a zenon project. Drivers can be added at a later time if required.


Settings in the driver dialog

3S_V3 -> Configuration -> Settings in the driver dialog

You can change the following settings of the driver:

Other topics in this chapter

General

Settings

Information


General

3S_V3 -> Configuration -> Settings in the driver dialog -> General

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

The configuration dialog is opened when a driver is created. In order to be able to open the dialog later for editing, double click on the driver in the list or click on the Configuration property.

Parameters

Description

Mode

Allows to switch between hardware mode and simulation mode

  • Hardware:

    A connection to the control is established.

  • Simulation static

    No communication between to the control is established, the values are simulated by the driver. In this modus the values remain constant or the variables keep the values which were set by zenon Logic. Each variable has its own memory area. E.g. two variables of the type marker with offset 79 can have different values in the Runtime and do not influence each other. Exception: The simulator driver.

  • Simulation - counting

    No communication between to the control is established, the values are simulated by the driver. In this modus the driver increments the values within a value range automatically.

  • Simulation - programmed

    N communication is established to the PLC. The values are calculated by a freely programmable simulation project. The simulation project is created with the help of the zenon Logic Workbench and runs in a zenon Logic Runtime which is integrated in the driver. For details see chapter Driver simulation.

Keep update list in the memory

Variables which were requested once are still requested from the control even if they are currently not needed.
This has the advantage that e.g. multiple screen switches after the screen was opened for the first time are executed faster because the variables need not be requested again. The disadvantage is a higher load for the communication to the control.

Output can be written

Active: Outputs can be written.

Inactive: Writing of outputs is prevented.

Note: Not available for every driver.

Variable image remanent

This option saves and restores the current value, time stamp and the states of a data point.

Fundamental requirement: The variable must have a valid value and time stamp.

The variable image is saved in mode hardware if:

  • one of the states S_MERKER_1(0) up to S_MERKER8(7), REVISION(9), AUS(20) or ERSATZWERT(27) is active

The variable image is always saved if:

  • the variable is of the object type Driver variable
  • the driver runs in simulation mode. (not programmed simulation)

The following states are not restored at the start of the Runtime:

  • SELECT(8)
  • WR-ACK(40)
  • WR-SUC(41)

The mode Simulation - programmed at the driver start is not a criterion in order to restore the remanent variable image.

Stop on Standby Server

Setting for redundancy at drivers which allow only on communication connection. For this the driver is stopped at the Standby Server and only started at the upgrade.

Attention: If this option is active, the gapless archiving is no longer guaranteed.

Active: Sets the driver at the not-process-leading Server automatically in a stop-like state. In contrast to stopping via driver command, the variable does not receive status switched off but an empty value. This prevents that at the upgrade to the Server irrelevant values are created in the AML, CEL and Historian.

Note: Not available if the CE terminal serves as a data server. You can find further information in the zenon Operator manual in the CE terminal as a data server chapter.

Global Update time

Active: The set Global update time in ms is used for all variables in the project. The priority set at the variables is not used.
Inactive: The set priorities are used for the individual variables.

Priority

The polling times for the individual priority classes are set here. All variables with the according priority are polled in the set time.

The variables are allocated separately in the settings of the variable properties.
The communication of the individual variables can be graded according to importance or required topicality using the priority classes. Thus the communication load is distributed better.

Attention: Priority classes are not supported by each driver For example, drivers that communicate spontaneously do not support it.

Close dialog

Options | Description
OK | Applies all changes in all tabs and closes the dialog.
Cancel | Discards all changes in all tabs and closes the dialog.
Help | Opens online help.

Update time for cyclical drivers

The following applies for cyclical drivers:

For Set value, Advising of variables and Requests, a read cycle is immediately triggered for all drivers - regardless of the set update time. This ensures that the value is immediately available for visualization after writing. Update times can therefore be shorter than pre-set for cyclical drivers.


Settings

3S_V3 -> Configuration -> Settings in the driver dialog -> Settings

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

You configure the following in the settings tab:

  • The type of symbolic addressing of the variables
  • Origin of the time stamp
  • Connection to the PLC

Parameters

Description

Symbolic addressing via

Options field to select which source is used for the symbolic addressing of the variables:

  • Variable identification
    Symbolic addressing of variables is carried out using the variable identification.
  • Symbolic addressing
    Symbolic addressing of the variables is carried out using the symbolic address.

Note: This selection can be made from zenon version 7.10 onwards.

The variable identification is always used up to and including version 7.00. In this case, the options variable identification and symbolic address are not displayed.

Time stamp of

Options field to select how the time stamp of new variable values is determined:

  • PLC:
    Time stamp of the controller is used
  • Driver:
    Time stamp of the driver is used

controls

The connections are configured by clicking on the New button in the dialog to configure a connection. Existing connection configurations can be amended by selecting them and clicking on the Edit button.

Parameters

Description

controls

List of configured connections.

  • Net address:
    Net address of the connection, as configured for the connection. The network address must be unique.
  • Connection name:
    Name of the connection, as configured for the connection. This connection name corresponds to the configured node address in the dialog to configure a connection.

The width of the columns in the list can be amended by holding down the mouse button and clicking on the column edge.

New

Opens the dialog for configuring a connection.

Edit

Opens the dialog for the selected connection to configure a connection.

Delete

Deletes the selected connection after a confirmation message.

Close dialog

Parameters | Description
OK | Applies all changes in all tabs and closes the dialog.
Cancel | Discards all changes in all tabs and closes the dialog.
Help | Opens online help.

Confirmation request when deleting a connection

If a controller is selected for deletion, a request for confirmation is shown before deletion.

Parameters | Description
Yes | The connection is removed from the list of configured connections (controllers).
No | The connection is not deleted and remains in the list of configured connections. The dialog is closed.

Other topics in this chapter

Connection


Connection

3S_V3 -> Configuration -> Settings in the driver dialog -> Settings -> Connection

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

Configuration of the connection to a controller.

Parameters

Description

Net address

Entry of the net address.
The net address must be unique and must not be used twice. If a net address has already been issued, this is shown by a notice dialog.

The entry is checked after clicking on the button OK. In case of failure, a warning dialog pops up.

Attention: If a numerical figure outside the value range is entered, the net address is configured with the value -1.

Default: The lowest net address that has not yet been issued is preset as a default.

This net address corresponds to the zenon Net address property.

Alias

An alias can be entered for each connection. This serves as a prefix for the names of the variables that are imported from the driver.

If this alias is empty, the node address is used as a prefix.

Maximum length: 8 characters

Note: Entry of more than 8 characters is not possible.

Connection type

Selection of the connection type from drop-down list:

  • Gateway:
    The communication to the PLC is by means of a gateway to the local or a remote computer
    You can find further configuration possibilities for the gateway connection type in the Gateway configuration group.
  • ARTI:
    Direct communication to the PLC by means of the local network card (peer-to-peer connection)

Default: Gateway

Version

Selection of the version to be used from a drop-down list:

  • V3
  • V2.3
    You can find further configuration possibilities for the use of V2.3 in the V2.3 PLC configuration configuration group.

Default: V3

Node address

Node address or node name of the controller.

Entry of node address or node name in the field or select from a drop-down list. Clicking on the ... button opens the dialog to select a PLC.

Attention: This search for a controller is not available for the V2.3 communication. The search through the network is not possible with V2.3.

When opened, a search for controllers in the network that can be contacted using the selected connection type is carried out. If the search for a controller is not possible, because the project computer and controller are in different networks, the address must be entered manually.

Node address and node name

  • The node address can be different for different connection types. However it is always unique for the selected connection type.
    Note: A controller may get a new node address after a restart, because the original address is issued.
  • The node name is not unique There can be several controllers on one device for example. These can then only be identified via the node address.

V2.3 PLC configuration

Configurations for communication with the 3S V3 driver to a PLC with V 2.3 software.

If Version V3 is selected in the property, the properties of the V2.3 PLC configuration are grayed out.

Parameters

Description

Transport

Drop-down list for the selection of the communication protocol.

  • TCP L4
  • TCP L2 Route
  • TCP L2
  • TCP L2ABB
    Note: Only supports ABB controllers. For the configuration, GDrvABBTcpIpL2X.dll must be present on the system and in the same folder as Gateway.exe. The DLL must be obtained from the manufacturer, ABB, directly. For further notes, see also the checklist.

Default: TCP L4

Port

Communication port number.

Default: 5000

The entry is checked after clicking on the button OK. In case of failure, a warning dialog pops up.

Target ID

Unique ID of the target device.

Default: 0

The entry is checked after clicking on the button OK. In case of failure, a warning dialog pops up.

TCP L2 Buffer Size

Buffer size of the TCP L2 protocol.

Is only used for the TCP L2 communication protocols. This property has no effect on TCP L4.

Default: 1500

The entry is checked after clicking on the button OK. In case of failure, a warning dialog pops up.

Motorola Byte Order

Byte sequence for the receiving or sending of data

  • Activated:
    Data is processed in Big-Endian (Motorola) format.
  • Not activated:
    Data is processed in Little-Endian (Intel) format.

Gateway

Configuration of the connection to the Gateway.

If the ARTI connection type property has been selected, the properties of the gateway configuration have been grayed out.

Parameters

Description

Connection

Selection of the connection type from the PLC handler to the gateway via a drop-down list:

  • TCP/IP:
    TCP/IP connection
  • Shared Memory:
    Use of the shared memory on the local computer

Default: TCP/IP

Address

Input field for the address of the gateway.

The address can be configured as both numerical (192.168.1.1) and alphanumerical (e.g.: localhost).

A check to see if the input is valid is not carried out.

Note: Only available if TCP/IP is configured as a connection.

Password

Password of the gateway (optional).

Note: Only available if TCP/IP is configured as a connection.

Port

Port of the gateway.

Note: Only available if TCP/IP is configured as a connection.
Default: 1217

Close dialog

Parameters | Description
OK | Applies settings and closes the dialog.
Cancel | Discards all changes and closes the dialog.

Warning dialog in the event of incorrect input

Net address already present:

Is an invalid entry projected (such as letters), it will also be shown in a warning dialog.

Other topics in this chapter

Search for controller in the network


Search for controller in the network

3S_V3 -> Configuration -> Settings in the driver dialog -> Settings -> Connection -> Search for controller in the network

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

Clicking on the Node address button opens the dialog to select a controller. A search for controllers is carried out on opening. Controllers that have been found are offered for selection.

Parameters | Description
List of controllers | Lists all controllers that have been found. With a connection via gateway, the address configured in the connection is shown as a main node.
OK | Accepts the selected controller and closes the dialog.
Cancel | Discards selection and closes the dialog.
Refresh | Searches for controllers again.

Searching the network

The searching of a network can - depending on the design and size of network - take some time. A dialog with a progress bar is visualized during this time.


Information

3S_V3 -> Configuration -> Settings in the driver dialog -> Information

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

Information on the versions of:

  • PLC-Handler
  • Drivers


Creating variables

3S_V3 -> Creating variables

This is how you can create variables in the zenon Editor:

Other topics in this chapter

Creating variables in the Editor

Addressing

Driver objects and datatypes

Creating variables by importing

Driver variables


Creating variables in the Editor

3S_V3 -> Creating variables -> Creating variables in the Editor

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

Variables can be created:

  • as simple variables
  • in arrays
  • as structure variables

Variable dialog

To create a new variable, regardless of which type:

  1. Select the New variable command in the Variables node in the context menu

  2. The dialog for configuring variables is opened
  3. configure the variable
  4. The settings that are possible depends on the type of variables

Property

Description

Name

Distinct name of the variable. If a variable with the same name already exists in the project, no additional variable can be created with this name.

Maximum length: 128 characters

Attention: The characters # and @ are not permitted in variable names. If non-permitted characters are used, creation of variables cannot be completed and the Finish button remains inactive.
Note: For some drivers, the addressing is possible over the property Symbolic address, as well.

Drivers

Select the desired driver from the drop-down list.

Note: If no driver has been opened in the project, the driver for internal variables (Intern.exe) is automatically loaded.

Driver Object Type

Select the appropriate driver object type from the drop-down list.

Data Type

Select the desired data type. Click on the ... button to open the selection dialog.

Array settings

Expanded settings for array variables. You can find details in the Arrays chapter.

Addressing options

Expanded settings for arrays and structure variables. You can find details in the respective section.

Automatic element activation

Expanded settings for arrays and structure variables. You can find details in the respective section.

Symbolic address

The Symbolic address property can be used for addressing as an alternative to the Name or Identification of the variables. Selection is made in the driver dialog; configuration is carried out in the variable property. When importing variables of supported drivers, the property is entered automatically.

Maximum length: 1024 characters.

Inheritance from data type

Measuring range, Signal range and Set value are always:

  • derived from the datatype
  • Automatically adapted if the data type is changed

Note for signal range: If a change is made to a data type that does not support the set signal range, the signal range is amended automatically. For example, for a change from INT to SINT, the signal range is changed to 127. The amendment is also carried out if the signal range was not inherited from the data type. In this case, the measuring range must be adapted manually.


Addressing

3S_V3 -> Creating variables -> Addressing

Group/Property

Description

General

Property group for general settings.

Name

Freely definable name.

Attention: For every zenon project the name must be unambiguous.

Identification
  • Up to zenon Version 7.00: Symbolic address
  • From version 7.10 on: Either the Symbolic address or a freely-selectable identification, for example for a resource label, comments...

Addressing

Property group for addressing

Net address

Network address of variables.

This address refers to the bus address in the connection configuration of the driver. This defines the PLC, on which the variable resides.

Data block

not used for this driver

Offset

not used for this driver

Alignment

not used for this driver

Bit number

not used for this driver

String length

Only available for String variables.
Maximum number of characters that the variable can take.

Symbolic address

From version 7.10 on: Optional Symbolic address.

Driver connection/Driver Object Type

Object type of the variables. Depending on the driver used, is selected when the variable is created and can be changed here.

Driver connection/Data Type

Data type of the variable. Is selected during the creation of the variable; the type can be changed here.

Attention: If you change the data type later, all other properties of the variable must be checked and adjusted, if necessary.

Driver connection/Priority

Setting the priority class. The variable of the priority class is thus assigned as it was configured in the driver dialog in the General tab. The priority classes are only used if the global update time is deactivated.

If the global update time option is activated and the priority classes are used, there is an error entry in the log file of the system. The driver uses the highest possible priority.

Block arrays

Block arrays can be read, written and imported. The symbol name without indexes is used. The # character is not permitted.
Example: MAIN.MyArray.

The number of indexes must correspond to that in the PLC.
Example: For MyArray: ARRAY [0..99] OF INT;

Note: In the variable properties of zenon, the Block array size property in the Additional settings group must be set to the value 100.

attention Attention

Note: In zenon, counting is started with 0, but with 1 in the PLC.


Driver objects and datatypes

3S_V3 -> Creating variables -> Driver objects and datatypes

Driver objects are areas available in the PLC, such as markers, data blocks etc. Here you can find out which driver objects are provided by the driver and which IEC data types can be assigned to the respective driver objects.

Other topics in this chapter

Driver objects

Mapping of the data types


Driver objects

3S_V3 -> Creating variables -> Driver objects and datatypes -> Driver objects

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

The following object types are available in this driver:

Driver object type | Channel type | Read | Write | Supported data types | Description
Alarm Event | 64 | X | X | INT | Used for Exception Handling
Alarm Variable | 65 | X | -- | BOOL, DINT, STRING, UDINT | Used for Exception Handling
PLC marker | 8 | X | X | BOOL, USINT, SINT, BYTE, UINT, WORD, INT, UDINT, DWORD, DINT, ULINT, LINT, LWORD, REAL, LREAL, STRING, WSTRING, DT, TOD, DATE, TIME |
Status Feedback | 66 | X | -- | DINT | Used for Exception Handling
Driver variable | 35 | X | X | BOOL, SINT, USINT, INT, UINT, DINT, UDINT, REAL, STRING | Variable for the static analysis of the communication; is transferred between driver and Runtime (not to the PLC). Note: The addressing and the behavior is the same for most zenon drivers. Find out more in the chapter about the Driver variables


Mapping of the data types

3S_V3 -> Creating variables -> Driver objects and datatypes -> Mapping of the data types

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

All variables in zenon are derived from IEC data types. The following table compares the IEC datatypes with the datatypes of the PLC.

Control | zenon | Data type
BIT, BOOL | BOOL | 8
USINT | USINT | 9
BYTE | BYTE | 22
SINT | SINT | 10
WORD | WORD | 23
UINT, UINT16 | UINT | 2
INT, INT16, ENUM | INT | 1
UDINT | UDINT | 4
DINT | DINT | 3
ULINT | ULINT | 27
DWORD | DWORD | 24
LINT | LINT | 26
REAL | REAL | 5
LREAL | LREAL | 6
STRING | STRING | 12
WSTRING | WSTRING | 21
DATE | DATE | 18
TIME | TIME | 17
DT, DATE_AND_TIME | DT | 20
TOD, TIME_OF_DAY | TOD (Time of Day) | 19

Data type: The property Data type is the internal numerical name of the data type. It is also used for the extended DBF import/export of the variables.


Creating variables by importing

3S_V3 -> Creating variables -> Creating variables by importing

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

Variables can also be imported by importing them. The XML and DBF import is available for every driver.

info Information

You can find details on the import and export of variables in the Import-Export manual in the Variables section.

Other topics in this chapter

XML import

DBF Import/Export

Online- and Offline-Import


XML import

3S_V3 -> Creating variables -> Creating variables by importing -> XML import

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

When importing variables or datatypes they are analyzed by zenon according to the Driver allocation. The user can subsequently decide what to do with the according variables / datatypes:

  • import
  • overwrite
  • do not import

Only reasonable actions are offered.

The following conflicts prevent the import:

  • The data type already exists and the linked variable cannot be converted to the data type you want to import.
  • The data type is complex and the elements of the existing one differ from the elements of the one to be imported in number or name.
  • The data type is complex and contains the same elements, but the elements differ in their data types, so that a conversion of the linked variables is not possible.
  • The variable type cannot imported (see above).
  • The variable type differs from the existing one (simple/complex).
  • The driver assignment for the variable is incorrect (the assigned driver does not support the according datatype and/ot the respective area).

TAGs

Description

Elements to be imported

Lists all variables and data types that are to be imported. For complex variables, the according simple variables are shown. Structured types can be expanded, the elements of structure datatypes are displayed for information purposes.

Symbols show if the element can be imported (green check mark), cannot be imported (red X) or if a conflict must be solved (blue symbol).

Import details:

Describes import status and offers solutions for conflict resolution.

Description

Describes the element status.

Available actions

Describes the available actions.

Action

Drop-down list with the available actions and the currently selected action. If only one action is possible, it is preselected and cannot be changed.

Import new data type / variable

The variable / data type does not exist yet. It is created by the import. (Default)

Cannot be changed by the user.

Do not import data type/variable

The variable/data type already exists, there are conflicts.

Cannot be changed by the user.

Import data type/variable

The variable/data type already exists, there are no conflicts.

The user can decide whether the variable/data type should be overwritten or not imported. Per default, the variable/data type is overwritten.

Limitations

  • Consistency

    The XML file to be imported has to be consistent. There is no plausibility check on importing the file. If there are errors in the import file, this can lead to undesirable effects in the project, and even crashes.

    You particularly have to care for this, if not all properties exist in the XML file and thus are filled with default values. For example: A binary variable has a limit of 300.

  • Backward compatibility

    At the XML import/export there is no backward compatibility. Data from older zenon versions cannot be taken over. The handover of data from newer to older versions is not supported.

  • Structure data types

    Structure data types must have the same number of structure elements. If, for example, a structure data type in the project has three structure elements, a data type with the same name in the XML file but four structure elements, none of the variables based on this data type from the export file are imported into the project.

Tipp Hint

You can find further information on XML import in the Import - Export manual, in the XML import chapter.


DBF Import/Export

3S_V3 -> Creating variables -> Creating variables by importing -> DBF Import/Export

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

Data can be exported to and imported from dBase.

info Information

Import and Export via CSV or dBase supported; no driver specific variable settings, such as formulas. Use export/import via XML for this.

Import DBF file

To start the import:

  1. right-click on the variable list
  2. in the drop-down list of Extended export/import... select the Import dBase command
  3. follow the import assistant

The format of the file is described in the chapter File structure.

info Information

Note:

  • Driver object type and data type must be amended to the target driver in the DBF file in order for variables to be imported.
  • dBase does not support structures or arrays (complex variables) at import.

Export DBF file

To start the export:

  1. right-click on the variable list
  2. in the drop-down list of Extended export/import... select the Export dBase... command
  3. follow the export assistant

attention Attention

DBF files:

  • must correspond to the 8.3 DOS format for filenames (8 alphanumeric characters for name, 3 character suffix, no spaces)
  • must not have dots (.) in the path name.
    e.g. the path C:\users\John.Smith\test.dbf is invalid.
    Valid: C:\users\JohnSmith\test.dbf
  • must be stored close to the root directory in order to fulfill the limit for file name length including path: maximum 255 characters

The format of the file is described in the chapter File structure.

info Information

dBase does not support structures or arrays (complex variables) at export.

File structure of the dBase export file

The dBaseIV file must have the following structure and contents for variable import and export:

attention Attention

dBase does not support structures or arrays (complex variables) at export.

DBF files must:

  • conform with their name to the 8.3 DOS format (8 alphanumeric characters for name, 3 characters for extension, no space)
  • Be stored close to the root directory (Root)

Structure

Identification | Type | Field size | Comment
KANALNAME | Char | 128 | Variable name. The length can be limited using the MAX_LAENGE entry in project.ini.
KANAL_R | C | 128 | The original name of a variable that is to be replaced by the new name entered under "VARIABLENNAME" (field/column must be entered manually). The length can be limited using the MAX_LAENGE entry in project.ini.
KANAL_D | Log | 1 | The variable is deleted with the 1 entry (field/column has to be created by hand).
TAGNR | C | 128 | Identification. The length can be limited using the MAX_LAENGE entry in project.ini.
EINHEIT | C | 11 | Technical unit
DATENART | C | 3 | Data type (e.g. bit, byte, word, ...) corresponds to the data type.
KANALTYP | C | 3 | Memory area in the PLC (e.g. marker area, data area, ...) corresponds to the driver object type.
HWKANAL | Num | 3 | Net address
BAUSTEIN | N | 3 | Datablock address (only for variables from the data area of the PLC)
ADRESSE | N | 5 | Offset
BITADR | N | 2 | For bit variables: bit address For byte variables: 0=lower, 8=higher byte For string variables: Length of string (max. 63 characters)
ARRAYSIZE | N | 16 | Number of variables in the array for index variables ATTENTION: Only the first variable is fully available. All others are only available for VBA or the Recipegroup Manager
LES_SCHR | L | 1 | Write-Read-Authorization 0: Not allowed to set value. 1: Allowed to set value.
MIT_ZEIT | R | 1 | time stamp in zenon (only if supported by the driver)
OBJEKT | N | 2 | Driver-specific ID number of the primitive object comprises TREIBER-OBJEKTTYP and DATENTYP
SIGMIN | Float | 16 | Non-linearized signal - minimum (signal resolution)
SIGMAX | F | 16 | Non-linearized signal - maximum (signal resolution)
ANZMIN | F | 16 | Technical value - minimum (measuring range)
ANZMAX | F | 16 | Technical value - maximum (measuring range)
ANZKOMMA | N | 1 | Number of decimal places for the display of the values (measuring range)
UPDATERATE | F | 19 | Update rate for mathematics variables (in sec, one decimal possible) not used for all other variables
MEMTIEFE | N | 7 | Only for compatibility reasons
HDRATE | F | 19 | HD update rate for historical values (in sec, one decimal possible)
HDTIEFE | N | 7 | HD entry depth for historical values (number)
NACHSORT | R | 1 | HD data as postsorted values
DRRATE | F | 19 | Updating to the output (for zenon DDE server, in [s], one decimal possible)
HYST_PLUS | F | 16 | Positive hysteresis, from measuring range
HYST_MINUS | F | 16 | Negative hysteresis, from measuring range
PRIOR | N | 16 | Priority of the variable
REAMATRIZE | C | 32 | Allocated reaction matrix
ERSATZWERT | F | 16 | Substitute value, from measuring range
SOLLMIN | F | 16 | Minimum for set value actions, from measuring range
SOLLMAX | F | 16 | Maximum for set value actions, from measuring range
VOMSTANDBY | R | 1 | Get value from standby server; the value of the variable is not requested from the server but from the Standby Server in redundant networks
RESOURCE | C | 128 | Resources label. Free string for export and display in lists. The length can be limited using the MAX_LAENGE entry in project.ini.
ADJWVBA | R | 1 | Non-linear value adaption: 0: Non-linear value adaption is used 1: Non-linear value adaption is not used
ADJZENON | C | 128 | Linked VBA macro for reading the variable value for non-linear value adjustment.
ADJWVBA | C | 128 | ed VBA macro for writing the variable value for non-linear value adjustment.
ZWREMA | N | 16 | Linked counter REMA.
MAXGRAD | N | 16 | Gradient overflow for counter REMA.
attention Attention
When importing, the driver object type and data type must be amended to the target driver in the DBF file in order for variables to be imported.

Limit value definition

Limit definition for limit values 1 to 4, or status 1 to 4:

Identification | Type | Field size | Comment
AKTIV1 | R | 1 | Limit value active (per limit value available)
GRENZWERT1 | F | 20 | technical value or ID number of a linked variable for a dynamic limit value (see VARIABLEx) (if VARIABLEx is 1 and here it is -1, the existing variable linkage is not overwritten)
SCHWWERT1 | F | 16 | Threshold value for limit value
HYSTERESE1 | F | 14 | Is not used
BLINKEN1 | R | 1 | Set blink attribute
BTB1 | R | 1 | Logging in CEL
ALARM1 | R | 1 | Alarm
DRUCKEN1 | R | 1 | Printer output (for CEL or Alarm)
QUITTIER1 | R | 1 | Must be acknowledged
LOESCHE1 | R | 1 | Must be deleted
VARIABLE1 | R | 1 | Dyn. limit value linking the limit is defined by an absolute value (see field GRENZWERTx).
FUNC1 | R | 1 | Functions linking
ASK_FUNC1 | R | 1 | Execution via Alarm Message List
FUNC_NR1 | N | 10 | ID number of the linked function (if “-1” is entered here, the existing function is not overwritten during import)
A_GRUPPE1 | N | 10 | Alarm/event group
A_KLASSE1 | N | 10 | Alarm/event class
MIN_MAX1 | C | 3 | Minimum, Maximum
FARBE1 | N | 10 | Color as Windows coding
GRENZTXT1 | C | 66 | Limit value text
A_DELAY1 | N | 10 | Time delay
INVISIBLE1 | R | 1 | Invisible

Expressions in the column "Comment" refer to the expressions used in the dialog boxes for the definition of variables. For more information, see chapter Variable definition.


Online- and Offline-Import

3S_V3 -> Creating variables -> Creating variables by importing -> Online- and Offline-Import

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

The import of variables from symbolic variable names can be selected as either online from the controller or offline via a symbol file.

Requirements for the import

In order for variable import to work, the variables used in the zenon project must be selected in the CoDeSys project configuration software using a symbol configuration object and transferred to the controller. During this process, a symbol file is created in XML format at the same time, which can be used for offline variable import.

Depending on the settings for whether the VariableIdentification or the Symbolic address is to be used for addressing, the symbolic name is entered in the corresponding property.

Variable name

The imported symbolic name with a prefix is entered as a variable name.

This prefix is:

  • An alias of the configured connection
  • The node address of the configured connection if no alias has been configured.

Note: You create this configuration in the driver dialog to create a new connection.

It is thus guaranteed that the variable name also remains unique if there are the same symbol names in different controllers. The variable name can therefore not be used for symbolic addressing.

ENUM data type - import from XML symbol file

The following is applicable for the import of ENUM data types from an XML symbol file:

  • If typeclass=ENUM is defined for a symbol type and a basetype is given for this, the variable is created in zenon with this basetype.
  • If no basetype is given, the INT data type is used for the variable in zenon.

Other topics in this chapter

Importing variables with the wizard

Online- and Offline-Import


Importing variables with the wizard

3S_V3 -> Creating variables -> Creating variables by importing -> Online- and Offline-Import -> Importing variables with the wizard

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

To import variables from the PLC directly:

  1. select Import variables from driver from the context menu of the driver
    The import wizard is opened.
  2. In the dialog, select the import source:
    • PLC:
      The variables are imported from the PLC directly.
    • XML symbol file
      The variables are imported from an XML file.
  3. click on Next.
  4. Select the controller and, for offline import, the XML file.
    The list of controllers corresponds to the configuration of the driver configuration (as configured in connection).
  5. click on Next.
  6. configure the filter settings.
    You can find further information on this in the description of the filter dialog.
  7. Click on Finish.
    The selection list is displayed
  8. Select the variables to be imported.
  9. Click on OK.

The variables are imported If an error occurs, a corresponding message is displayed.


Online- and Offline-Import

3S_V3 -> Creating variables -> Creating variables by importing -> Online- and Offline-Import -> Online- and Offline-Import

Previous chapter Next chapter Show all Show all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. E-Mail: documentation@copadata.com

You select the desired options during the import process with the import wizard.

Selecting the import source

You select the import source for the variable import in this dialog.

Parameters

Description

Import variables from

Option field to select the import source:

  • PLC:
    Variables are always imported from a controller.
  • XML symbol file:
    Variables are imported from an XML file created with the CoDeSys software.

Next

Accepts setting and switches to the next window.

Cancel

Cancels the import. No variables are imported.

Help

Opens online help.

Source of XML file: Selection of the XML file and the controller

In this dialog, you select the source of the variables to be imported. The file is also given when importing from an XML symbol file.

Parameters | Description
Symbol file | Selection of the symbol file. Only present if XML symbol file has been selected as a source when selecting the import source.
PLC | Selection of the controller, if variables are imported, from a list. The list of controllers corresponds to the configuration of the driver configuration (as configured in connection).
Back | Switches to the previous window.
Next | Accepts setting and switches to the next window. Note: If no connection is configured or selected, it is not possible to switch to the next window.
Cancel | Cancels the import. No variables are imported.
Help | Opens online help.

Configuration of the filter

When importing a variable, the variables to be imported can be filtered.

Either all existing or only new variables are offered for selection. In addition, variables that are no longer needed can be searched for and deleted.

Parameters

Description

Symbol name

Entry of the symbol name as a filter criteria.

The name can be entered with the following parameters:

  • *
  • ?

Default: *
Selects all symbol names, no prefiltering.

Data Type

Entry of a data type in the combobox or selection from a drop-down list.

The following placeholders can be used for input:

  • *
  • ?

Default: *

Selects all data types, no prefiltering.

Prefilter

Option field to prefilter the displayed variables in the subsequent dialog (variable selection dialog):

  • Import all matched symbols
    Offers all symbols that correspond to the filter for import.
  • Import only new symbols
    Offers only symbols that are not yet present in the zenon project for import.
  • Delete old symbols
    Offers all symbols that exist in the zenon project that do not exist in the controller for deletion.

Back

Switches to the previous window.

Finish

Applies setting and opens the variable selection dialog.

Cancel

Cancels the import. No variables are imported.

Help

Opens online help.

Variable selection dialog

Parameters

Description

List of variables that can be imported

Displays all variables that can be imported or deleted depending on the settings in the wizard.

  • Name
    Name of the variable as defined in the controller or in the XML symbol file.
  • Type
    Type of variable as defined in the controller or in the XML symbol file.
  • Access

The list can be sorted and filtered.

List of variables to be imported

Displays all variables that are selected for import or deletion.

Add

Adds the variables highlighted in the Importable variables list to the Variables to be imported list. Multiple selection from the list is possible.

Remove

Deletes highlighted variables from the Variables to be imported list. Multiple selection from the list is possible.

OK

Accepts selection and imports or deletes variables.

Cancel

Cancels the import and closes the wizard. No variables are imported.


Driver variables

3S_V3 -> Creating variables -> Driver variables

The driver kit implements a number of driver variables. These are divided into:

  • Information
  • Configuration
  • Statistics and
  • Error message

The definitions of the variables implemented in the driver kit are available in the import file drvvar.dbf (on the installation medium in the \Predefined\Variables folder) and can be imported from there.

Note: Variable names must be unique in zenon. If driver variables are to be imported from drvvar.dbf again, the variables that were imported beforehand must be renamed.

info Information

Not every driver supports all driver variants.

For example:

  • Variables for modem information are only supported by modem-compatible drivers
  • Driver variables for the polling cycle only for pure polling drivers
  • Connection-related information such as ErrorMSG only for drivers that only edit one connection at a a time

Information

Name from import | Type | Offset | Description
MainVersion | UINT | 0 | Main version number of the driver.
SubVersion | UINT | 1 | Sub version number of the driver.
BuildVersion | UINT | 29 | Build version number of the driver.
RTMajor | UINT | 49 | zenon main version number
RTMinor | UINT | 50 | zenon sub version number
RTSp | UINT | 51 | zenon Service Pack number
RTBuild | UINT | 52 | zenon build number
LineStateIdle | BOOL | 24.0 | TRUE, if the modem connection is idle
LineStateOffering | BOOL | 24.1 | TRUE, if a call is received
LineStateAccepted | BOOL | 24.2 | The call is accepted
LineStateDialtone | BOOL | 24.3 | Dialtone recognized
LineStateDialing | BOOL | 24.4 | Dialing active
LineStateRingBack | BOOL | 24.5 | While establishing the connection
LineStateBusy | BOOL | 24.6 | Target station is busy
LineStateSpecialInfo | BOOL | 24.7 | Special status information received
LineStateConnected | BOOL | 24.8 | Connection established
LineStateProceeding | BOOL | 24.9 | Dialing completed
LineStateOnHold | BOOL | 24.10 | Connection in hold
LineStateConferenced | BOOL | 24.11 | Connection in conference mode.
LineStateOnHoldPendConf | BOOL | 24.12 | Connection in hold for conference
LineStateOnHoldPendTransfer | BOOL | 24.13 | Connection in hold for transfer
LineStateDisconnected | BOOL | 24.14 | Connection terminated.
LineStateUnknow | BOOL | 24.15 | Connection status unknown
ModemStatus | UDINT | 24 | Current modem status
TreiberStop | BOOL | 28 | Driver stopped For driver stop, the variable has the value TRUE and an OFF bit. After the driver has started, the variable has the value FALSE and no OFF bit.
SimulRTState | UDINT | 60 | Informs the status of Runtime for driver simulation.

Configuration

Name from import | Type | Offset | Description
ReconnectInRead | BOOL | 27 | If TRUE, the modem is automatically reconnected for reading
ApplyCom | BOOL | 36 | Apply changes in the settings of the serial interface. Writing to this variable immediately results in the method SrvDrvVarApplyCom being called (which currently has no further function).
ApplyModem | BOOL | 37 | Apply changes in the settings of the modem. Writing this variable immediately calls the method SrvDrvVarApplyModem. This closes the current connection and opens a new one according to the settings PhoneNumberSet and ModemHwAdrSet.
PhoneNumberSet | STRING | 38 | Telephone number, that should be used
ModemHwAdrSet | DINT | 39 | Hardware address for the telephone number
GlobalUpdate | UDINT | 3 | Update time in milliseconds (ms).
BGlobalUpdaten | BOOL | 4 | TRUE, if update time is global
TreiberSimul | BOOL | 5 | TRUE, if driver in sin simulation mode
TreiberProzab | BOOL | 6 | TRUE, if the variables update list should be kept in the memory
ModemActive | BOOL | 7 | TRUE, if the modem is active for the driver
Device | STRING | 8 | Name of the serial interface or name of the modem
ComPort | UINT | 9 | Number of the serial interface.
Baudrate | UDINT | 10 | Baud rate of the serial interface.
Parity | SINT | 11 | Parity of the serial interface
ByteSize | USINT | 14 | Number of bits per character of the serial interface Value = 0 if the driver cannot establish any serial connection.
StopBit | USINT | 13 | Number of stop bits of the serial interface.
Autoconnect | BOOL | 16 | TRUE, if the modem connection should be established automatically for reading/writing
PhoneNumber | STRING | 17 | Current telephone number
ModemHwAdr | DINT | 21 | Hardware address of current telephone number
RxIdleTime | UINT | 18 | Modem is disconnected, if no data transfer occurs for this time in seconds (s)
WriteTimeout | UDINT | 19 | Maximum write duration for a modem connection in milliseconds (ms).
RingCountSet | UDINT | 20 | Number of ringing tones before a call is accepted
ReCallIdleTime | UINT | 53 | Waiting time between calls in seconds (s).
ConnectTimeout | UINT | 54 | Time in seconds (s) to establish a connection.

Statistics

Name from import | Type | Offset | Description
MaxWriteTime | UDINT | 31 | The longest time in milliseconds (ms) that is required for writing.
MinWriteTime | UDINT | 32 | The shortest time in milliseconds (ms) that is required for writing.
MaxBlkReadTime | UDINT | 40 | Longest time in milliseconds (ms) that is required to read a data block.
MinBlkReadTime | UDINT | 41 | Shortest time in milliseconds (ms) that is required to read a data block.
WriteErrorCount | UDINT | 33 | Number of writing errors
ReadSucceedCount | UDINT | 35 | Number of successful reading attempts
MaxCycleTime | UDINT | 22 | Longest time in milliseconds (ms) required to read all requested data.
MinCycleTime | UDINT | 23 | Shortest time in milliseconds (ms) required to read all requested data.
WriteCount | UDINT | 26 | Number of writing attempts
ReadErrorCount | UDINT | 34 | Number of reading errors
MaxUpdateTimeNormal | UDINT | 56 | Time since the last update of the priority group Normal in milliseconds (ms).
MaxUpdateTimeHigher | UDINT | 57 | Time since the last update of the priority group Higher in milliseconds (ms).
MaxUpdateTimeHigh | UDINT | 58 | Time since the last update of the priority group High in milliseconds (ms).
MaxUpdateTimeHighest | UDINT | 59 | Time since the last update of the priority group Highest in milliseconds (ms).
PokeFinish | BOOL | 55 | Goes to 1 for a query, if all current pokes were executed

Error message

Name from import | Type | Offset | Description
ErrorTimeDW | UDINT | 2 | Time (in seconds since 1.1.1970), when the last error occurred.
ErrorTimeS | STRING | 2 | Time (in seconds since 1.1.1970), when the last error occurred.
RdErrPrimObj | UDINT | 42 | Number of the PrimObject, when the last reading error occurred.
RdErrStationsName | STRING | 43 | Name of the station, when the last reading error occurred.
RdErrBlockCount | UINT | 44 | Number of blocks to read when the last reading error occurred.
RdErrHwAdresse | DINT | 45 | Hardware address when the last reading error occurred.
RdErrDatablockNo | UDINT | 46 | Block number when the last reading error occurred.
RdErrMarkerNo | UDINT | 47 | Marker number when the last reading error occurred.
RdErrSize | UDINT | 48 | Block size when the last reading error occurred.
DrvError | USINT | 25 | Error message as number
DrvErrorMsg | STRING | 30 | Error message as text
ErrorFile | STRING | 15 | Name of error log file


Driver-specific functions

3S_V3 -> Driver-specific functions

The driver supports the following functions:

Real-time capability

The driver is real-time capable.
In doing so, note:

  • The protocol only provides the time stamp with precision to the second.
  • The time of the SCADA system and PLC must be synchronized manually.

RDA

Problem

The RDA mechanism actually needs a coherent block from zenon in the controller, which can be addressed via an offset. RDA is therefore generally not possible for drivers with symbolic addressing.

Solution

The 3S_V3 driver uses a property of the PLC handler that makes it possible to read the whole binary data block of variables with complex types (structures, arrays) as a whole using the base name.

The driver determines the base name by separating the last dot (.) from the symbol name of the trigger variable and using the name it has obtained this way. The trigger variable must be the first element of a structure in order for this to work. The rest of the structure can be created as desired. When reading the overall structure, only the binary data that has been read in when creating the RDA data according to the zenon documentation needs to correspond.

Examples

RDA-Typ 3:

TYPE RDA_DATA_3 : (* Structure for RDA type 3 payload *)

STRUCT

Value : DINT; (* value

TimeStamp : ARRAY[0..7] OF BYTE; (* Time stamp (year, month, day, hour, minute, second, 1/100th second, reserve) *)

END_STRUCT

END_TYPE

TYPE RDA_3 : (* Structure for RDA type 3 *)

STRUCT

Trigger : DINT; (* trigger variable *)

Count : UDINT; (* Number of data sets *)

Cycle : UDINT; (* Cycle time in [ms] (only relevant for type 1 and 4) *)

RDA_Type : UDINT; (* RDA type, 1 - 4 *)

Oldest : UDINT; (* Index of the oldest value (placeholder for compatibility reasons, only relevant for type 1) *)

Data : ARRAY[0..19] OF RDA_DATA_3; (* Payload *)

END_STRUCT

END_TYPE

RDA-Typ 4:

TYPE RDA_4 : (* Structure for RDA type 4 *)

STRUCT

Trigger : DINT; (* trigger variable *)

Count : UDINT; (* Number of data sets *)

Cycle : UDINT; (* Cycle time in [ms] (only relevant for type 1 and 4 *)

RDA_Type : UDINT; (* RDA type, 1 - 4 *)

Oldest : UDINT; (* Index of the oldest value (placeholder for compatibility reasons, only relevant for type 1) *)

TimeStamp : ARRAY[0..7] OF BYTE; (* Time stamp of the first value (year, month, day, hour, minute, second, 1/100th second, reserve)) *)

Data : ARRAY[0..19] OF DINT; (* Payload *)

END_STRUCT

END_TYPE

If, for example, an RDA_4 type RDA_Test variable is created in the CoDeSys project, then a variable with the symbolic address RDA_Test.Trigger is created in zenon, and HD active and Updated values are set. If the variable changes value from 0 to 1, the .Trigger part of the symbol name RDA_Test.Trigger is cut off and RDA_Test is read in as a binary data block. The RDA processing is then carried out with this data block.

Exception handling

Error events can be reported to zenon by the controller with the help of exception handling and assigned to an alarm variable using an ID.

For the replacement of error events, several blocks in the following form are created - in an array for example:

TYPE ST_ISA_ALARM :

STRUCT

ID : DINT; // identification for error location and type

Value : DINT; // error value, code, ...

Message : STRING(80); // error message

TimeEvent.AlmDate : DATE; // date received (UTC)

TimeEvent.AlmTime : TIME_OF_DAY; // time received (UTC)

TimeAck.AlmDate : DATE; // date cleared (UTC)

TimeAck.AlmTime : TIME_OF_DAY; // time cleared (UTC)

AlarmState : USINT; // alarm status (received/cleared)

ComState : INT; // Handshake

END_STRUCT

END_TYPE

For this, the following applies:

  • The names of the structure fields can be issued freely.
  • The form of the structure (data types) must be retained.
    Otherwise the data of an event can only be read with errors or incompletely.

Procedure:

  • When an error occurs, the controller assigns any desired free block (handshake variable = 2) with the information on the event and then sets its handshake variable to 1. This signals to the driver that the block in question contains new data.
  • When switching the handshake variable to 1, the driver reads the complete block and assigns the content using the alarm variables established via the ID in zenon.
  • The symbol address of the block is determined from the symbol address of the handshake variables by cutting off the part after the last item.
    For example: Symbol address of the handshake variable is Alarm[8].ComState. This results in the symbol address of the block being Alarm[8].
  • The driver then sets the handshake variable to 2. This signals to the controller that the block is free again and can be used for new events.
  • If an error occurs during evaluation, the driver sets the handshake variable to the value 4 and thus signals the error status to the controller.
    Errors are, for example: no alarm variable linked to the ID, error when reading, etc.

Alarm status

The content of the AlarmState field determines whether the alarm is received or cleared. Regardless of this, the value and the time stamp (in UTC) of the attendant alarm variables are determined:

  • 0: Empty.
    No alarm, all other entries of the block are invalid.
  • 1: Alarm received.
    The alarm variable gets the value 1 and the time stamp from TimeEvent.AmlDate and TimeEvent.AmlTime.
  • 2: Alarm cleared:
    The alarm variable gets the value 0 and the time stamp from TimeAck.AmlDate and TimeAck.AmlTime.

Handshake

For the signaling of new events, a zenon variable with the object type Alarm Event must be created in the zenon project for the handshake variable of each event block. Handshake variables are distinguished from other variables in zenon using this object type.

In order for the mechanism to work, the handshake variables must be requested for the complete duration of zenon Runtime. This can be effected using the Permanently read variable property, for example.

The handshake variables can have the following values:

  • 0: Locked.
    The controller must not use the block for new events.
  • 1: Read requested.
    The controller has allocated the block with new values and is making a request to read the block.
  • 2: Read successful.
    The driver has read and evaluated the block successfully. The controller can use the block for new events again.
  • 4: Read error.
    If an error occurs hen evaluating the block, the driver sets the handshake variable to 4.

Alarm variables

Alarm variables are for displaying the events from the controller zenon as alarms. They are distinguished from other variables of the driver in zenon using the alarm variable. They are linked to an event in the controller using the ID. The ID denotes the location and type of error.

Up to four variables can be linked to each ID: A variable that is always requested with a limit value defined as an alarm as well as three further optional variables for further information about the alarm. These variables can then be used, for example, in dynamic limit value texts of the alarm variables.

For linking, the symbol addresses of the variables must follow a fixed format:

Address | Type | Mandatory | Description
Exception.<ID>.Alarm | BOOL or numerical | X | Signals the alarm using a limit value of 1 defined as an alarm. If this variable is not present or not requested, this is considered an error and the driver sets the handshake variable to the value 4.
Exception.<ID>.Value | Numerical | -- | Gets the value of the Value field of the event block and can, for example, be used to denote an error code
Exception.<ID>.Message | STRING | -- | Gets the value of the Message field of the event block and can take an error text
Exception.<ID>.Info | STRING | -- | Gets a summary of the event in the following format: <ID>;<Value>;<Message>;<AlarmState>;<ComState>;<TimeEvent>;<TimeAck> Example: 300010011;300010011;exception message1;2;1;2015-07-15T06:08:22,329+2.00;2015-07-15T06:08:38,829+2.00

Attention: Note upper-case/lower-case letters.

Examples for the symbol addresses of alarm variables (ID =300010011):

  • Exception.300010011.Alarm
  • Exception.300010011.Value
  • Exception.300010011.Message
  • Exception.300010011.Info

The names of the alarm variables can be issued freely.

Action when establishing a connection to the PLC

If the driver establishes a connection to the PLC, it attempts to determine the current status of the alarm events. To do this, it is not just alarm events whose Handshake variables have the value 1 (read requested) that are evaluated, but also those the with value 2 (read required). The alarm variables can thus be set to the status before closing the connection again. This action is applicable for the start of zenon Runtime as well as for the restoring after a connection has been lost.

Alarm variables for which there are no entries in the event array are set to an initial value (0 or empty string). As a result, pending alarms get the status of cleared.

Attention: For a correct evaluation, it is necessary that the received event and the cleared events of an alarm are always in the same event entry in the array.

Response to the PLC

Whilst the connection is being established, the PLC should prevent values changing in the event array.

To do this, create, for each connection to a PLC, a variable with the status feedback object type in zenon. This reports the current run-up status to the PLC. These variables can take the following values:

  • -1: Not Running
    Connection terminated.
    Before closing the connection properly (when closing Runtime), the status feedback variable is set to Not Running.
  • 0: Initial
    Connection reestablished, start of restart.
    The value only occurs when reestablishing the connection, not when starting Runtime. At this point in time, there are not yet any variables requested by Runtime, so there value can therefore not be set
  • 10: Starting
    During the request of variables at the PLC.
  • 100: Running
    Once the initial values have been received by the PLC.

The PLC should prevent new events whilst the status feedback variable has the value Starting.


Driver commands

3S_V3 -> Driver commands

This chapter describes standard functions that are valid for most zenon drivers. Not all functions described here are available for every driver. For example, a driver that does not, according to the data sheet, support a modem connection also does not have any modem functions.

Driver commands are used to influence drivers using zenon; start and stop for example.
The engineering is implemented with the help of function Driver commands. To do this:

  • create a new function
  • select Variables -> Driver commands
  • The dialog for configuration is opened

Parameter

Description

Drivers

Drop-down list with all drivers which are loaded in the project.

Current status

Fixed entry which has no function in the current version.

Driver command

Drop-down list for the selection of the command.
  • Start driver (online mode)

Driver is reinitialized and started.
  • Stop driver (offline mode)

Driver is stopped. No new data is accepted.

Note: If the driver is in offline mode, all variables that were created for this driver receive the status switched off (OFF; Bit 20).

  • Driver in simulation mode

Driver is set into simulation mode.
The values of all variables of the driver are simulated by the driver. No values from the connected hardware (e.g. PLC, bus system, ...) are displayed.
  • Driver in hardware mode

Driver is set into hardware mode.
For the variables of the driver the values from the connected hardware (e.g. PLC, bus system, ...) are displayed.
  • Driver-specific command

Enter driver-specific commands. Opens input field in order to enter a command.
  • Driver - activate set setpoint value

Write set value to a driver is allowed.
  • Driver - deactivate set setpoint value

Write set value to a driver is prohibited.
  • Establish connecton with modem

Establish connection (for modem drivers) Opens the input fields for the hardware address and for the telephone number.
  • Disconnect from modem

Terminate connection (for modem drivers)

Show this dialog in the Runtime

The dialog is shown in Runtime so that changes can be made.

Driver commands in the network

If the computer, on which the driver command function is executed, is part of the zenon network, additional actions are carried out. A special network command is sent from the computer to the project server, which then executes the desired action on its driver. In addition, the Server sends the same driver command to the project standby. The standby also carries out the action on its driver.

This makes sure that Server and Standby are synchronized. This only works if the Server and the Standby both have a working and independent connection to the hardware.


Error analysis

3S_V3 -> Error analysis

Should there be communication problems, this chapter will assist you in finding out the error.

Other topics in this chapter

Analysis tool

Error numbers

Check list


Analysis tool

3S_V3 -> Error analysis -> Analysis tool

All zenon modules such as Editor, Runtime, drivers, etc. write messages to a joint log file. To display them correctly and clearly, use the Diagnosis Viewer program that was also installed with zenon. You can find it under Start/All programs/zenon/Tools 7.50 -> Diagviewer.

zenon driver log all errors in the LOG files. The default folder for the LOG files is subfolder LOG in directory ProgramData, example:

%ProgramData%\COPA-DATA\LOG. LOG files are text files with a special structure.

Attention: With the default settings, a driver only logs error information. With the Diagnosis Viewer you can enhance the diagnosis level for most of the drivers to "Debug" and "Deep Debug". With this the driver also logs all other important tasks and events.

In the Diagnosis Viewer you can also:

  • Follow newly-created entries in real time
  • customize the logging settings
  • change the folder in which the LOG files are saved

Note:

  1. The Diagnosis Viewer displays all entries in UTC (coordinated world time) and not in local time.
  2. The Diagnosis Viewer does not display all columns of a LOG file per default. To display more columns activate property Add all columns with entry in the context menu of the column header.
  3. If you only use Error-Logging, the problem description is in the column Error text. For other diagnosis level the description is in the column General text.
  4. For communication problems many drivers also log error numbers which the PLC assigns to them. They are displayed in Error text or Error code or Driver error parameter (1 and 2). Hints on the meaning of error codes can be found in the driver documentation and the protocol/PLC description.
  5. At the end of your test set back the diagnosis level from Debug or Deep Debug. At Debug and Deep Debug there are a great deal of data for logging which are saved to the hard drive and which can influence your system performance. They are still logged even after you close the Diagnosis Viewer.

attention Attention

In Windows CE errors are not logged per default due to performance reasons.

You can find further information on the Diagnosis Viewer in the Diagnose Viewer manual.


Error numbers

3S_V3 -> Error analysis -> Error numbers

Note: The following description is only available in English.

Error text in the LOG | No. | Meaning
RESULT_FAILED | -1 | Action erroneous.
RESULT_OK | 0 | Action successful
RESULT_PLC_NOT_CONNECTED | 1 | PLC not connected
RESULT_PLC_LOGIN_FAILED | 2 | Login to PLC has failed
RESULT_PLC_NO_CYCLIC_LIST_DEFINED | 3 | No cyclic list has been found
RESULT_PLCHANDLER_INACTIVE | 4 | PLCHandler instance was set inactive
RESULT_LOADING_SYMBOLS_FAILED | 5 | Loading of the symbols has failed
RESULT_ITF_NOT_SUPPORTED | 6 | The defined communication interface is not valid or not supported
RESULT_COMM_FATAL | 7 | Communication error occurred during action
RESULT_NO_CONFIGURATION | 8 | Wrong or erroneous configuration of the PLCHandler
RESULT_INVALID_PARAMETER | 9 | At least one parameter is invalid
RESULT_ITF_FAILED | 10 | Communication interface could not be initialized correctly (e. g. Gateway Dlls not available)
RESULT_NOT_SUPPORTED | 11 | Method not yet supported resp. implemented for this configuration (e. g. not supported for this interface)
RESULT_EXCEPTION | 12 | Handled exception in a low layer occurred during action
RESULT_TIMEOUT | 13 | Timeout exceeded
RESULT_STILL_CONNECTED | 14 | PLC already connected (at a further ::Connect() call)
RESULT_RECONNECTTHREAD_STILL_ACTIVE | 15 | Reconnect Thread already active (started at a further ::Connect() call)
RESULT_PLC_NOT_CONNECTED_SYMBOLS_LOADED | 16 | No connection to the PLC, but symbols available offline
RESULT_NO_UPDATE | 17 | Asynchronous operation (e. g. cyclic read of variables) has not yet finished
RESULT_OCX_CONVERSION_FAILED | 18 | Error during conversion of values inside the PLCHandler’s ActiveX interface occurred
RESULT_TARGETID_MISMATCH | 19 | PLC does not match to the passed target id etc.
RESULT_NO_OBJECT | 20 | No object found for the required action (e. g. tried to get an element beyond the end of the list)
RESULT_COMPONENTS_NOT_LOADED | 21 | PLCHandler instantiation has failed, because of missing components
RESULT_BUSY | 22 | Last action still in progress, cannot start the required one
RESULT_DISABLED | 23 | Feature is disabled by the configuration (e. g. Logging)
RESULT_PLC_FAILED | 24 | Communication to the PLC was successful, but the PLC has returned a bad result
RESULT_INVALID_SYMBOL | 25 | Specified symbol does not exist on PLC
RESULT_BUFFER_TOO_SMALL | 26 | User provided buffer is too small to store the required information
RESULT_NO_PROJECT | 27 | No project/application is loaded by the PLC, but the called method requires one to be executed
RESULT_FILE_ERROR | 28 | Operation failed because of an file access error
RESULT_RETAIN_MISMATCH | 29 | Restored retain variables do not match to the project/application on the PLC
RESULT_NO_ACCESS_RIGHTS | 30 | Operation was denied by the PLC because of missing access rights
RESULT_DUPLICATE_PLC_NAME | 31 | Connect by PLC name failed, because there exist several PLCs with the specified name in the PLC network
RESULT_SIZE_MISMATCH | 32 | Service does not succeed because of a size mismatch

info Information

To display these LOG messages, select the following configuration for the client configuration of the driver in the Diagnosis Viewer:

  • Module [Driver], Messagelevel [Internal]


Check list

3S_V3 -> Error analysis -> Check list

Notes on establishing a connection and limiting errors:

Connection between zenon and an ABB PLC via CoDeSys Gateway

Note, when establishing a connection between zenon and an ABB PLC with the help of the CoDeSys gateway:

  1. The specification of the L2 ABB protocol must be included in the registry.

    This specification is normally entered during the installation of the ABB Automation Builders. If this installation cannot be carried out, the following entries can be made manually in the registry:

    • Key: [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\3S-Smart Software Solutions GmbH\Gateway Server\Drivers\ABB Tcp/Ip Level 2 AC]
    • Path: GDrvABBTcpIpL2X.dll
    • Address: 192.168.0.10
    • Motorola byteorder: Yes
    • Port: dword:000004b0
  2. The DLL GDrvABBTcpIpL2X.dll must be in the same folder as Gateway.exe. The DLL must be obtained from the manufacturer ABB directly.

General troubleshooting

  • Is the PLC connected to the power supply?
  • Analysis with the Diagnosis Viewers:
    -> Which messages are displayed?
  • Are the participants available in the TCP/IP network?
  • Can the PLC be reached via the Ping command?

    Ping: Open command line -> ping < IP address> (e.g. ping 192.168.0.100) -> press Enter.

    Do you receive an answer with a time or a timeout?

  • Can the PLC be reached at the respective port via TELNET?

    Telnet: Command line Enter open, telent <IP address port number> (for example for Modbus: telnet 192.168.0.100 502) -> Press Return key.

    If the monitor display turns black, a connection could be established.

  • Did you configure the Net address in the address properties of the variable correctly?
    • Does the addressing match with the configuration in the driver dialog?
    • Does the net address match the address of the target station?
  • Did you use the right object type for the variable?

    Example: Driver variables are purely statistics variables. They do not communicate with the PLC. (See chapter Driver variable.)

  • Does the offset addressing of the variable match the one in the PLC?

Some variables report INVALID.

  • INVALID bits always refer to a net address.
  • At least one variable of the net address is faulty.

Values are not displayed, numeric values remain empty

Driver is not working. Check the:

  • Installation of zenon
  • the driver installation
  • The installation of all components
    -> Pay attention to error messages during the start of the Runtime.

Variables are displayed with a blue dot

The communication in the network is faulty:

  • With a network project:
    Is the network project also running on the server?
  • With a stand-alone project or a network project which is also running on the server:
    Deactivate the property Only read from Standby Server in node Driver connection/Addressing.

Values are displayed incorrectly

Check the information for the calculation in node Value calculation of the variable properties.

Driver fails occasionally

Analysis with the Diagnosis Viewer:
-> Which messages are displayed?