Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Evilbeard on August 11, 2017, 09:41:36 AM

Title: Stage Retentive Bits
Post by: Evilbeard on August 11, 2017, 09:41:36 AM
I was on my scheduled days off when I was contacted by a supervisor with an issue with one of my projects. He claims the jogging bits were hanging up and not resetting, causing issues. The machine ran for months with no issue, so I don't know what caused it because I wasn't on site. I talked him through resetting the bits to the proper state through text, and it was the last I heard of it. I'm back in today, so I got a chance to talk to him and look at the project. He had talked to AD support, and they said the stages could be causing it to hang up. I don't see how that could happen. Here is my logic:

(https://i.imgur.com/JuGzIbv.png)

This is a dancer setpoint. The line ramps to a stop before it loses the run signal. The unwind is a standalone unit. It doesn't get the speed from the rewind. So, when it stops, the dancer is usually high or low (depending on the direction the roll is unwinding). I made these stages to jog the unwind to put the dancer at the midpoint when the line stopped. So, it compares the dancer position (PV) to the upper and lower comparative points (setpoint +-20 as uppertest and lowertest) and then decides which way the unwind has to jog. It sets the bits to jog, jogging the unwind in the proper direction, until the bit is reset in the later stage. I don't see how this could have any opportunity to hang up. Am I wrong here?
Title: Re: Stage Retentive Bits
Post by: PLCGuy on August 11, 2017, 09:53:59 AM
Not sure if this would help, but when you set c1 and jmp to S1 same time. I usually set c1 then on the next rung jump to S1. that makes sure c1 is set. I had a instances when that fixed a problem i was having in another program. But I do see you set and reset the bits before the jmp command. Be careful there. When I first did stage programming I would set/reset bits after the jmp command and that did not work out so good sometimes.
Title: Re: Stage Retentive Bits
Post by: b_carlton on August 11, 2017, 10:20:08 AM
Instead of using Set/Rst drive C13 and C14 using unconditioned OUT instructions in S1 and S2 respectively.
Title: Re: Stage Retentive Bits
Post by: Evilbeard on August 11, 2017, 10:40:44 AM
Instead of using Set/Rst drive C13 and C14 using unconditioned OUT instructions in S1 and S2 respectively.

For some reason, I always forget you can do this in Stage because I'm so conditioned to not being able to do it normally. I think this is a much more streamlined solution (though I don't believe it was the problem).
Title: Re: Stage Retentive Bits
Post by: Garyhlucas on August 11, 2017, 10:57:49 AM
I avoid set/reset like the plague. Sooner or later you leave one set and bad stuff happens. I was helping a customer recently with a machine problem and he mentioned that a function sometimes worked and sometimes didn't. The guy that had programmed it had used set/reset and sure enough I found where it sometimes missed a reset.
Title: Re: Stage Retentive Bits
Post by: b_carlton on August 11, 2017, 11:22:00 AM
If you are truly paranoid place a RST of C13 and C14 in Stage 0.
Title: Re: Stage Retentive Bits
Post by: franji1 on August 11, 2017, 02:30:26 PM
Sets and Resets work as defined.  They have no side-effects related to Stage or EXITing a program code-block (but OUT coils DO turn OFF whenever you leave a stage or EXIT a program).

However, that doesn't necessarily mean that the contact logic driving the Sets and Resets is always valid  ;D.
Title: Re: Stage Retentive Bits
Post by: PLCGuy on August 12, 2017, 02:32:26 PM
b-carlton, i get paranoid lol, i do reset all stages, all outputs and all bits in my Stage0 before going onto the program. Actually when e-stop occurs everything gets reset and program goes to the Stage0. when E-stop is good and a few other things, then I jump out of Stage 0.