Eaton easyControl EC4-200 User Manual page 86

Programmable logic controller
Table of Contents

Advertisement

Interactive display
Creating the program "Visualisation"
Depending on the status of auxiliary variable
"g_xFirstCycleAfterStartProgram" register the variables for which
the text/value is to be displayed:
Program the function "Disp_RegisterVariable" with the
X
following example parameters: Disp_RegisterVariable
(`S1',ADR(g_sDisp_String1), Disp_TYP_STRING). Here the
variable is assigned the name S1.
To display a value (type Byte) program a variable with the
X
function call Disp_RegisterVariable ('V1', ADR(byValue),
Disp_TYP_BYTE).
Figure 98: Function Disp_RegisterVariable
In this program section you can also define the position of the
variables on the display by specifying the Line and Column.
Call the function block (FB) "Disp_DisplayElement" and assign
parameters for the inputs sName, byLine, and byColumn, e.g.:
fbDisplayElement1.sName := 'S1';
fbDisplayElement1.byLine := 1;
fbDisplayElement1.byColumn := 1;
The element S1 with the text "motor1" would be displayed in the
first line starting from the first column.
In order to display/enter several elements call the function block
"Disp_DisplayElement" in the following program section that is
continuously processed and assign external inputs to the
"xEnable" inputs, e.g. I3.
VAR
xIsDisplayEnabled: BOOL;
fbGetDisplayInfo:
fbDisplayElement1: Disp_DisplayElement;
fbDisplayElement2: Disp_DisplayElement;
fbDisplayElement3: Disp_DisplayElement;
fbDisplayElement4: Disp_DisplayElement;
byError:
byValue:
wValue:
END_VAR
------------------------------------------------------------
(* Initialisation in the first cycle after program start *)
IF g_xFirstCycleAfterStartProgram = TRUE THEN
Disp_ClearScreen(xEnable:=TRUE);
Disp_RegisterVariable('S1', ADR(g_sDisp_String1),
DISP_TYP_STRING);
82
Disp_GetDisplayInfo;
BYTE;
BYTE;
WORD;
Disp_RegisterVariable('S2', ADR(g_sDisp_String2),
DISP_TYP_STRING);
Disp_RegisterVariable('V1', ADR(PLC_PRG.byValue),
DISP_TYP_BYTE);
Disp_RegisterVariable('V2', ADR(PLC_PRG.wValue),
DISP_TYP_WORD);
fbDisplayElement1.sName
fbDisplayElement1.byLine
fbDisplayElement1.byColumn
fbDisplayElement2.sName
fbDisplayElement2.byLine
fbDisplayElement2.byColumn
fbDisplayElement3.sName
fbDisplayElement3.byLine
fbDisplayElement3.byColumn
fbDisplayElement3.byDigits
fbDisplayElement3.byPrecision
fbDisplayElement4.sName
fbDisplayElement4.byLine
fbDisplayElement4.byColumn
fbDisplayElement4.byDigits
fbDisplayElement4.byPrecision
(* The first cycle is completed, reset flag *)
g_xFirstCycleAfterStartProgram := FALSE;
END_IF
xIsDisplayEnabled := Disp_EnableDisplay(I1, I2);
fbDisplayElement1( xEnable:= I3 );
fbDisplayElement2( xEnable:= I5 );
fbDisplayElement3( xEnable:= I3 );
fbDisplayElement4( xEnable:= I5);
Start the programs.
X
10/10 MN05003003Z-EN
:= 'S1';
:= 1;
:= 1;
:= 'S2';
:= 3;
:= 1;
:= 'V1';
:= 1;
:= 8;
:= 4;
:= 1;
:= 'V2';
:= 3;
:= 8;
:= 6;
:= 1;

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the easyControl EC4-200 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents