L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 593

Advertising
background image

L-force | PLC Designer

General Editors

DMS 4.1 EN 03/2011 TD29

591

Selector

A selector in contrast to the composer is used to handle
an output of a box which is of type of a structure. The
selector will display the structure components and thus
make them accessible in the CFC for the programmer. For
this purpose name the selector like the concerned
structure (by replacing "???" by the name) and connect it
to the box instead of using an "output" element .
Example
A CFC program cfc_prog handles an instance of function
block fubblo2, which has an output variable fbout of type
of a structure stru1. By using the selector element the
structure components can be accessed:
Structure stru1 definition:
TYPE stru1 :
STRUCT
ivar:INT;
strvar:STRING:='hallo';
END_STRUCT
END_TYPE

Function block fublo1, declaration and implementation:
FUNCTION_BLOCK fublo2
VAR_INPUT CONSTANT
fbin1:INT;
fbin2:DWORD:=24354333;
fbin3:STRING:='hallo';
END_VAR
VAR_INPUT
fbin : INT;
END_VAR
VAR_OUTPUT
fbout : stru1;
fbout2:DWORD;
END_VAR
VAR
fbvar:INT;
fbvar2:STRING;
END_VAR







Advertising