Technical Forum

STEP 7 / STEP 7 Lite

Is there a simply way to import DB from STEP7 to Excel file??

Thread Starter: Andrzej   Started: 11/9/2005 4:28 PM   Replies: 5

« Previous thread Next thread »
Page 1 of 1 (6 items)
  11/9/2005, 4:28 PM
Joined 11/3/2005
Last visit: 12/20/2006
Posts: 23
Rating:
Rated: Very Good [2 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello,
I'm looking for a solution of simply export DB to Excel file. I know that there is a way to import DB from Excel to Step7.
Thank You for response.
Andrzej
Top
  11/11/2005, 10:59 AM
Joined 10/17/2005
Last visit: 5/23/2006
Posts: 25
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 

Hi Andrzej,

This may help you.

subject: HOW TO IMPORT STEP7 DATABLOCKS INTO EXCEL97


You can easily copy the contents of a Datablock and paste it to an Excel spreadsheet.
Unfortunately this operation does not allow to paste the variable addresses within the
datablock. It is a minor problem if all the data belongs to the same datatype (eg. all
integers or all Reals), but if you have a Datablock created using structures with mixed
data types, it is a real trouble.

Here comes a way to fix it:
a) install a "print to file" driver in Windows
b) print to file the datablock
c) import the file in Excel


How to install the "print to file" driver in Windows
------------------------------------------------
- in Windows' taskbar, select "setting" menu, then select "printers"
- click on "install new printer"
- select "local printer"
- from the manufacturers list, select "generic" (generic/text only)
- when assigning the printer port, select "file"
- finish installing the printer
- now in the "printer" folder, you have the "Generic/text only" printer
- select "Generic/text only" printer, click with right-mouse button and select "properties"
- on the "properties", select the "paper" tab
- scroll all the paper sizes and select "user-defined size"
- assign the largest possible values (this ensures no carriage returns when printing
  long Datablock vars and comments)
- in "Paper source" list, assign "continuous, no page break"
- click "Ok" and terminate.

How to print a datablock to file
---------------------------------
- open your datablock in Step7 editor
- chose "view" menu  and select "data view" (this ensure address to be printed for
  each variable).
- From the "file" menu, select "print setup"
- select "Generic/text only" printer and "user defined size".
- From the "file" menu, select "print" (there is no need to select the "print to file"
  checkbox of the dialog window).
- press "Ok" ant type the name of the file to be output.
- start the printing


How to import the file to Excel
-------------------------------
- open the printed file with any editor
- remove all the pages header and footer that the Step7 editor has added (I think there
  is no way to avoid them to be printed...)
- save the file
- open Excel and open the file
- Excel displays a window where you can assign the data separators
- select "fixed width" and go to next step
- move the first limit to just before the variables name
- leave the second limit at the beginning of the data type
- add a new limit after 4 chars (this limits the data type to be displayed with
  four chars only)
- add a new limit just before the variables comment.
- go to next steps and have the file imported
- from Excel spreadsheet you may have to delete the "values" column, but this is a minor problem.

Thanks

Top
  11/11/2005, 3:21 PM
Joined 11/3/2005
Last visit: 12/20/2006
Posts: 23
Rating:
Rated: Very Good [2 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I am doing exacly as You mentioned above. I thought that is easier way of doing this import DB.
Thanks for response.

Top
  11/13/2005, 11:41 PM
Joined 11/13/2005
Last visit: 11/14/2005
Posts: 6
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Perhaps there is, what are you trying to do exactly?

I have a program that generates an .AWL source file from a DB, optionally saves it to Excel, and then imports some or all of the DB symbols to WinCC. The Excel file has 3 columns- symbol, address, data type.


But, I later realized it is bad practice to use internal data in WinCC, and to even use data of multiple DBs in WinCC.

If your interested, I can give you a copy.
Top
  12/16/2005, 6:24 PM
Joined 9/23/2005
Last visit: 3/15/2010
Posts: 678
Rating:
Rated: Outstanding [3.77 out of 5 / rated 79 time(s)]. (79) 
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 

My suggestion:

Open the data view of the DB, mark all lines, control + C, open Excel, selects the first cell (not row), control + V. Works with STEP 7 V5.3.


Denilson Pegaia
Siemens Mercosur / Brasil
Automation and Control Division
- Technical Support & Hotline -
Top
  3/1/2007, 8:35 PM
Joined 3/1/2007
Last visit: 12/9/2007
Posts: 4
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Check S7XP Manager: www.s7xp.com
1. Write online plc data block values back to step 7 project
2. Export datablock to excel or csv
3. Data logger functionality
4. Trending

All based on original step 7 project files.
Top
Page 1 of 1 (6 items)
Actions