Help - Search - Members - Calendar
Full Version: Time Remaining Output
Forums.MrPLC.com > PLCs and Supporting Devices > Automation Direct
Hoose
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.
b_carlton
QUOTE(Hoose @ Apr 22 2009, 01:57 PM) [snapback]81423[/snapback]
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.


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)
Hoose
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

b_carlton
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.