I have managed to write a code which counts running total on Citect Scada using Cicode-language. Now I have a problem because it seems that my loop has somehow reset my counter. I'm pretty new to this.
At this point, I don't know what causes this. This morning total was around 1480 before reset happened and I'm using INT as datatype. Counter has been active for about few weeks now. I'm using Citect Scada 6.1V.
FUNCTION Laskuri()
INT iState14 =0
INT iState15
WHILE 1 DO
Sleep(3600)
iState15 = ReadVar(5,"Ar",59)
iState14 = iState14 + iState15;
SetVar(5,"Ar", 58, iState14);
END
END