I have written some code that I could use some feedback on. I have a situation were I need to start a timer when valve 1 goes true and then stop this timer when valve 2 goes false.
As an example, valve 1 starts at time = 0 and stays on for 4 sec. but then valve 2 starts at say 1 sec. and stays on for 5 sec. for an elapsed time of 5 sec. The code I wrote works from what I have tested. Any other ideas on how to write this?
P.S. Sorry I coulndn't get a pic of the ladder diagram to post. I will be working on that.
Thanks,
Bob
As an example, valve 1 starts at time = 0 and stays on for 4 sec. but then valve 2 starts at say 1 sec. and stays on for 5 sec. for an elapsed time of 5 sec. The code I wrote works from what I have tested. Any other ideas on how to write this?
P.S. Sorry I coulndn't get a pic of the ladder diagram to post. I will be working on that.
Thanks,
Bob
SOR XIC I:0.0/0 BST OTL B3:0/0 NXB RES C5:0 NXB ONS B3:0/1 RES T4:0 BND EOR SOR XIC I:0.0/1 CTU C5:0 1 0 EOR SOR XIO I:0.0/1 XIC C5:0/DN BST OTU B3:0/0 NXB OTE B3:0/2 BND EOR SOR XIC B3:0/0 RTO T4:0 1.0 32767 0 EOR SOR XIC B3:0/2 MOV T4:0.ACC N7:0 EOR SOR END EOR