GET_CURRENT_PI_NAME block

Short summary

Name

GET_CURRENT_PI_NAME

→POU type

→function

Category

IEC-block, MemoryEnh, block with internal error diagnostic

Conform to →IEC-standard

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/add.svg not defined in IEC-standard

Graphical interface

images/download/thumbnails/414781805/GET_CURRENT_PI_NAME-version-1-modificationdate-1535026912101-api-v2.png

Available since

version 1.58.0 (for logi.CAD 3)

Functionality

The block returns the name of the program →instance in which context the block is executed.

Return value


Identifier

→Data type

Description

Return value:

STRING

returns the name of the current program instance

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Internal error diagnostic for block

The block checks the would-be return value.
If the return value cannot be mapped in the available memory (the return value is too large), the output ENO of the block is set to value FALSE (or an equivalent). When you are using nested blocks with STRING values, observe that the memory for STRING values is restricted (see "In case of nested string blocks: How can the return value be entirely mapped ?" for details and examples).

Example for usage within ST-editor

The calculated values are evaluated by using the Assert block .

(* Mind that 1. 'ExampleGetCurrentPiName' is instantiated and used in a program. *)
(* 2. the name of the program instance for this program is 'DocumentationExamples'. *)
FUNCTION_BLOCK ExampleGetCurrentPiName
VAR
piName : STRING[32];
END_VAR
piName := GET_CURRENT_PI_NAME();
Assert(piName = 'DOCUMENTATIONEXAMPLES');
END_FUNCTION_BLOCK

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.