Sign in to follow this  
Followers 0
Hoose

Time Remaining Output

4 posts in this topic

I've been trying to make a time remaining countdown for this oven program and no matter what I try I'm not getting the output I would expect. I know it's something in the conversions but... I have a timer TRMA counting up to in this case 360000 (or 10 hours). The countdown timer starts out fine at 10.0 Hours and counts down fine until 9.0 but then skips to 8.4. On previous attempts with other logic it would count down to 9.7 and then bounce back to 9.9 again and again. One a side note the oven timer function works fine, it's just the countdown display that reads out wrong. Right, wrong or indifferent. My last attempt was: First rung LD - K3600 OUT - V3302 LDD - TA10 DIVD - V3302 OUT - V3304 next rung MATHBIN - V5004-V3304 Output to V5020 (HMI input Unsigned 16) I'm either missing something simple or I'm going about this all wrong. This is the last item I need to complete the program and never expected to give me so much trouble. Hopefully this is enough info. Thanks for any help! Mike DL06 with C-more micro touchscreen. Edited by Hoose

Share this post


Link to post
Share on other sites
The accumulator of the timer (TA10) is a BCD number. The value you store in V3302 is a BCD number. Therefor the quotient in V3304 is a BCD number. (And you should have used DIV, not DIVD or you can change your first OUT to an OUTD - you may be getting away with it if V3303 just happens to contain zero.) I'm guessing that V5004 contains the preset for timer 10 so it was a BCD number. Therefore you should have used MATHBCD. But then your answer is a BCD number. If your display is an Unsigned 16 then you will either have to change the display type or change the BCD value in V5020 to a binary using the BIN command (LD V5020, BIN, OUT V5020)

Share this post


Link to post
Share on other sites
Thanks! I'm glad the internet is full of people smarter than myself. =) You cleared up a couple things that I didn't quite understand, really more of misunderstood. I didn't realize the timers were BCD, so I also had to fix the logic input from the HMI as well after changing the output. So I ended up with: LD - v5004 (HMI input) MUL - v3302 OUTD - V5006 T10 - v5006 LD - k3600 OUTD - v3302 LDD - TA10 DIV - v3302 OUT - v3304 MATHBCD - v5004-v3304=v5020(HMI Output) And changed both the HMI input and output to BCD16. Appreciate the help! Mike

Share this post


Link to post
Share on other sites
Although this is oriented toward those migrating from Allen-Bradley to AutomationDirect it might has some helpful tips. http://www.theplcguy.com/ABtoAD/Introduction.htm

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0