10/10 MN05003003Z-EN
Description of important
functions / function blocks
83
Example of a screen output with texts and value entries
With the Disp_DisplayPage function block
The following display has to be implemented.
The contents of the variables MO11 and TEMP8 are changed
continuously by the user program.
Operations via the PLC inputs
– I1 = FALSE: Status display
– I1 = TRUE: Entry/output mode
– I2 = FALSE: ESC button active
– I2 = TRUE: ESC button disabled
– I3 = TRUE: The values are refreshed by the program.
– I4 = TRUE: Entry active.
Execution
The example program consists of programs:
• “Startprogram”: (called on system event Start)
– Auxiliary variable “g_xFirstCycleAfterStartProgram” is set.
• PLC_PRG:
– 2 values are incremented.
– The program “Visualisation” is called.
• VISUALISATION
– Registering and positioning of variables on the display in
the first cycle.
– The auxiliary variable g_xFirstCycleAfterStartProgram is
reset.
– Activation of Entry/output mode (I1).
– Enable ESC button (I2).
– Start display (I3).
– Start entry (I4).
Declaring display variables
X First declare for each text element that you wish to display, such
as “MO11”, a variable of type “String” in the
“Global_Variables_Display” folder as in the following example:
X Create an auxiliary variable and write the program
“Startprogram” as in the “Example of text and values output”.
X Write the PLC_PRG and Visualisation programs as shown in the
following example:
Figure 99: Example of a screen for entries and outputs
VAR_GLOBAL
g_sDisp_String1 :STRING := 'MO11 :';
g_sDisp_String2 :STRING := 'TIM14 :';
g_sDisp_String3 :STRING := 'MOZ14 :';
g_sDisp_String4 :STRING := 'TEMP8 :' ;
END_VAR
PROGRAM PLC_PRG (**********************)
VAR
fbTimer1 :TON;
(* Display values of the application *)
byValue :BYTE;
wValue :WORD;
dwValue :DWORD;
usiValue :USINT;
siValue :SINT;
END_VAR
----------------------------------------------------------
fbTimer1(IN:=NOT fbTimer1.Q , PT:=t#50ms );
IF fbTimer1.Q = TRUE THEN
usiValue := usiValue + 1;
byValue:=byValue+1;
END_IF
Visualisation(); (* Call visualisation *)