Cheddy

Siemens STEP 7 V5.6

8 posts in this topic

Hello, I'm pretty rusty on my STEP 7 software so looking for some help.  We have  FB's all written in STL.  In the block interface/environment there are IN, OUT, IN-OUT, STAT & TEMP sections that have tags assigned.  I have several boolean tags in the IN like I_Start, I_Stop and so forth that are only used in 2 or 3 areas of the STL but I cannot find what sets the I_Start tag. It isn't set in the body of the STL so must be from another FB or more likely a DB but can't figure where/how.  I suspect these are buttons on an HMI but none of the HMI's appear to have buttons that set these bits (Operators pressed any start button they could find).   This FB is called by other blocks but those blocks do not set these tags either.  I looked in the DB that flashed under the DB1 & DB2 header and there are tags with the same name but not the same address that shows in the interface of the FB.  Any help would be greatly appreciated.

FB373 Interface Code.jpg

Share this post


Link to post
Share on other sites

Look for the CALL to the FB and see which instance DB was used. I_Start would be DB{N}.DBX80.0, where {N} is the DB number.

Edited to add:
It may also show up as a parameter on the CALL instruction that instantiates the FB. It's been a while since I messed with FBs...

Edited by Joe E.

Share this post


Link to post
Share on other sites

Thanks for the reply. It's been about 10 years since I've even looked at STEP 7.  But that's kind of the issue I see, looking at the call from FB409 to FB373 I don't see a DB referenced at all in the body of the STL for that call to FB373.  FB409 has a DB but going into that DB it doesn't have any reference to I_Start at all.  I know the sequence works, it was running until they had an equipment failure and now they haven't been able to recover.  I can send some additional screen shots if you think this would help.  Thanks again!!

Share this post


Link to post
Share on other sites

A call to an FB MUST also include a DB. That's how they work. Can you share a screenshot of the CALL instruction? I'd ask you to share the Simatic Manager project, but I no longer have a license for that software so I can't open it myself.

Share this post


Link to post
Share on other sites

Thanks for the help.  The online version (CPU) is considerably different than the offline project.  Doing a compare it appears that several of the DB's are not the same.  I'll let you know how this goes.  Thanks again for the help.

Share this post


Link to post
Share on other sites

Crap, that's really not good! If there's a conflict in an OB, FC, or FB, it's relatively simple (though sometimes a pain...) to reconcile it. DBs can be a lot harder. If you just copy online to offline, you'll end up with every element called "STATxxx". You can usually edit the structure of the offline global DBs to match online, but you may have to do some compiling to make it ok. It's especially a pain if the issue is with instance DBs since they're actually defined by the FBs and it can get really complicated...You have to edit the FB to match, then re-declare (I forget the exact term) the instance DB by re-doing the CALL instruction, which then requires downloading the DB to the PLC, which overwrites the online data values. This is why source control discipline is so important with these PLCs. What I've done (when allowed to stop the system...) is STOP the PLC (essentially put it in program mode instead of run mode), then write down the online values inside the DB. Then do the reconciling. Then manually update the online values in the DB. Then switch it back to run mode. I had a few machines that had conflicts that I could never coordinate my availability with the machine's availability...so they just stayed conflicted. For years. We knew exactly what didn't match and who had done it, but they no longer worked there and their laptop had long since been wiped by IT.

The *best* option is to find the PC that has the matching files and archive them, then update your laptop to match. If there is no fully matching file anywhere, I'd find the one that matches the FBs and instance DB structures and reconcile the OBs and FCs to that. Good luck...

Share this post


Link to post
Share on other sites
On 19/04/2021 at 2:36 PM, Cheddy said:

Thanks for the reply. It's been about 10 years since I've even looked at STEP 7.  But that's kind of the issue I see, looking at the call from FB409 to FB373 I don't see a DB referenced at all in the body of the STL for that call to FB373.  FB409 has a DB but going into that DB it doesn't have any reference to I_Start at all.  I know the sequence works, it was running until they had an equipment failure and now they haven't been able to recover.  I can send some additional screen shots if you think this would help.  Thanks again!!

Look in the STAT area of FB 409 to see if the FB 373 is declared there - this is "multi instance DB" method.

Can you do a screen shot of the FB 409 declaration area or attach an archive of the program.

1 person likes this

Share this post


Link to post
Share on other sites
2 hours ago, Moggie said:

Look in the STAT area of FB 409 to see if the FB 373 is declared there - this is "multi instance DB" method.

Can you do a screen shot of the FB 409 declaration area or attach an archive of the program.

I completely forgot that an FB (and its DB) can be declared within another FB! I haven't worked in Simatic Manager in over a year, and my brain seems to be actively trying to forget stuff.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now