Peter Nachtwey said:BCD timers, yet another computer crime.
I have still not had a chance to test the cycle counter againg. The mechanical engineer still has issues he needs to fix so I will not get the machine again until next week from the looks of things. But since everyone has shown such a great intrest,which I do appriciate, I will try and give more details from my earlier attempts.
For non AD PLC this may not make much sense. This may not be the exact code we were using. I doing this from memory right now. I blew away the code we started having problems with so I could work on something else.
Anyway here goes
Rung 1
STR T1 (one shot rising)
MOV TA2 to V2000
Rung 2
STR SP1 (always on)
T1 (oneshot rising)
TMRAF T2 K6000
Rung 3
STR
LD K6000
DIV V2000
OUT V3000
Basically what I did is say that everytime T1 came on we moved the data from the timer T2 to a register. We reset timer T2. We then divided 6000 by our moved data and put it in another register. Seemed simple enough. Have used the same setup many times on AB PLC's with no problem. We used the T1 timer as the trigger so that if we bounced at the prox we would not create a false cycle time. Backlash on this machine is pitiful, hince the mech engineer needing to do some more work.
But here things get kinda odd. What would happen is we would get answers that were 2 digits long and then some answers that were 3 digits long and others where 4 digits long.
I do not have the exact numbers I was seeing in front of me. I focused on the fact the number of digits in the register was changing. I know that with AB PLCs the frational part causes a round up if you are using integers so if your answer was 15.5 your integer would read 16. If your answer was 15.3 your integer would read 16. Not sure how AD handles this.
My thought is that there is something screwy (technical term) with the BCD and the way this PLC does math. I am just not seeing it.
This is a rotatory filling machine. The table is driven by a motor gearbox that is chained to the shaft of the table A VFD controls motor speed and a Clutch Brake is used to stop. So the motor speed is constant and we flip the Clutch Brake to stop and start the table.
FYI... I did not pick this drive train, the mech engineer did, hince he has some work to do.
The reason I posted my original question the way I did was to make sure my concept was correct. I figured the odds where pretty good someone else had been down this road and has seen what I did.
Anyway there is what I have right now, it will be sometime next week before I can test again.