S7 - Moving Symbolic names from Merker to DBs

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
I'm condsidering moving as many of my logic signals as possible from Merker to DBs, so as to have a better overview and to avoid Bit, Byte, Word conflicts. It's not a huge number, abou 150 in all, but it's enough that it would be nice to know if there's a way to simplify the job.

If I'm not mistaken, in this case the Symbolic priority option doesn't help, because Symbolic Nmaes inside DBs, while showing up in the X-Reference list, don't appear in the Symbol Table.

Anybody got any idea of how I can do this more easily, than 150 x Cut & Paste followed by goodness knows how many x finding and modifying each access?

Or is the whole thing more trouble than it's worth?
 
Hi Roy,

in THIS post I explained how one can manipulate the Initial and Actual values of DBs, with a little help from Excel.

Going by that as an example, you could expert the Merkers to an Excel file, and then import them from Excel into the source file for the DB.

It will take quite a few tries the first time to get it right, but after that you should be able to do it many times.
 
Thanks Jesper, I'll have a look at that. I thought there might be a way to get there using either Excel or Access (to attack the Siemens DBF files directly - sounds a bit dangerous though!:D).
 
Not so silly, you have to locate the source file under
(project path)\s7asrcom\00000001
(or possibly another subdirectory with a name structured like "\0000000?").
The file will have an .AWL extension.

Then in Excel specify SPACE and TAB as delimiters.
 
You can export source code from Step 7 to any windows folder by highlighting the source code block(s), right click and select "Export Source.." and place the exported code where you want.

Note that replacing all the marker references with DB references can have serious implications.

1. The scan time will increase as each db reference causes an implicit open DB instruction.

old Code A M0.1
New code A DB1.DBX0.1
code for timing OPN DB1, A DBX0.1


2. Referencing markers does not change the current open DB. Any reference to a db will cause that db to open so if your code looks like this:

opn DB6
L MW 4
L DBW 0

and you replace the MW4 with say DB1.DBW 4, the L DBW0 will now be loading from DB4, not DB6 as expected!
 
Last edited:
Mmmm! This isn't as easy as it looks!

Actually, I don't think this is going to be the solution for my Merker problem, there are just too many bits and pieces to be moved and too many things to go wrong.

However, it did look like the solution for another problem I had. I've got a DB which holds the table of delay times before a Module can be reused, depending on what Voltage (i.e. how much energy) it was used with the previous time. There are two factors to be considered here:

1) The cooling time of the Pulse forming coils, when the module is triggered into the load
2) The cooling time of the Dump resistors, if the module's energy has to be dumped in a fault condition (or on a trial run).

It turns out that the cooling curves I calculated are about right for the coil, but are off by a factor of two for the Resistors. The easy way to solve the problem is to copy the DB and modify the delay values. Here we run into that old favourite, actual vs. initial values. So I created the new DB, then followed your steps to modify the initial and actual values in the source file and then recompile it.

And that's where the problems start. I get 5 compiler errors, two in line 1, one saying there's a Type conflict with the first word in the DB Name - "Dump Module Delay " and the second saying that the Symbol "Dump" does not exist in the Symbol Table, etc.

OK that seems clear enough, evidently the Editor can't
cope with spaces in the DB name, although Step7 itself has no problem there. Recopy the DB this time using "underlines" instead of spaces and try again. Well it got a bit further but hit trouble in the first line of the DB data which is the length declaration for the look-up table. It gives (amongst other errors) a syntax error for *"W#16#19;"*. OK, I thought, maybe it doesn't like the semi_colon; so I removed them in Editor.

Try again same story, so delete the quotes. Now I'm left with the last set of error messages - "There may be an incomplete declaration, or the sequence is wrong" (loosely translated from the German).

So I went back to your Post again and read it carefully, in particular:

Save the file with "Save As", accept the format "Tab delimited .txt". Close the file and choose "No" when prompted to save with special formatting.

Maybe there's a difference between the English and German versions of Excel, but if I answer "Nein" to this message:

Excel_Msg.JPG


Excel just abandons the save.

By the way, this 550 pixel restriction on width is a real pain, I assume it's so that the format doesn't run off the screen, but with things like these error messages, it can be difficult to get them to fit and still keep them readable. That pic is 548 pixels wide!

The same fault comes for every data line in the DB. It looks as though the formatting is somehow getting screwed up - have you any idea how?
 
Last edited:
Roy,
it worked for me, but to try and catch every possible combination of what is in the symbol list may be impossible.
I also had problems when I had used quotes (") in the comment field. It took some effort to get it right.
If it is too much trouble simply dump the whole idea.

edit: 150 symbols and estimated 10 seconds per symbol to copy the symbol from the Symbol editor into the DB editor makes approx half an hours work.
Irritating work indeed, but faster than the "clever" way.

But why cant we select many rows and colums in the DB editor at a time and then use cut-and-paste ? It IS infuriating to have to work one line at a time.
This is the same reason why I have all my alarm messages in Merkers, despite that I use DBs for everything else.
I can easily paste all the alarm comments in one go because I use Merkers.
 
Last edited:
But why cant we select many rows and colums in the DB editor at a time and then use cut-and-paste ? It IS infuriating to have to work one line at a time.
This is the same reason why I have all my alarm messages in Merkers, despite that I use DBs for everything else.



Oh boy, I'm going to enjoy this - I can tell Jesper how to do something!👨🏻‍🏫

In the DB editor, if you click on the Byte.Bit number in the extreme left-hand column (not the "Name" column) then you'll find it highlights the whole line. I use this all the time for Module dependant data. I enter the first line, say:

Module_Select_01;BOOL;FALSE;generalised comment without module number.

Then I mark the whole line copy it and paste it 21 times (not 20!). That gives this sequence:

Module_Select_011;BOOL;FALSE;generalised comment without module number.
Module_Select_012;BOOL;FALSE;generalised comment without module number.

etc.

Then I select and delete the whole line of the first paste completely and now I just need to edit the Name in the second entry to remove the "1" and I've got my second module entry done. Down to the next one and edit again. Each edit only takes 4 keystrokes and I've got my 21 modules done in no time. Actually in practice I first paste down to module ten, then copy it for the remaining modules, so that I don't have to delete and replace two characters.

As usual with Windows, By using the Shift or Ctrl. keys you can highlight more than one line and copy all that you've marked.
 
The scan time will increase as each db reference causes an implicit open DB instruction.



In principle you're correct, but I have one big DB that holds all my general data, so as a rule it's already open. That accounts for about half of the Merker.

The rest are local flags or Flank detectors that really belong inside the STAT declaration of an FB. However, when I started this project, I didn't fully appreciate how to make full use of local memory (in both FBs and FCs), so there's a lot stuff being done with Merker, which would be better done elsewhere.

I've learnt so much since I discovered this forum, that there's quite a lot of tidying up to be done on the early stages of my project!:oops:
 
Oh boy, I'm going to enjoy this - I can tell Jesper how to do something!
I dont want to cut you down, but I allready knew how to cut-and-paste multiple lines in the DB editor.
Actually I was more after being able to just highlight the symbolic names, or only the type, or only the comment lines, and then paste from for example Excel.
In fact, what I am after is the functionality of the symbol editor.
Why doesnt the DB editor work the same as the Symbol editor ?
I know that when editing like that, there will be errors that the editor will not accept. But just like the symbol editor, the errors just have to be cleared before you try to save the DB.

But thanks anyway :)
 

Similar Topics

All, I am trying to reset timers when a Work Order change occurs. The Work Order comes in as a string and I am comparing it to a tag...
Replies
2
Views
69
I'm a Siemens person, and this is one of my first AB programs. The customer wants everything programmed in Ladder. I have a lot of data (3...
Replies
14
Views
241
Hello, I have a compact Logix plc and I have been task with configuring alarms into our SCADA when an Analog signal stops moving. The analog...
Replies
6
Views
260
Hello, i am a beginner with a Siemens Logo 8 PLC. I would determine the direction of an object if it passes a whole cycle of 2 input sensors. See...
Replies
2
Views
199
Can an AOP be removed from Logix? I seem to have some version weirdness from an E&H AOP and I need to see if reinstalling the AOP will correct it.
Replies
5
Views
997
Back
Top Bottom