发表于:2005-11-03 14:18:00
楼主
分为下面几步:
1:首先安装"打印到文件"的打印机驱动
2:把DB块的数据打印到文件
3:从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&nb