
adccommunitymod (AutomationDirect) asked a question.
formatting "count" on LCD display
Created Date: February 21,2005
Created By: Mark
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I 've got a timer, let's suppose it is 5 minutes (K3000). I would like to display the time counting down on the LCD display such as: 05:00 05:59 05:58 . . . 00:03 00:02 00:01 I'm having the toughest time trying to accomplish this. I thought this might seem like a common task that someone may have attempted this before.
Created Date: February 21,2005
Created by: Mark
I 've got a timer, let's suppose it is 5 minutes (K3000).
I would like to display the time counting down on the LCD display such as:
05:00
05:59
05:58
.
.
.
00:03
00:02
00:01
I'm having the toughest time trying to accomplish this. I thought this might seem like a common task that someone may have attempted this before.
Created Date: February 21,2005
Created by: bcarlton
I can help with the PLC logic part. First establish a 'time remaining ' value by subtracting the accumulator from K3000. Then divide the 'remaining ' value by K60 and store the result in 'minutes '. 'POP ' the remainder from the stack and store that in 'seconds '. As to the formatting for the LCD display, I'll leave that to you.
LD K3000
SUB 'ACCUM '
DIV K60
OUT 'mINUTES '
POP
OUT 'sECONDS '
Created Date: February 22,2005
Created by: Rich1955
Load 3000
Sub timer
out Vmem
Created Date: February 22,2005
Created by: marksji
What display are you sending to?
Created Date: February 22,2005
Created by: Mark
Thanks for the responses.. the closest I can get is by using:
V100:BS ": " V101:BS
this, however, results in:
2:11
2:10
2:9
2:8
.
.
.
At this stage, the best idea I 've got is to do some comparisons and put a text 0 when needed..
is there a way to force 2 characters with a leading zero if needed? :B does 4 chracters with leading zero's.
Created Date: February 22,2005
Created by: bcarlton
You may need to build your own string character by character. It doesn't seem to have a format for displaying only 1 single leading zero for the 'minutes '
Created Date: February 22,2005
Created by: franji1
I 've done similar manual formatting to format numeric data into V memory using the HTA instruction. It is your friend in this situation.
Created Date: February 22,2005
Created by: Rich1955
Me I take the easy way out and get a OP-440 panel from AD and save me a lot of headake. More than what you need if $ is not realy a problem.
Created Date: February 22,2005
Created by: marksji
From your reply I assume your using the LCD for the DL06. For this your best bet is to create your own text strings and basically forget about the VPRINT command.
Created Date: February 23,2005
Created by: Mark
Yup, sorry, I should have mentioned that - it is the LCD for the DL06. I have been able to achieve the effect by doing several CMP operations and adding the preceeding "0 " to the minutes and to the seconds portion of the string when required.
Thanks for all of the help guys!