Timer not starting...Please help me..S7-300.

drspanda

Member
Join Date
Oct 2005
Location
Damanjodi
Posts
155
The below is the code and I am not able to understand why the timer T1 is not starting?? The code is from siemens site as an example for detection of objects on the conveyour.

network-1

L 0
L "display_period" //display_period =40.
<=I
JC L011
NEGI
L011: L 60
TAK
>I
JC L021
TAK
L021: T "display_period" //display_period


network-2

L "display_period" //display_period
ITB //convert input to S5TIME format
SLW 4
SRW 4
OW W#16#2000
SD T 1
AN T 1
JC LV1R
R T 1
S Q 6.0
S Q 6.1
S Q 6.2
LV1R: NOP 0

Also I am attaching the screen shot while online..
shot.JPG

Advance help to all siemens experts.
 
There is no logic that starts the timer. Timers are RLO dependent, and there needs to be something that starts it.

I think we saw this same problem in another thread. Siemens certainly has an odd way of handling their own timers.

You could try something like this:

network-2

A M200.0 //This is a bit that starts the timer.
L "display_period" //display_period
ITB //convert input to S5TIME format
SLW 4
SRW 4
OW W#16#2000
SD T 1
A T 1
R M200.0
S Q 6.0
S Q 6.1
S Q 6.2

As soon as you set M200.0, the timer will start running. When the time value is reached, it will set the outputs and reset the trigger. You don't need to reset the timer.
 
Last edited:
S7Guy said:
There is no logic that starts the timer. Timers are RLO dependent, and there needs to be something that starts it..

Please excuse me if I am wrong and also correct me..As you said timers are RLO dependent...In network-1 RLO is being set (0 to 1 transition)....I think timer should start.

I think we saw this same problem in another thread. Siemens certainly has an odd way of handling their own timers.

Yes I have posted because I was not able to understand the way the programmer changed INT to S5 time format...thanks you helped me.
You could try something like this:

network-2

A M200.0 //This is a bit that starts the timer.
L "display_period" //display_period
ITB //convert input to S5TIME format
SLW 4
SRW 4
OW W#16#2000
SD T 1
A T 1
R M200.0
S Q 6.0
S Q 6.1
S Q 6.2

Should I mean M200.0 is permanently logic 1....or you need a rising edge i.e., 0 -> 1.
 
drspanda said:
Please excuse me if I am wrong and also correct me..As you said timers are RLO dependent...In network-1 RLO is being set (0 to 1 transition)....I think timer should start.

But the RLO is always one before the timer logic. You need a 0 to 1 transition just before the timer. The 0 to 1 transition at the beginning of Network 1 is resolved by the JCs, so you have to start over.

Should I mean M200.0 is permanently logic 1....or you need a rising edge i.e., 0 -> 1.

You need a rising edge. What do you intend to use the timer for? For instance, you are setting the three outputs when the timer elapses. You could use the condition of all three outputs being false:

AN Q 6.0
AN Q 6.1
AN Q 6.2
L "display_period" //display_period
ITB //convert input to S5TIME format
SLW 4
SRW 4
OW W#16#2000
SD T 1
A T 1
S Q 6.0
S Q 6.1
S Q 6.2

After all three outputs are reset again (I assume somewhere in your logic), the timer will start again.
 
In network 1 you are just limiting the value of the timer preset from 1 to 60.

What is the timer for, for me it would normally be to create a delay after a condition is met. I see no condition being met in your logic to enable the timer to run, so I have an awful feeling that you call the block conditionally, therefore the logic before the timer never changes.

I have no idea if you change the preset externally, perhaps you have a calculation for that value elsewhere.

As S7Guy states, the timer needs to see the RLO gove a zero to one transition to work, so why is it in a separate block from the condition that calls the block, perhaps, that block should be called all the time and move the condition to call the block into the position where S7Guy placed his M 200.0.

I would also put a SET after the JC off the timer, to ensure that the resets for the timer and outputs work.

But remember, after you have reset the timer in this method, it will not time again until the condition for the RLO goes off and back on again.
 
why go from INT to S5TIME, because S5TIME is the only format accepted by the timer as a preset, the only other method is to call the standard block for timers and this uses the format TIME.

Just another thing, I don't know what the outputs are, but I would not reset outputs from a conditionally called block (normanlly I would not SET/RESET outputs at all but thats personal preference). I would have flags in place of the outputs and have the outputs in an area that is processed every scan.

That way if a problem pops up where the block is not called you can still have the opportunity to turn the outputs off, from E-Stop etc.
 

Similar Topics

Hi, I am attempting to turn on an output for one second, every thirty seconds, but am having some trouble. I have a XIC with S:1/15 (first pass)...
Replies
9
Views
583
Rather new to structured text. I'm trying to edit a machine so that it will reinitialize with some push buttons held in for 10 seconds. Pushing...
Replies
13
Views
2,738
Hello everyone, Is it possible to stop a TON timer using the same input that you used to start the timer with? PLC used s7 1200 Software TIA v13
Replies
16
Views
6,140
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
296
Question to anyone with ideas about my thoughts on upgrading a very vintage timer, which is being used to switch between 2 5hp domestic water...
Replies
14
Views
430
Back
Top Bottom