Referencing Project variables in the PCE

Referencing Project variables in the PCE

Hi friends,
I have a runtime license for Zenon 7.0. In a trial application I tried to see the working of the PCE.
A simple project was created having 3 internal tags ' UG_lev' (LReal), 'Inlet_XV '(Bool) and 'Pump' (Bool). The Tank level will have to increase by 1.23 when Inlet_XV was true, and also decrease by 2.34 when Pump is true..
The following code was entered in a task set to100ms cyclic in the PCE... The above variables were also linked to the cyclic task..

'Initfunction
Sub Task_Init()
End Sub
'The Mainfunction is a cyclic function
Sub Task_Main()
If Inlet_XV = 1 Then
UG_lev = UG_lev + 1.23
End If
If Pump = 1 Then
UG_lev = UG_lev- 2.34
End If
End Sub
'Exitfunction
Sub Task_Exit()
End Sub
'Timerfunction
Sub Task_Timer(lTimerId)
End Sub
This compiled without errors.. BUT the values of UG_lev did not update.

When I tried the syntax
Task.Value('UG_lev') = UG_lev + 1.23 then I get compile errors.
Please help me out with this simple example.

This is a migrated post! Originally posted on 19.02.2015 by user rajsiyer. Please be aware that information can be outdated.