S7 export DB symbols and comments.

JesperMP

Lifetime Supporting Member + Moderator
Join Date
Feb 2003
Location
ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts
16,320
Here is another STEP7 specific question:

Can I export/import the symbols and comments that are declared in each DB.
I can export/import the symbol list to an excel file. Great. But this symbol list doesnt contain the variables that are declared inside the DBs.
I would like to export and import these in order to edit the comments. I wont touch the symbols.

Cannot find anything that could help me in this way, but maybe one of the gurus out there knows better ? (I am crossing my fingers).
 
I have exactly what you are looking for Jesper. I do that all the time to generate tag files for HMIs.

Open the DB and view it in Data View. Then, click File>Print, and choose "Print To File". For the printer, choose "Generic, Text Only" (you may have to install it from control panel). In Properties, choose Landscape. Now comes the tricky part: You may have to play around with the Advanced Properties a bit. I get good results when using B4 paper size. If I use a smaller paper (even though I'm actually just printing to a file), the text file won't always look right, and a lot of the tags will word-wrap.

Now, click "OK", and it will prompt you for a file name. Enter a name and it will start saving the DB as a "PRN" file, and you can then open it with WordPad.

To really get a lot of benefit from this, you can now import the PRN file into Excel and create a CSV file. Once you do that, you can do anything you want with the tags (sorting, deleting, etc). I sometimes stick little codes in the Comment field in my DB to define the tag type (Read Only, Read Write, etc), and then with an Excel Macro I can automatically convert the tag list into someting that an OPC Server can use, for instance. Once you get a handle on it, you won't know how you lived without this method.
 
You again S7Guy ! :D

Thanks, I would never have figured all that out myself.

But it falls a little short of my dream. To be able to edit the comments in an excel file, and then import them back into the STEP7 DB declaration file.
The editing inside STEP7 is really clumsy, there is practically no cut and paste (you can only edit one adress at a time).

Maybe its too much to ask for, but thanks anyhow. (y)

I am thinking about generating the source file for the DB and go on from there. I have manipulated the DBs via export/import back and forth between source and excel before. Maybe that is the way to go.
 
Hello Jesper;
The easiest (not the finest, mind you) to do what you want is to Generate a Source File (from the File menu, in the programming editor). Use the dialog boxes that appear to name and select the blocs you want to send to the Sources directory (in the Program section of the project).
Open the source file (it will open with the same programming editor): you will see the text version of your DB and you can edit the comments directly. You can also choose to open the file with a text editor (with a *.awl extension), or send it to Excel.
To return the DB in a step7 format, Compile it in the programming editor. Your changes will be brought back into your original DB.

I have also used procedures (for printing and exporting Step7 blocks) suggested by Luca Gallina, at runmode.com. His website does not respond this morning, but maybe you can have a look a little later. I find he is much more creative than I am in these matters.

Hope this helps,
Daniel Chartier
 
Ok daniel,

I am going to experiment with that, and if I figure out something clever I will keep this thread posted about it.

But thats going to be next week...
Have a nice weekend. :)
 
Jesper, maybe there is another way around this, depending on why you want to edit the DB.

Do you make liberal use of UDTs? If so, you can make the change in a name or comment in the UDT, and it takes effect everywhere that you use it. Unless I misunderstand your question, maybe changing the way you create DBs will solve your problem.
 
S7Guy,

the main reason is the use of adresses to represent alarms.
I have three locations where they must be defined:
In the operator panel (OP270 series).
In the S7 - raw alarms.
In the S7 - alarms with memory.
To cut down on errors (and hazzle) I want to edit one time and then copy to all three places.
I have this working now, but it is with Merker memory. I would like to change to DB memory.

gotta go now...
 
Hello Jesper;
I forgot to mention how you export and import your source file:
to export, right-click on the source you generated, and Export Source( a LIST source, *.awl, is your best bet; it can be opened with Notepad). You can create multiple copies of this file and import them all back to the sources directory, to create more than one block from one source.
to import, right-click on the Sources directory, Insert New Object, External source, and select your modified file(s). Then right-click and Compile it back into your blocks.

Tell us how it goes.
Hope this helps,
Daniel Chartier
 
Have figured it out by now.

OK, for your information: I have figured out how to solve my problem by means of manipulating the Source with Excel.

Here's how (if any are interested):

Problem:
All the alarms texts in a project with STEP7 and Protool has to be entered 3 places, in the Protool alarm messages, and in the two S7 DBs that holds the raw alarms and the memorized alarms.
This is a hazzle and a source of errors.
How to edit only one place and then copy the texts to the two other places ?

Solution:
1. Create the alarm texts in Protool. You can use cut and paste, also with several alarm texts at a time.
Pitfall: If you copy-and-paste entire alarms by highlighting them with the cursor in the left side of the window, then you will also highlight and copy the info text that is defined for the alarms in question. Be sure to constantly update the info texts together with the alarm texts.
Tip: If you assign a number to each alarm in the text body, then let the number contain the word and bit address that triggers the message. You can see the address in the lower right corner of the window. Notice how the bit adress has the odd S7 order, so the text should be like this:
Alarm 1: "AL01_00" (adress Byte 1 bit 0)
..
Alarm 8: "AL01_07" (adress Byte 1 bit 7)
Alarm 9: "AL00_00" (adress Byte 0 bit 0)
..
Alarm 16:"AL00_07" (adress Byte 0 bit 7)
Alarm 17:"AL03_00" (adress Byte 3 bit 0) etc..
This will help you greatly to identify the adress later.
Now use the Languages .. export function in protool to export the alarm texts to a CSV file. Set the function up to only export the alarm messages.

2. Create the alarm DBs in STEP7.
I find it most handy to set up the DBs with a STRUCTs of 16 BOOLs each. That makes it easy to refer to a word at a time and to a bit at a time. Like this (example with 2 alarmwords only):
STRUCT 	
W00 : STRUCT //Alarmword 00
b00 : BOOL ; //comment w00 b00
..
b07 : BOOL ; //comment w00 b07
b10 : BOOL ; //comment w00 b10
..
b17 : BOOL ; //comment w00 b17
END_STRUCT ;
W02 : STRUCT //Alarmword 02
b00 : BOOL ; //comment w02 b00
..
b10 : BOOL ; //comment w02 b10
b11 : BOOL ; //comment w02 b11
..
b17 : BOOL ; //comment w02 b17
END_STRUCT ;
END_STRUCT ;

Then generate the source for the DBs.

3. Open two sessions of Excel.
Open the CSV file with the 1st session.
Open the DB Source file with the 2nd session.
Specify TAB and "/" as delimiters for the 2nd session.
Tip: You will probably find the Source file with an .AWL extension in the directory "s7asrcom" in the STEP7 project directory.
Now you can copy-and-paste the alarm texts from the 1st session to the 2nd session. Keep a close eye to the adresses so that they are syncronised.
Insert "//" in the column before each text comment in the 2nd session.
Save the 2nd session and exit it, choose "No" when asked to save in Excel97 format.

4. Open the DB Source file again in STEP7. Use the "compile" function.
Open the DB block file in STEP7. Check that everything is correct.
Copy the DB block file to one more DB block file.

Viola - You have now all your alarms texts in all the right places.

The above description looks more complicated than it actually is.
Needless to say, it only pays off if you have lots of alarms. I normally have around 500 in a project.
 
Problem:
All the alarms texts in a project with STEP7 and Protool has to be entered 3 places, in the Protool alarm messages, and in the two S7 DBs that holds the raw alarms and the memorized alarms.
This is a hazzle and a source of errors.

There is another way to enter alarm text's in Step 7. In the symbol editor you right click on a memory and choose message. Now you can tie both alarm and info text and associate values from other operands to one individual memory. When all text's are entered you have to generate new system data in the menu edit generate SDB. Later you can use SFC17,18 and 19 to send the alarms to the operator panel. No configuration besides checking the Alarm_S function in the message settings menu in Protool is needed.

Siemens also have very powerful tools to do this. They are called Proagent for the panel and Pdiag for Step7 with this to packages you can write individual logic to every alarm including individual timeout times and the best part is that the panel can evaluate the source of the error. For example you have 10 gates on one machine all you have to do is to tie all the gates to one alarm memory and Proagent can display the source of the error in an alarm box with both the symbol and the comment. If more then one gate is open you can have the network displayed in Ladder or stl directly on the panel there all the conditons with symbol and comments are displayed. If you deside to add one more gate just recompile Pdiag download the block and the panel configuration and you are done. Extremly powerful!
 
Hi Bratt,

I have shied away from the ALARM-S system before for a number of reasons.
One is that it only works with Siemens PLC combined with a Siemens HMI. I like to keep my methods the same regardless of the PLC/HMI type.

But maybe I should evaluate my methods again.
You say: "When all text's are entered you have to generate new system data in the menu edit generate SDB." Do you have to do this every time you make or change an alarm text ?
How about multilanguage, how does ALARM-S handle this ?
 
The message text is the same for all languages if you define the text's without pdiag.Its also necessary to generate and download the sdb's if you change a message (Downside the plc has to be in STOP).

Atleast i think so i never used this in a real project just exeperimented a litte in the shop.

Pdiag on the other hand ive used.

With Pdiag you can have diffrent texts for diffrent languages and if you change a text its only necessary to download the FB's generated by Pdiag and recompile the panel. The only downside using Pdiag is that it only works with Siemens panels and Proagent requiers a runtime license (works without but you get nasty messages) but on bigger projects with Siemens hardware i just cant see no reason not to use this because its so powerful.

I attached a picture of a simple alarm displayed on a Protool pcpanel.

proagent.jpg
 
I have looked into the FC107 ALARM_DQ and FC108 ALARM_D.
It looks like a VERY steep learning curve for this one. Have found some examples on Siemens FAQ webpage. Even with this I think it will take me at least a week to get into this properly.
And as I am working with an OEM that ships worldwide, multilanguage with language change on the fly is an absolute prerequisite.

So I think I will let it fall. But thanks anyhow :)
 

Similar Topics

Hello to all, Is it possible to export Codesys symbols to .txt, .csv or .xml in a similar manner like exporting symbol table in STEP 7? For...
Replies
0
Views
126
Trying to export a Modern application for an upgrade to Intouch 2020 but I cannot export the application from the 2014 version because the export...
Replies
2
Views
108
Hello, Does anyone know how to export the EDD files for a device in DeltaV Explorer 12.3? I can export the .fhx, but I have no idea how to get...
Replies
8
Views
128
Hi, I'm trying to export data from a DataGrid to Excel using VBA, but I'm getting an error "Object doesn't support this property or method". The...
Replies
0
Views
77
Good morning, I have a Emerson/GE PLC with Cimplicity SCADA. I need to export data of a specific point/object to a CSV file and load the CSV file...
Replies
7
Views
281
Back
Top Bottom