Step7 - problem translating from STL to FB

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
The following code snippet is part of a longer STL Network monitoring the press-fitting of a bearing. The error condition gets set if the timer times out.

Code:
	 A	 "St1.5_DB Handling".N12
	 AN( 
	 AN	"ME_MW-1.5S05.01"
	 A(	
	 A	 "ME_MW-1.5S05.02"
	 A	 "ME_MW-1.5S06.01"
	 O	 
	 A	 "ME_MW-1.5S05.04"
	 AN	"ME_MW-1.5S06.01"
	 )	 
	 )	 
	 L	 S5T#4S
	 SD	"T84"					 //Überwachungszeit, danach wird Teil NIO gesetzt

In order to better understand what exactly is going on, I wanted to convert it to FB, which I'm more comfortable with for this sort of thing. However, try as I might, I can't get it to come up with an identical listing when I convert my FB version back to STL.

This was pretty well my nearest approach so far (I replaced the Timer with M1000.0 for test purposes):

FB_18N12.jpg


When I convert it back to STL I got the following:

Code:
	 A	 "St1.5_DB Handling".N12
	 AN	"ME_MW-1.5S05.01"
	 A(	
	 A(	
	 A	 "ME_MW-1.5S05.02"
	 A	 "ME_MW-1.5S06.01"
	 O	 
	 A	 "ME_MW-1.5S05.04"
	 AN	"ME_MW-1.5S06.01"
	 )	 
	 NOT 
	 )	 
	 =	 M 1000.0

which is not quite right. Had the final "NOT" been after the second closing bracket, I might have accepted it as being equivalent, but not where it is.

If I try moving the negation to immediately before the assign command (=) in the FB instead of on the preceding &-input (which is where I reckon it ought to be), the the outer bracket pair disappears completely, which is also not quite right! o_O

Would anybody like to have a go at producing an FB (or Ladder) version of the commands which translates exactly to the first version.
 
Here you go Roy:

Code:
	  AN	M	236.3
	  A(	
	  A	 M	236.2
	  A	 M	236.5
	  O	 
	  A	 M	235.7
	  AN	M	236.5
	  )	 
	  NOT   
	  A	 DB18.DBX	1.4
	  =	 M   1000.0

... and here it is in FBD format:

fbd3.JPG
 
Thanks Simon,
I had a feeling that I was mising an AND-gate, but I wasn't happy with any of the solutions that I came up with. I must admit, I'm still struggling to convice myself that the above code is identical to the original. I guess I'll finish up building a truth table of all possible states to convince myself!

Cheers

Roy

Edit: Just noticed that my original scribbles on the proverbial back of the envelope (actually the back of some old listings) finished up identical to your solution above. Looks like the main problem I'm having is conviincing myself that the two slightly different STL renderings are logically identical.
 
Last edited:
I ran both implementations in the simulator and compared the output results for all possible input combinations to prove they were logically equivilant.
 
Yes, I got round to drawing up a truth table yesterday and finally convinced myself - with five variables that's still doable. Don't think I'd like to try it with a few more though!
 

Similar Topics

The following code snippet is part of a longer STL Network monitoring the press-fitting of a bearing. The error condition gets set if the timer...
Replies
0
Views
3,767
I am trying to check what is the value coming from the pot and depending on the value change the value inside the DB11.DBD0 But it is not working...
Replies
24
Views
3,284
Dear all, I don't know why the above section (written in SCL) switches the CPU to stop mode. When I delete the two lines highlighted with...
Replies
14
Views
2,876
I have a problem and i can't resolve it. I want to configure some connection beetween plc's,hmi's etc but whenever I try tu run the NetPro using...
Replies
8
Views
6,090
Hi All, I'm trying to install STEP7 V5.4 on a system which is having Windows XP proffesional.I'm getting the message as below.... "There are...
Replies
2
Views
4,384
Back
Top Bottom