script help

This is the panel script that I wrote for a GE quickpanel view
Can someone please explain to me why this script will not work, it does not give me any error it just does not toggle the bit PLC.M00059
It is supposed to toggle the bit PLC.M00059 for one minute then turn it off the script is set to run periodically every 1000 ms




IF (TIME_OF_DAY.HR = 15) AND (TIME_OF_DAY.MIN = 00) PLC.M00059 := (1)
ELSE
PLC.M00059 := (0)
ENDIF
 
according to your code the only time that PLC.M00059 is set to '1' is when TIME_OF_DAY.HR = 15 & TIME_OF_DAY.MIN = 00 and you may be missing a THEN statement. Try this:

IF (TIME_OF_DAY.HR = 15) AND (TIME_OF_DAY.MIN = 00) THEN
PLC.M00059 := (1)
ELSE
PLC.M00059 := (0)
ENDIF

but just to let you know your PLC.M00059 is set to 1 when TIME_OF_DAY.HR = 15 & TIME_OF_DAY.MIN = 00 pretty much at 3:00 regular time, so as soon as 15:00 hits it should stay on for one minute, then after that, once the time cycles back to 15hrs and 00 mins the bit will stay on for one minute and repeat the process, if thats what you want then your fine, but if you want to turn that bit on for a set amount of time then turn it off for a set amount of time then you would need to write different code.
 
The built-in QP View variables for hour and minute are #CurrentTime.HR and #CurrentTime.Min. Have you defined "TIME_OF_DAY.HR" and "TIME_OF_DAY.MIN"? If they are PLC variables, you may need the "PLC." prefixing them the same as you have for "PLC.M00059".
 

Similar Topics

Hello everyone. On my current job, I have to copy the program of an old PLC to a new one, but I only have a transcript of the original program...
9
Replies
510
Views
Hello, I am trying to bind a script to a button, that copies a .csv file from my project into an usb-stick, but I can't make it work. This is what...
0
Replies
951
Views
Hello, I am trying to find out how to make a popup open when a certain output bit on the plc is active. My brain isn't functioning that well...
2
Replies
911
Views
Can someone give a clear explanation of the IOSetAccessName for an Intouch Application Script? - Thanking everyone in advance. The setup is 1 No...
0
Replies
1,993
Views
I need to hide/display a lamp by using a script. It says there is a script error but I cannot figure out where the error is. Can some one please...
7
Replies
4,622
Views
Top