dYoast
Lifetime Supporting Member
I finally have had a chance to work with ST. For what its worth, I am using a GE-IP PAC Rx3i.
Please look at the attached pdf of ladder, then critique this code. There may be better/simpler/easier/cleaner ways.
Thanks in Advance!
Please look at the attached pdf of ladder, then critique this code. There may be better/simpler/easier/cleaner ways.
Thanks in Advance!
Code:
[FONT=Courier New][FONT=Courier New]'Logic for Leaked Three Count[/FONT]
[FONT=Courier New] IF Leak AND NOT Block THEN[/FONT]
[FONT=Courier New] ctrLeak := ctrLeak + 1;[/FONT]
[FONT=Courier New] END_IF;[/FONT]
[FONT=Courier New] IF (Reset AND Leaked) OR (NOT Leaked AND ((Leak AND Block) OR NOT Leak)) THEN[/FONT]
[FONT=Courier New] ctrLeak := 0;[/FONT]
[FONT=Courier New] END_IF;[/FONT]
[FONT=Courier New] Leaked := (ctrLeak >= 3);[/FONT]
[FONT=Courier New]'Logic for Blocked Three Count[/FONT]
[FONT=Courier New] IF NOT Leak AND Block THEN[/FONT]
[FONT=Courier New] ctrBlock := ctrBlock + 1;[/FONT]
[FONT=Courier New] END_IF;[/FONT]
[FONT=Courier New] IF (Reset AND Blocked) OR (NOT Blocked AND ((Leak AND Block) OR NOT Block)) THEN[/FONT]
[FONT=Courier New] ctrBlock := 0;[/FONT]
[FONT=Courier New] END_IF;[/FONT]
[FONT=Courier New] Blocked := (ctrBlock >=3);[/FONT]
[FONT=Courier New]'Logic for Both Three Count[/FONT]
[FONT=Courier New] IF NOT Leak AND NOT Block THEN[/FONT]
[FONT=Courier New] ctrBoth := ctrBoth + 1;[/FONT]
[FONT=Courier New] END_IF;[/FONT]
[FONT=Courier New] IF (Reset AND Both) OR (NOT Both AND ((Leak AND Block) OR (Leak AND NOT Block) OR (NOT Leak AND Block))) THEN[/FONT]
[FONT=Courier New] ctrBoth := 0;[/FONT]
[FONT=Courier New] END_IF;[/FONT]
[FONT=Courier New] Both := (ctrBoth >=3);[/FONT]
[/FONT]