PLC

Alias

An alias is a user-defined data type that can be used to create an alternative name for a data type or function block.

You declare an alias in a DUT object that you create using the command Add > DUT in the context menu of the PLC project tree in the project.

Syntax:

TYPE <identifier> : <Assignment statement>;
END_TYPE

Example:

The example shows the declaration of an alias T_Message. A PLC variable of type T_Message declared in the program is always a string with 50 characters.

TYPE T_Message : STRING[50];
END_TYPE

Declaration:

sMessageA : T_Message;

Program:

sMessageA := 'This is a message';

See also:

Object DUT