small question on timers ?

Oh yeah...

Bob, it's you! Not the other Bob but you Bob!

But with respect to the question...

What about my concern about restarting the fan wit .1-seconds left on the timer?

There's really no telling when he will jump in and stop the fan!

So again I go back to... what the hell does this guy really want/need?
 
Last edited:
I always say that the hardest part of any automation project is the definition part. DEFINE what you want your system to do. How does it start? How does it stop? What about when something faults? How does the operator interface with the system? How does the operator know there's a problem? What about when a more-motivated idiot invades your idiot-proof system?

Define your system first, every time -- before you ever start writing code. It doesn't matter whether you use a flow chart, a state diagram, pseudo code, text description... But define it FIRST. Even when you have 20+ years of experience, you still do this. It might be "in your head", but you still go through the process.

This problem has nothing to do with retentive timers. It has to do with not knowing how your system is to operate.

ZYD, what exactly do you want? Are you using a switch (maintained) or a pushbutton (momentary)? What conditions do you want to start the motor? What conditions do you want to stop the motor? What do you want the motor to do if it gets stopped mid-cycle, then restarted?
 
BobB said:
I believe that the following is pretty definative
how can i let the timer count the rest of the time , not running from the beginning ?
I do not agree. Terry's comment about 0.1 second left on the timer is on the point if you ask me.

Is it too much to ask to get an exact definition of the task at hand ?
 
Just something for ZYD to bear in mind regarding the retentive on delay timer in S7 300.. it doesn't operate as you are intimating you'd like it to.

When the timer receives an input it starts to time. If the input goes off at any time it doesn't "wait". It just keeps timing until the timer comes on. You then need to put a 'high' on the reset input to reset the timer back again.

This is slightly counter intuitive really and probably not what most people would guess if asked how they thought a "retentive" timer operated..

:)
 
Terry Woods said:
Oh yeah...

Bob, it's you! Not the other Bob but you Bob!

But with respect to the question...

What about my concern about restarting the fan wit .1-seconds left on the timer?

There's really no telling when he will jump in and stop the fan!

So again I go back to... what the hell does this guy really want/need?

the qeustion was really obviuos Terry

btw i am not an American so i opologize for my bad language , anyway lets repeat the qeustion again ,

lets say i a have i0.0 ( button) which is input +

a normally closed i0.1 which is switch off button + a timer + Q8.0 a fan

the timer work for ten seconds right so suppose that if i pressed the i0.1 button (paused) after 5 sec so how many seconds remain ? 5 sec lol

so again i pressed the i0.0 but it will not work for the rest of the time , it will work for a ten seconds again ?

this is the problem , i want the fan to work for another 5 sec got it
 
ZYD said:
the qeustion was really obviuos Terry

btw i am not an American so i opologize for my bad language , anyway lets repeat the qeustion again ,

lets say i a have i0.0 ( button) which is input +

a normally closed i0.1 which is switch off button + a timer + Q8.0 a fan

the timer work for ten seconds right so suppose that if i pressed the i0.1 button (paused) after 5 sec so how many seconds remain ? 5 sec lol

so again i pressed the i0.0 but it will not work for the rest of the time , it will work for a ten seconds again ?

this is the problem , i want the fan to work for another 5 sec got it

Terry's asking, what if the fan had run for 9.9 seconds?

Would you really want to re-start a fan for 0.1 seconds.



Got it?
 
Why don't you just have the start/stop latch go to a marker.

The marker then is used with a 1 sec flip/flop timer to increment a counter.

A comparator checks if the marker is on AND the counter is less than or equal to 10.

If it is run the fan.

If its not then reset the counter and 'delatch' the ON marker.
 
OK ZYD...

There are still a few concerns but... this should get you going.



Run
Start Stop Proxy
---| |---+---|/|-------( )
|
Run |
Proxy |
---| |---+


T#
Run +------+
Proxy | TONR |
---| |-------------+ 10s |
| |
+------+



Run
Proxy T# FAN
---| |-------|/|-------( )


Reset Run
Timer Proxy T# T#
---| |-------|/|-------| |--------( R )





Note: T# refers to the particular Timer number that is in the range of retentive timers... check your documentation.

The “Run Proxy” bit is controlled by the Start and Stop buttons.

The Timer runs as long as the “Run Proxy” bit is on.

While the “Run Proxy” bit is on and the timer has not timed out, then the fan runs.

At any time before timeout, if you press the Stop button the “Run Proxy” bit will go off and this will stop the timer. Since this is a retentive timer the accumulated time remains.

If you then press the Start button again, the fan will resume running until the timer times out or until you press Stop again.

An additional factor involves resetting the retentive timer. You might want to modify this so that it doesn’t require the timer to be timed out, however, you should keep the Run Proxy bit as shown.

I still have to raise the question about trying to restart the fan with only .1 second left on the timer.
 
Here's a Step 7 implementation:

Code:
FUNCTION_BLOCK FB 1
TITLE =
//Reset controller with bReset=1
//Release controller with bReset=0
//Rising Edge of bStart causes bQ to turn on provided bStop=1
//bStop=0 causes bQ to turn off
//When bQ has been on for an accumulated time of tRunTime,
// bQ remains off until controller is reset.
VERSION : 0.1

VAR_INPUT
  bStart : BOOL ; 
  bStop : BOOL ; 
  bReset : BOOL ; 
  tRunTime : TIME ; 
END_VAR
VAR_OUTPUT
  bQ : BOOL ; 
END_VAR
VAR
  fbTimer : sfb4; 
  tTimeStore : TIME ; 
  bStatus : BOOL ; 
  bStopEdgeStore : BOOL ; 
  bComplete : BOOL ; 
  bStarted : BOOL ; 
  bStartEdgeStore : BOOL ; 
END_VAR
VAR_TEMP
  bCalcTime : BOOL ; 
  bElapsedTime : TIME ; 
END_VAR
BEGIN
NETWORK
TITLE =Reset controller
	  A	 #bReset; 
	  JNB   _00b; 
	  L	 #tRunTime; 
	  T	 #tTimeStore; 
	  SET   ; 
	  SAVE  ; 
	  CLR   ; 
_00b: A	 BR; 
	  R	 #bStarted; 
NETWORK
TITLE =on rising edge of start PB, start controller
	  A	 #bStart; 
	  FP	#bStartEdgeStore; 
	  A	 #bStop; 
	  S	 #bStarted; 
NETWORK
TITLE =controller timer
	  A	 #bStarted; 
	  =	 L	  6.0; 
	  BLD   103; 
	  CALL #fbTimer (
		   IN					   := L	  6.0,
		   PT					   := #tTimeStore,
		   ET					   := #bElapsedTime);
	  NOP   0; 
NETWORK
TITLE =when stop pressed, stop controller and request time remaining
	  AN	#bStop; 
	  FP	#bStopEdgeStore; 
	  =	 #bCalcTime; 
	  R	 #bStarted; 
NETWORK
TITLE =calc time remaining
	  A	 #bCalcTime; 
	  JCN   noc; 
	  L	 #tTimeStore; 
	  L	 #fbTimer.ET; 
	  -D	; 
	  T	 #tTimeStore; 
noc:  NOP   0; 
NETWORK
TITLE =output from controller
	  A	 #bStarted; 
	  AN	#fbTimer.Q; 
	  =	 #bQ; 
END_FUNCTION_BLOCK
 
BobB said:
Terry, I believe I have determined what he wants to know from a PLC programmers perspective. The definition is not good but I have had a lot worse thrown at me over the years.

I believe that the following is pretty definative


That is what I have used to base my reply. Could be wrong though.
By the way, good to see you back. You have contributed enormously to this forum over the years I have been a member.
Latch the start, inhibit a restart on the latched timer. Easy.
 

Similar Topics

Hi Guys, I was wondering if you guys could help me out. I want a tag to display a certain word depending on a set of tags. There are six flag...
Replies
8
Views
2,540
Hello I'm new with the PLC :) so my Question is that I want O/1 to be on when I push I/1 and when I push I/1 again O/1 becomes off. considering...
Replies
4
Views
1,913
Here is the logic i am designing. The X3 is basically a push button when u press it once it put something in on position. when u press it again it...
Replies
7
Views
5,349
my dear friends, plz tell me how can i compare 2 words? I dont want to convert the words to integer.
Replies
7
Views
6,243
Dear friend in CPU S7, can you tell me the diference between IW(input word) and PIW(peripheral input word)? Regards
Replies
8
Views
3,170
Back
Top Bottom