如何把DB块中的数据导入Excel中? 点击:1927 | 回复:3



如火

    
  • 精华:172帖
  • 求助:0帖
  • 帖子:803帖 | 5249回
  • 年度积分:0
  • 历史总积分:0
  • 注册:1900年1月01日
发表于: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



BossTiger

  • 精华:0帖
  • 求助:0帖
  • 帖子:3帖 | 13回
  • 年度积分:0
  • 历史总积分:110
  • 注册:2004年9月03日
发表于:2005-11-03 16:15:00
1楼
好,

sun3751

  • 精华:0帖
  • 求助:0帖
  • 帖子:2帖 | 21回
  • 年度积分:0
  • 历史总积分:29
  • 注册:2005年10月23日
发表于:2005-11-03 16:21:00
2楼
thanks

Siemens2004

  • 精华:0帖
  • 求助:0帖
  • 帖子:8帖 | 131回
  • 年度积分:0
  • 历史总积分:168
  • 注册:2004年10月14日
发表于:2005-11-03 17:30:00
3楼
good!

热门招聘
相关主题

官方公众号

智造工程师