Adding time to a running time when a coin is deposited.

LauneJon

Member
Join Date
Oct 2023
Location
TN
Posts
1
I am training using RSlogix 500, and cannot figure out how to add time to my timer's preset while it is timing. I need to add 60 seconds every time a quarter is deposited. Thank you
 
I wrote a parking meter program just to see if I could.


It added time based on the coin inserted, and added different times if it was an American coin or a Canadian coin - both sides of the border here there is a mix of both coins. Canadian coins got different time depending on the exchange rate entered. It also added time for pennies, nickels, dimes, quarters and half dollars depending on the ability of the coin mechanism.



I think I remember a timer triggered a counter counting down, adding coins increased the counter accumulator, accumulator gets to 3 then Warning flag pops up, at 00 the Expired flag pops up.


Plus, just for fun, when the Expired flag output came on another output labeled DETONATOR was energized for 1 second too.
 
What are the conditions that should start the timer running?

What are the conditions that should keep the timer running until it has expired?

What are the conditions that should increment the timer preset?

What should happen when the timer expires?

What should the preset be when the timer is not running?

What bit from the timer should allow use of the resource?
 
I'm thinking that adding to the PRE is going to cause problems.


He wants a run time added of 60 seconds.


IMO that would best be done by a counter counting how many 60 second periods are allowed (paid for), and that would be by manipulating the counter ACC.


Every quarter adds 1 to the counter ACC
If the counter ACC>0 then run the 60 second timer

Every timer DN counts down 1 and resets the timer

If the counter ACC>0 then energize the output for the process.


If this is homework and the assignment specifically says 'timer PRE" then the above, more problematic, methods would be the answer.


Just remember as you get experience there will be more than one way to accomplish a task in a PLC.
 
I'm thinking that adding to the PRE is going to cause problems.
I did a test and adding to the .PRE attribute of the timer object on the fly does work on RSLogix Micro Starter Lite (500-ish).

I know I have seen adding to the preset not affecting a timer that was already timing, but I suspect it was on a different brand (AutomationDirect? Siemens?) timer implementation.


Just remember as you get experience there will be more than one way to accomplish a task in a PLC.
+1 (y)
 
Last edited:
The OP simply asked how to change the timer preset on the fly. There are other things to consider to determine whether or not that's a good idea. He's got to check to make sure the added time won't exceed a value of 32767 in the timer's .PRE register. As robertmee pointed out, he's got to make sure the .DN bit isn't already true.
 
I did a test and adding to the .PRE attribute of the timer object on the fly does work on RSLogix Micro Starter Lite (500-ish).


It definitely does work, a timer PRE can be changed by logic whether the timer is running or not. I've done it by a PB OneShot, HMI entry of a new PRE value, or changing modes sets different times.



My thought is changing it BACK. Plus the previously mentioned limit of 32767 if someone has 547 quarters (but for $136.75 I would just go get a professional wash instead of the quarter car wash).
EDIT: OT fun fact - a 2 quart Mason jar holds $143 in quarters



Similar to latched outputs or modes on a PLC the programmer has to think of EVERY possibility to unlatch it, not just the operator pressing the StopPB to turn an output off, or for a mode, the next mode unlatches the last mode without considering cycle abort, E-stop, power loss, major alarm shutdown, or even a process error where a product falls off the conveyor to never start the next mode.
I have had too many service calls where something shut down and wouldn't start because a latched mode in the middle of a cycle didn't unlatch and I programmed in anywhere up to 20 ways to unlatch it.
 
@LauneJon: if you are still having trouble, post your code to get some advice.

Sidebar: I am down to 2 or 3 rungs and nine instructions, including enabling an output and protecting against the 547th coin.
 
I love these threads where an OP asks for a homework solution, never to return, mean while the experienced talent here tries to build one that will survive Armageddon. It's a sickness :)
 
Not that the OP seems to be interested now, I agree with the counter, personally, I would add 60 to the counter every coin then count down in seconds no need for a timer use in-built clock pulse, could display the amount of time left on some display i.e. HMI.
Again if different coinage then just add the value (counts in seconds) to the counter.
 

Similar Topics

Dear , problem : Adding and configuring analog input module 1794-IE8 to existing running system SLC 5/03 through 1747-BSN (DH485) System: - 2...
Replies
1
Views
3,771
In the Contrologix User manual in chapter 8 it says versions 15 and forward have the ability to add I/O online without having to stop the...
Replies
9
Views
2,850
Hello all! So I have one project with a S7-1214 and a MTP1500 "Project1" and one project with another S7-1214 "Project2". Both of these PLC:s need...
Replies
1
Views
2
Hi Everyone, Currently we have three plants running with Controllogix PLCs (L72, L73, L74). In each of these plants we have 2 FTView SE...
Replies
0
Views
67
Hello, Im building project with 1756-L82ES controller and 1756-IB16S card but i cant find it when trying to add the card to IO configuration...
Replies
3
Views
144
Back
Top Bottom