Program Time

Martin T

Member
Join Date
Sep 2004
Location
Miami, Oklahoma
Posts
12
Hey All,

I'm trying to show a 9 hour program time countdown on a touchscreen. Using SLC5/04 1747-L542. I've set my code up trying to use S:14 and S:13 to show format HR:MIN:SEC, but all I'm getting from S:14 and S:13 are zero's.

sub t4:1.pre - t4:1.acc n7:12
div n7:12 / 3600 n7:13
mov S:14 n9:3
mov s:13 n7:14
div n7:14 / 60 n7:15
mov s:14 n9:4
mov s:13 n9:5

N9:3 should be my Hours
N9:4 Minutes
N9:5 Seconds

Is there something that has to be set to use S:13&14? I've done this before but can't find my old code to verify and the code that was finally used another guy didn't understand it so he deleted it.

Thanks
 
Rube,
Thanks, I understand the clock registers. What I'm trying to do is get the operators a indicator on how much time is left in a 9 hour temp. soak at 600 C. I'm using S:13 & 14 to show time left in the 9hr timer, S:13&14 should be used with any mul div ddv and such, I've set S:2/14 but it has no affect.
 
I've not used the 13 and 14 bits like you are showing in your logic--I HAVE used countdown displays to HMIs before. Your logic as posted shows to MOV S:14 to N9:3 and 4 which are your hours and minutes registers for display. Is that a typo?

Now that I reread your post it appears from your description that you are not using the PLCs clock to start a countdown--rather an input that can be triggered any time during the day. You are trying to show the time remaining Hours, Minutes, and Seconds. Is this correct?
 
That is correct, I'm embedding N9:3, 4 and 5 into a list diplay to show the time remainig from a TON which is triggered when temp setpoint is 600 and T/C input reaches 590. I can cpt to a float but this will only give me a fraction with the hour (ex. 32400 - 31500 / 3600 = 8.75 hours left) I'm wanting to show 8 hours 45 minutes and 0 seconds left.
 
I've not done such a long count down showing the three parts of time, hours, mins, and secs but using your 9 hours as an example, I would set up a timer and some counters:

Timer 1 would roll to 60 and trigger the first counter up 1 for a minutes counter. When this reaches 60, trigger the second counter, for the hours counter. Subtract the second Counter from 8 to show hours remaining. Subtract the first counter from 60 for mins remaining. Then subtract the timers .ACC from its >PRE (or 60) for the seconds remaining. The Panelview can get its data from the Timer and Counter bits for display.

Set the trigger to start the seconds timer and include a XIO in the same rung so the the timer will reset:

---| |------------|/|----------------------Timer
XIC B3/1 XIO T4:1/DN TON T4:1 1.0 60

---| |-------------------------------CTU C5:1 60
XIC T4:1/DN

---| |---------------| |----------------CTU C5:2
XIC C5:1/DN 1-Shot |-----RES C5:1

Then, use the SUB instructions to get your time remaining values from 8:60:60, (9 hrs).


I'll try to post this in logic form in a few minutes.
 
Last edited:
Rube,

Thanks for the post, haven't thought about doing it lilke that, used logic like that before. Just got stuck on using S13&14, one of them things you know will work but for some reason it's not. Had tunnell vison I guess.
Thanks again, I appreciate your time.
 
No problem--Keep me up to date on how it goes.

I just remembered, your trigger will likely go false before the 9Hrs is up so, to keep the timer going add logic in a parallel branch around the triggering input (or a latched bit from the input to trigger the timer).

Good luck and yell (or PM) if you need help.
 
Last edited:

Similar Topics

So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
14
Views
168
Hi, i am using DVP-14SS2 PLC, after program written to plc, when power is reset, plc doesn't run. always need to connect to pc for the run mode.
Replies
0
Views
31
Hi all, hope you are having a great day, I am in need of your help to create a AOI or program that does this kind of job: I have a IO Link...
Replies
26
Views
539
Hi. I have a 222 CPU. I need to recover the program from the eeprom memory. Is it possible?
Replies
1
Views
101
Can we use a Simotion D455 ethernet port x127 as a gate, to access S7-1500 plc Tia Portal program ? In the Simatic manager, we used Netpro to do...
Replies
2
Views
93
Back
Top Bottom