12/21/2017 7:58 AM | |
Joined: 12/4/2009 Last visit: 4/25/2024 Posts: 452 Rating: (134) |
Hi, directly from Excel - no. Bot there are workarounds. You can always make VB macro that will generate STL/SCL source file which can be compiled to FC/FB/DB blocks. For DB only generation it's even simplier, please check the following link: Automatic generation of an S7 data block with STEP 7 V5.x from an MS Excel 2003 table Another workaround is called Simatic Manager S7 Command Interface, but that implies using higher programming languages in order to generate code from Excel. Hope this helps. Regards. |
Last edited by: Jen_Moderator at: 12/21/2017 2:26:03 PMInserted right link. If this post actually helped, you may consider using the Rate button above. |
|
This contribution was helpful to2 thankful Users |
12/21/2017 5:38 PM | |
Posts: 664 Rating: (17) |
Hi crazyCow, Thanks for your valuable reply.. Thanks for the link shared.... Can you able please discuss about " Simatic Manager S7 Command Interface" that you mentioned. Thanks&Regards, |
12/22/2017 7:31 AM | |
Joined: 4/11/2012 Last visit: 12/4/2023 Posts: 176 Rating: (34) |
Attached is a very simple code piece of code in Excel. I made the original code in LAD / FBD, then generated STL code from it and copied that code to the Excel. It's only text. I can edit that text in Excel. In the LAD/FBD, I made three networks where a numbered variable is checked and modified. In the Excel I made crude changes to the code under "Alternative networks" column that support performing copy & paste for duplicating the same network infinite number of times with actions performed on a variable with running number in symbol name. The way I would use that code, is I would modify only the middle part of the code in excel and copy & paste the edited version of it back to the STL source. Then I would compile that STL source. When the original FC is opened in LAD/FBD editor, it will appear as STL code, but that's only the default view. It can be shown as fully functional LAD/FBD also. I have used excel for various pieces of code, usually when I had to do the same operation 100 times in a row. There are at least two stages for the excel you will be using: Step 1: Excel code similar to the one I attached to this post. Quite rigid structure. To edit the functionality, you need to make modifications to one network and then copy / paste that network all over the excel. Step 2: More complex excel to create but once made, can be used for many different functions. Based on the idea that a single whole network is given only once and there is code that copies the given network as many times as needed, automatically updating variable names. To make this, the given network will have all changing numbers as ??? that the formulas in excel will modify to running number. Note: I have not used macros in Excel, so I don't know if using them would make this work easier. I currently have an excel where I can input the network(s) I want to duplicate, and the formulas change it to code ready to be used in STL source. Attachmentcode with excel.xlsx (132 Downloads) |
Follow us on