Step 7 block search

String not found in the DB's posted. I also searched for two character strings as well. Did you copy the DB's from the plc (online) to the project (offline)?

srch1.jpg
 
Mad Poet,
you dont have to worry so much.
For both mine and LDs suggestions, you first save the project under a new name. Keep your original STEP7 project untouched.
For LDs suggestion you should then run the search code in another CPU or in PLCSIM.
For my suggestion, you dont have to be online with the machine. My approach is to try and find any STRING declarations in the offline project. This because STRINGs are a bit unusual in a PLC program, and there shouldnt be so many of them. This makes it a realistic to try and find all STRING declarations and analyse them one by one.
edit: And no there are no UDTs online, and not any declarations of any kind. You have to work with a copy of the original program with all the declarations, symbols and comments.
 
Last edited:
Dear L D[AR2,P#0.0] ,
To the best of my ability I copied the db's from the running PLC into the 'project' I zipped and posted here. (The window I copied the blocks from was highlighted green and I had opened the PLC on line to get there.)

I really have no idea why my string isn't in there . . .

Thanks, Jesper.
I do have the projects copied off and I can search them at my leisure. I'm pretty sure, now, that the original problem has to do with the operators changing the way they do things and a bug in the software somewhere. Some sequence of operations nobody thought of or accounted for.

So this is going to become one of those things that I'm going to, someday, figure out but it is not important enough to drop my other job requirements for.

Thanks, Guys.
MadPoet.
 
Dear Jesper,
The procedure you recommended for searching all the DB's (and UDT's) worked well. I did the 'Generate Source' thing, told it to include all the DB's, and it created a source file. Then I searched the source file for 'string' and it said there are no strings anywhere.

Now I had manually searched a few DB's, and I knew that DB360 was a small one with two strings in it. DB360 is also called 'dbMTN_PARAMDBSTATUS'.

So I searched the source file for dbMTN_PARAMSTATUS and I found the datablock. (Not by its number - I saw no db numbers in the source.)

Where the string was supposed to be, I found szcomment := ' ';
Two lines down the second string had :
. . . . . sznotvalid message := 'No Valid Drive Configuration Data Block Found';

Just to be obnoxious, I tried that trick on ALL the blocks, and inside a function block I had a green comment - // String buffer to transmit

aybuffer ARRAY [1..256] // String buffer to transmit

I now have a feeling that this program is going to do something like talk to a piece of software called a 'DMServer', pull one product name out of the DMServer and send it to a display, loop around and pull the next name and send it to the next display, loop again etc. etc. etc. until it's done with none of the names actually left in the PLC.

Fun fun fun. Good think my job does not depend on figuring this part out.
MadPoet.
 
It looks like the strings were declared as ARRAYs of BYTE or CHAR. (*)
Very sneaky, and I dont really understand why one would do that.
But good that you found it anyway.

I am puzzled that you couldnt find any "string" even if there is a comment with "string" in it.

*: Edit. Actually, without having the source code to look at, it could also be an ARRAY of STRING. Not impossible since you mention that the code loops through the product names.
 
Last edited:
Dear Jesper,
When I 'generate source' on all the blocks, and then search for 'string', it did find the word string - when it was part of a comment. (And not in a DB or a UDT . . )

I don't know that the code loops through the product names . . . It is just that I would not be surprised if that is what they do.

That the data block had a variable declared as a string . . . but the 'generate source' version did not have the string declaration . . . that is irritating me.

MadPoet.
 
I Found IT !

Thanks, guys, I couldn't have done it without you.

For starters, I was looking in the wrong PLC. There are three PLC's in this system, and what I was looking for was not in the obvious suspect. (But I did find something in my prime suspect that sent me to the real culprit.)

So today I went down (after they were done) and pulled all the blocks out of the running PLC that had them. I generated source for ALL the blocks, searched that and still didn't find it. But searching for something more generic sent me to FB835 which in turn sent me to any one of five dbs. First block I looked in, DB741, there was the string I was looking for - laid out vertically. 'They' had declared it in an array of 'CHAR's, one letter at a time.

Always a good feeling to find something like this.

Thanks again Guys.
MadPoet.
 

Similar Topics

I am having a step7 v5.4 program where the blocks are encrypted and locked. And the manufacturer is stopped the support. Is there any ways to...
Replies
2
Views
161
In TIA portal v13 where is in project file information about data block, function code block are stored ? Thanks
Replies
3
Views
1,756
Just a quick question I can't find an answer on yet. I have created my own recipe structure using a Global DB and when I came in this morning...
Replies
2
Views
2,013
Hello, I am trying to find an easy way to create data blocks in Step 7 with ~100K tags other than manually defining each tag in the LAD/STL/FDB...
Replies
8
Views
14,134
Hello All, Is there a way in Step 7 5.5 SIMATIC Manager to export a data block so that it can be imported into another project with all...
Replies
11
Views
3,707
Back
Top Bottom