PACFramework

LVL1 Classes

CLSID = 16#100x – 16#17FF

General Description

LVL1 (process variables) are technological variables for complete process data handling, including channel linking, filtering, scaling, inversion, etc.; simplifying process debugging; simulation functions; process alarming functions, and more.

It is recommended to use consistent identification (ID) of process variables within LVL1 to simplify symbolic referencing in the HMI.

The process variable level is represented by four classes:

If needed, separate classes for network variables can be defined. It is recommended to process network variables using the same functions as standard technological variables.

A single buffer with the structure VARBUF is used.

A variable with ID = 0 is reserved as an empty, inactive variable.

HMI Usage Recommendations

An example of diagnostics and configuration of analog variables on the HMI is shown below. Windows displaying the list of all process variables within the framework are referred to as process variable maps.

img

Fig. Example of using analog input variable functions on the HMI.

img

Fig. Example of configuring discrete input variable functions on the HMI.

Variable statuses (alarms, faults, forced state) accompany the display of variables on all HMI mimic diagrams. The following image shows an example of warning display for variable PT102 on a panel with limited functionality (Simatic Basic Panel).

img

Fig. Example of displaying variable status on the HMI.

General Requirements for Variable Class Structures

The structures must contain:

Name Type Description
ID UINT Unique identifier
CLSID UINT 16#10xx
STA INT Status bits
PRM UINT Configuration parameters, must be retained after power-off
CHID UINT Logical channel number to which the variable is linked, 0 = not linked
CHIDDF UINT Default logical channel number
prm1   Parameters according to the technological variable class
prm2   Parameters according to the technological variable class
prm3   Parameters according to the technological variable class
STEP1 UINT Step number
T_STEP1 UDINT Elapsed step time in ms
T_PREV UDINT Time in ms since the previous call, taken from PLC_CFG.TQMS

General Requirements for VAR Functions

Functional Requirements

Level 1 CMs (process variables) can be linked to a channel of the same type (e.g., a discrete input to a discrete input process variable) by their number. This allows dynamic linking of a process variable to a channel, enabling physical reallocation of a specific sensor/actuator in case part of the system fails. Additionally, this switching can be done programmatically.

Process variables are higher in the control hierarchy than channels. All diagnostic information is transmitted from the channels to the variables. The implementation of this level is hardware-independent since all platform-specific details are handled at the channel level, whose interface is standardized within the framework.

Process variables provide the following functionalities:

Working with the Buffer

A classic buffer handling function must be implemented.

A function for bidirectional buffer handling (VARBUFIN <-> VARBUFOUT) should be implemented.

Interface Requirements

The interface should pass the following parameters:

If direct access to external variables from inside functions is not possible, PLC_CFG, VARBUF, VARBUFIN, and VARBUFOUT should be passed. Alternatively, other interfaces may be used to access PLC_CFG internally.

User Program Implementation Requirements

Within the general program (outside the class function implementation):

Within the class function implementation:

Testing

General Test List

No. Name When to check Notes
1 Assigning ID and CLSID on startup After function implementation  
2 Buffer write commands After function implementation  
3 Parameter modification and writing from the buffer After function implementation  
4 Changing the logical channel number After function implementation  
5 Writing CHID values by default on startup or single command After function implementation  
6 Operation of built-in time counters After function implementation  
7 Effect of PLC time counter overflow on step time After function implementation  
8 Ping-Pong algorithm After function implementation  
9 Operation in non-forced mode After function implementation  
10 Operation in forced mode After function implementation  
11 Sending broadcast commands to clear forcing After function implementation