PLC example
Integration in running PLC
A PLC program for checking the generated PLC structure from Section 1.7.2
VAR
(* Use generated structure descriptions *)
p_ve_chan_1 : POINTER TO VE_CHANNEL_DATA_CH_1;
p_ve_globe : POINTER TO VE_GLOBAL_DATA_FROM_CH_1;
text : STRING(20);
END_VAR
(* Ensure that the internal management data is initialised *)
Hli(bStart := TRUE);
IF Hli.bInitialized = TRUE AND Hli.bError = FALSE THEN
(* Provide pointer to structure(s) *)
p_ve_chan_1 := ADR( pVE[1]^.addr^.AHLI_UNS32_Data);
p_ve_globe := ADR(pVEGlob^.addr^.AHLI_UNS32_Data);
(* Work with the variables (read, write) *)
text := p_ve_chan_1^.TEXT[0].token;
p_ve_chan_1^.FARBE[1] := 2;
END_IF