L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 255

Advertising
background image

L-force | PLC Designer

Editors in PLC Designer



DMS 3.2 EN 02/2011 TD29

253

For Global Variables (g) and Global Constants (gc) an additional prefix + underscore is
attached to the library prefix:

Examples:

VAR_GLOBAL

CAN_g_iTest: INT;

END_VAR

VAR_GLOBAL CONSTANT

CAN_gc_dwExample: DWORD;

END_VAR

User-defined data types (DUT)

The name of each structure data type consists of a library prefix (Example: CAN), an
underscore and a preferably short expressive description (Example: SDOTelegram) of
the structure. The associated prefix for used variables of this structure should follow
directly after the colon.

Example:

TYPE CAN_SDOTelegram : (* prefix: sdo *)

STRUCT

wIndex:WORD;

bySubIndex:BYTE;

byLen:BYTE;

abyData: ARRAY [0..3] OF BYTE;

END_STRUCT

END_TYPE

Enumerations start with the library prefix (Example: CAL), followed by an underscore

and the identifier in capital letters.

Regard that in previous versions of PLC Designer ENUM values > 16#7FFF have caused
errors, because they did not get converted automatically to INT values. For this reason
ENUMs always should be defined with correct INT values.

Advertising