magicsmoke
Member
You could use S:1/15 to unlatch your latch this bit only come's true on the frist scan.
That's what I was initially recommending but after looking more at your problem I think you'd probably be better off with my second suggestion, which wouldn't require an extra internal bit.So your saying use a internal bit like B:3/3, latch it on after the timer is done T4:0/13, then use the internal bit B:3/3 to turn on (any statement) a comparison statement? Then do you come off the comparison with a add instruction?
I tried adding a rung at the bottom with XIC T4:0/13 then a MOV command at the end with the Source T4:0/13 and Dest 50, but it just keeps running. Thanks Denniskolyur said:That's what I was initially recommending but after looking more at your problem I think you'd probably be better off with my second suggestion, which wouldn't require an extra internal bit.
Think of it this way: Every time the timer rolls over to zero, the timer accumulated value should be immediately changed to 5 seconds. Since you're using the reset of the timer to trigger that change, it won't happen during the first cycle when the program first starts.
So... the DN bit of the timer indicates when it's ready to "roll over." You can use this condition to trigger a MOV instruction to transfer 5 seconds (i.e. 50) into the accumulated timer value. You can also remove that XIO contact on rung 001, since the new rung you're adding will keep the timer running.
If you are using the LIM instruction, then (because it switches when equal to Low Limit), you must not allow any overlap in your lights.I've got the red N/S 0-340, yellow N/S 540 -640, green 340-540 and the E/W lights Red 0-40 then parallel 340-640, then the Yellow 240-340, then the green 40 - 240.
Yes I'm going off of what someone else pointed out that there should be a 4 second overlap everytime a green light is cycled that way to cut down on crashes. Thanks Denniskolyur said:The thing that's not clear to me from your instructions is whether both N/S and E/W can be red simultaneously for a short time during every signal change (to prevent accidents from people running the light I suppose). That is how the signals in my town work but I have visited places where that is not the case (opposing signal turns green immediately as other turns red).
If the former case is permitted, then I think your logic will be simpler since you won't have to worry about the initial 4-second double-red state--just set up your timing diagram like Lancie suggested and you'll be good to go. But if that double-red condition only occurs during the first timing cycle, then you'll probably have to finagle your timer accumulator with a MOV instruction or something to get that functionality.