Hey,
Using Citect 6.1
I need to display a number to show how many days pumps have been turned off for.
How often will Ci-code get called to run if I place it inside a Genie?
I have written a Function to make this happen but I am having trouble using it. When I say the Argument is "pumpOn" that is coming from a PLC Tag.'
I just want it to display a number on the Page and that's it.
Is it possible to display a Ci-code variable on a page?
Instead of a function can I perhaps modify that code and store the value in the PLC and place it straight into a text box on the page?
Cheers
Using Citect 6.1
I need to display a number to show how many days pumps have been turned off for.
How often will Ci-code get called to run if I place it inside a Genie?
I have written a Function to make this happen but I am having trouble using it. When I say the Argument is "pumpOn" that is coming from a PLC Tag.'
Code:
INT
FUNCTION DaysPumpsTurnedOff(INT pumpOn)
INT timeSwitchedOff;
INT daysOff;
IF pumpOn = 0 THEN
IF timeSwitchedOff = 0 THEN
timeSwitchedOff = TimeCurrent; // Capture when the pump was turned off
END
daysOff = DateSub(TimeCurrent,timeSwitchedOff) / 86400; //Find out the seconds between when the pump was turned off and now.
RETURN daysOff;
ELSE
daysOff = 0 // Reset to zero if the pump is on
timeSwitchedOff = 0;
END
I just want it to display a number on the Page and that's it.
Is it possible to display a Ci-code variable on a page?
Instead of a function can I perhaps modify that code and store the value in the PLC and place it straight into a text box on the page?
Cheers