Unusual S7 operation?

MartinW

Member
Join Date
Apr 2008
Location
UK
Posts
70
Hi,

I have a section of code that's not behaving as I expected it.

Past this into a new STL network

A M 150.0
A M 150.1
A M 150.2
A(
A(
A M 150.3
L S5T#5S
SE T 70
NOP 0
NOP 0
NOP 0
A T 70
)
A M 150.5
A M 150.6
ON M 150.4
)
S M 150.7
NOP 0
NOP 0

Now, I would have expected that in order for the timer to come on, ALL of the M150.x bits from 0 to 3 would have to be on.

It seems that the timer will activate as long as M150.3 is on, regardless of the state of M150.0, .1 or .2

Why is this?
 
Well, it looks that this kind of timer only needs a pulse to start.
Are you sure you're not giving a pulse on the m150.0,m150.1, and m150.2 bits?
 
Hi,

I've shown it as a LAD snippet.

The timer will come on even if M150.3 is the ONLY bit turned on.

logic_zps365fa535.jpg
 
Interesting.
The LAD code cannot be input as LAD. But if you input as STL, and change to LAD view it will display as in post #3.

The problem is that this code
A M 150.2
A(
A(
means the RLO has to be remembered in 2 levels. And that is not possible, only the current RLO and the next opeation can generate the next RLO.

So the STL code is bad. Why STEP7 doesnt complain and shows a warning when changing to LAD view is odd.

Split into two networks like this fixes the problem.
Code:
Network 1
      A     M    150.0
      A     M    150.1
      A     M    150.2
      A     M    150.3
      L     S5T#5S
      SE    T     70
      NOP   0
      NOP   0
      NOP   0
      NOP   0

Network 2
      A     M    150.0
      A     M    150.1
      A     M    150.2
      A(    
      A     M    150.3
      A     T     70
      A     M    150.5
      A     M    150.6
      ON    M    150.4
      )     
      S     M    150.7
      NOP   0
      NOP   0
This shows that LAD and FBD performs some code checks to steer you clear of some problems when you enter the code in the editor.
 
timer on

Hi,

I've shown it as a LAD snippet.

The timer will come on even if M150.3 is the ONLY bit turned on.

logic_zps365fa535.jpg

i would make a new control rung m150.8 being the output place in front of your timer move m150.1 m150.2 and m150.3 to that rung to fire m150.8

Scott
 
Funny.
When displaying the STL code as FBD you get this.
Notice how the timer is not in series with the conditions M150.0, M150.1 and M150.2.
STEP7 is definitely confused by this code.
This shows you that there is some LAD code that cannot display as FBD and vice-versa.

FBD_err.png
 
I suggest you code in LAD rather than STL.
It is easier and more intuitive, and some things that you can input in STL despite it wont work will be checked by the LAD editor.
The problem you describe would not appear if you code in LAD or FBD.
 

Similar Topics

I installed some Rockwell Autom. apps using the files with the MD5 checksums below. Can anyone please confirm that these are the correct files...
Replies
11
Views
2,527
Good Morning , We have a IMI Buschjost 24 vdc solenoid valve coil that is very hot . About 192 degrees . It stays energized for very long...
Replies
5
Views
2,372
I think this may be a bit unusual, and I'm not even sure this is realistic or if this is the correct place to ask this question. Please bear with...
Replies
4
Views
2,359
I need to detect the motion of a netting material as it moves by a small window. The material is a monofilament netting with 3/4" squares. I can...
Replies
19
Views
5,915
Hello, PLCTalk Community, I hope you can help give me a little perspective. I'm doing an in-depth failure mode analysis on a system that uses a...
Replies
11
Views
8,106
Back
Top Bottom