AAAARGGGH! S7 Pro: Any Way to Save Error-Laden LAD/FBD?

John Miller

Member
Join Date
Oct 2007
Location
Vancouver
Posts
11
So here I am trying to commission my first Siemens Step 7 project. I foolishly decide that things would be "nicer" (easy for the plant to follow and maintain) if I separated out the heating and cooling stages for this piece of equipment.

When adding the call to the heating stage into the old routine, now the parent routine, ooops, I notice that I forgot to delete an output parameter when I changed it to an IN_OUT parameter. Make the change in the child routine. Of course, it affects the instance DB that is used to call the child from the parent. I don't think there is any way from within the LAD/FDB/STL to tell it to recompile the instance DB. (I complained about this in a recent thread, but then I had to walk away in the middle of the conversation.)

I only had two LAD windows open, so it seemed as good a time as any to do the pain-in-the-neck "Close all windows and Check Block Consistency." I Cut the offending FB subroutine call and closed the parent. I don't recall if it was when I closed the parent or later when I compiled the parent (after compiling the referenced children), but S7 complained that an interface is out of date and that no symbolic information is available.

Opening the parent, all my STAT declarations have vanished completely: not even a bunch of variables named STATnnn. The parameters and TEMP variables seem to be there, but S7 does not recognize any of the type information: that a variable/parameter is a Boolean or a UDT. I think retyping the type field worked for a UDT, but it didn't seem to work for a DWord.

Which brings me to my question. Because I am getting old and senile (and have been disorganized all my life):), I didn't remember all the changes made since the last backup. It seemed the best way to fix it was to copy the variable declarations from the backup and then do global "replaces" to change the STATnnn and TEMPnnn to the right names. I was a bit worried because I do not know of a way to save intermediate work, and sure enough, part way through the process, the editor crashes. How did that Kraft cheese commercial go? "We'll start again, sir."

Am I blind? Illiterate? Or is there some clever trick I haven't discovered yet?

Related to this, does S7 Pro 5.4 SP3 have any improvements over SP2 for handling propagation of definition changes? I downloaded SP3 before I left but didn't want to risk breaking anything by installing it.
 
It's hard to tell if you have gone beyond the point of fixing this, but have you tried right-clicking on the "red" function call and selecting "Update Block Call"? That will fix most problems with IBDs and FB parameters.

You can also recompile the whole project by doing a "Check Block Consistency". Have you done that?
 
S7Guy said:
It's hard to tell if you have gone beyond the point of fixing this,

Thanks for your reply. I appreciate it.

No, in the interest of making best use of my "plant time", I decided to move on the "other PLC" and do the editing to fix this problem tonight at the hotel.

In any case, I suspect that both the original problem of propagating data changes and the apparent lack of a way to save intermediate edits will come back to haunt me again, so if anyone knows of any solutions or workarounds, I am eager to hear them.

S7Guy said:
but have you tried right-clicking on the "red" function call and selecting "Update Block Call"? That will fix most problems with IBDs and FB parameters.

Yea, I stumbled upon "Update Block Call" awhile back, and it seemed pretty useful, but when I think about it now, maybe I was only using it for changing parameters for FCs (no instance block). It is the instance blocks that cause me the most grief. Between "Update Block Call" and "Check and Update Accesses" under the File menu, I seem to be able to propogate changes to FBs and FCs. Someone in a previous thread almost became my hero when he suggested a sequence that used "Check and Update Accesses" to update the DB. Unfortunately, this menu item always seems to be grayed out for DBs. The only way I know to force an instance DB (or a DB derived from a UDT) to update is to select Compile from the "Check Block Consistency" window. Of course, this requires all editor windows to be closed, which is right where the problem started for me. In hindsight, knowing S7's problems in this area, I should have closed the parent (throwing away any changes that referred to the child) before changing the child and forcing any necessary compiles.

Oddly, the "Update Block Call" did not appear when I had this problem. (Am I remembering wrong, or does it appear as "Update Block Call" in the root right-click menu?) There was a Called Block or something submenu (I think this was in the right-click menu.), and it had an "Update" option, but it was always grayed out.

S7Guy said:
You can also recompile the whole project by doing a "Check Block Consistency". Have you done that?

No, I had only compiled the code/data units that the parent referenced. After reading your message, I decided to give a full compile a desperate try. No good. When it got to the parent routine, it threw out about 170 errors about STATnnn, etc. being bad types. It appears the changes are permanently there.

Thanks again.
 
Rule 1 on major changes (no help now I'm sorry), have a back-up of the code before starting the changes.

The best way forward is to do as S7Guy suggests, delete the IDB, then recreate it. I would normally do this by commenting out the FB call and then deleting the DB from the project. Then un-comment the call, the DB will be recreated from scratch.

You say its the parent, does that mean the other FB's are embedded in the FB (i.e. in the STAT area).


Its a pity, as the company I work for are doing a job in Vancouver (if thats where you are) and I was supposed to be flying out tomorrow, been cancelled for a week now. I cold have helped in the evening if you wanted. At least show a few things in S7.
 
Hej

When I need to update the IDB, I always go to the calling block
and uses "Check And Update Accesses" from the File-Menu. This as always worked for me.

IDB_Update.jpg


Best Regards
Jesper
 
AAAARGGGH! S7 Pro:
.. and I bet any day now STEP7 is about to post a thread entitled
AAAARGGGH! John Miller
You were at the commissioning stage when you made this change? Just to make it "nicer"?
I know I drone on about design vs. coding but there's a right time and a wrong time.

Ken
 
.. and I bet any day now STEP7 is about to post a thread entitled You were at the commissioning stage when you made this change? Just to make it "nicer"?
I know I drone on about design vs. coding but there's a right time and a wrong time.

Ken
[/b]
in the OEMs I worked for, 20% of the PLC code was written at the plant after installation , on a bucket, laptop on lap, by someone who didn't write the code but told the code writer it was not functional weeks before.

this scene was repeated for years, at 3 different OEMs..........

I have never installed anything that just worked..............would be nice though.
 

Similar Topics

hello, I'm a student and for my final grade I have to repare a sepro robot. the only problem I have for now is that i have an error code 3...
Replies
0
Views
35
Sorry for my lack of knowledge, beginner here. Yesterday, we had a Pro-Face SP5000 HMI fail on us. The technician said that the HMI had the blue...
Replies
2
Views
117
Hi everyone, I hope you're all doing well. I'm currently working on updating an HMI project for the GP2500, and I've encountered a bit of a...
Replies
1
Views
87
SELECTED NEW FILE SELECTED PROCESSOR TYPE SELECTED I/O CONFIGURATIONS IM UNABLE TO CONFIGURE MY I/O’S. I HAVE A PAPER COPY OF A PROGRAM AND I...
Replies
0
Views
80
I have EB Pro installed on windows 11, I can open an existing project and edit but when I got to parameters tab and open page I get the hourglass...
Replies
0
Views
57
Back
Top Bottom