Using SIWAREX FTA within STEP7 Quick Guide For modules with order number 7MH4900-2AA01 Contents 1 Introduction ................................................................................. 2 2 Organisation of the memories ................................................... .... 3 3 Communication concept .......................................................................... 4 4 Order to SIWAREX FTA ............................................................... 5 5 Reading and writing data's ............................... ............................. 7 (c)Siemens AG SIWAREX_FTA_SIMATIC_Handling_V20.doc; 01/2011 1 Introduction SIWAREX FTA is a calibratable and versatile weighing electronics for SIMATIC S7, C7 and PCS7. It can be used for automatic and non-automatic weighing, e.g. for the production of mixtures, filling, loading, monitoring and bagging. Purpose of this document for functional safety This programming manual contains important information that you will require to commission and use the device. It is aimed at persons who install the device mechanically, connect it electrically, parameterize and commission it, as well as at service and maintenance engineers. Notes on warranty The contents of this programming manual shall not become part of or modify any prior or existing agreement, commitment or legal relationship. All obligations on the part of Siemens AG are contained in the respective sales contract, which also contains the complete and solely applicable warranty conditions. Any statements on the device versions described in the programming manual do not create new warranties or modify the existing warranty. The content reflects the technical status at the time of printing. We reserve the right to make technical changes in the course of further development. Validation of this document This documentation is only valid in conjunction with the manual SIWAREX FTA. (c)Siemens AG SIWAREX_FTA_SIMATIC_Handling_V20.doc; 01/2011 2 2 Organisation of the memories Since SIWAREX is working autonomous with a microprocessor, it has its own memory. A memory inside the PLC communicates with a memory of same structure inside SIWAREX module. All parameters of this memory are split into data records (DR). The data records are organised according to process steps (tasks) that you have to perform during the commissioning phase or during the process itself. Parameterisation of the SIWAREX module is done by writing data's into its memory, Information's about the process is done by reading data's and order are given to SIWAREX by transferring specific data's to the FTA. Data Record communication reduces the quantity of data's transferred to the minimum (c)Siemens AG SIWAREX_FTA_SIMATIC_Handling_V20.doc; 01/2011 3 3 Communication concept The next picture explains how the orders and the data's are transferred to SIWAREX FTA. To read data's, the user program gives a command code to the FB SIWA_FTA, the command for example "read data record 30" has a specific number in this case 230. Receiving this order SIWAREX FTA sends the DR30 to FB-SIWA_FTA, who transfers the DR30 into the appropriate location of DB-Scale. To write data's the user program write first those data's into DB_Scale. Then, the user program gives a command code to the FB SIWA_FTA, the command for example "write data record 22" has a specific number in this case 422. FB SIWA_FTA read the DR22 from the appropriate location of DB-Scale and sends it to SIWAREX FTA. The next screenshot shows the contain of the STEP7 project. (c)Siemens AG SIWAREX_FTA_SIMATIC_Handling_V20.doc; 01/2011 4 4 Giving an order to SIWAREX FTA First you need to know which commands exist. A list of all orders is to be found in the chapter 6 of the manual: A command is send thru defined data's inside the data block DB_Scale. The function block FC Execute_Command. Manage a group of three commands, CMD1, CMD2 and CMD3. Those are foreseen to transfer orders to SIWAREX. CMD3 is used for OB35, CMD2 is used for the HMI panel and CMD1 is usually used by the STEP program. The three command blocks are to be found in the DB_Scale at address DBW40 to DBW50. The background task of OB35 refresh, every 100ms, the DR30, 31, 34, 35 and the ASCII weight with crypto data's for legal for trade applications are also updated. (c)Siemens AG SIWAREX_FTA_SIMATIC_Handling_V20.doc; 01/2011 5 To send a command enter the command code at the address DBW40 as an integer. Then trigger the command by setting the bit s_CMD1.bo.CMD1_Trigger to "1" This bit has to be set with an edge to avoid double triggering of the command. The bit is automatically resetted to "0". Bit s.CMD1.bo.InProgress indicates that the command is running, this can go for several OB1 cycles. Bit s.CMD1.bo.FinishedOK indicates that the command was successfully terminated. Bit s.CMD1.bo.FinishedError indicates for 1 cycle that the command was not completed. The code of the error is given in DB_Scale Byte 9 "b_CMD_Err_CODE" The number that is output is decoded in the table "Data and Operating Errors" in chapter 7.6. The value remains in the output until the next command is triggered. The evaluation is to be performed when the bit CMD_ERR:= "DB_SCALE".bo_CMD_ERR is set. (c)Siemens AG SIWAREX_FTA_SIMATIC_Handling_V20.doc; 01/2011 6 5 Reading and writing Data's The data records described in Chapter 5 of the manual and also in SIWATOOL (see PDF-File SIWAREX_FTA_Quick Guide_SIWATOOL) may be read or written. Always a complete Data Record can be transferred in one or another way. The order number to read a Data Record is "2xx" where xx is the DR-Number. For example read "Data Record 30" which contains weight and state of the scale is done with command "230". Here an example of programming. The order number to write a Data Record to SIWAREX is "4xx" where xx is the DR-Number. For example to define the dosing setpoint you need to write first the value of the setpoint into DR20 this is address DB_Scale.DBD526. Then send the command "420" (Write DR20). DB72.DBX 31.4 is the trigger to write the setpoint coming from the S7 program. (c)Siemens AG SIWAREX_FTA_SIMATIC_Handling_V20.doc; 01/2011 7 If you have any issues or suggestions regarding the related products or documents, please feel free to contact: Technical support for SIWAREX: Siemens AG Industry Automation (IA) Sensors and Communication Process Instrumentation D-76181 Karlsruhe Germany Tel: +49 721 595 2811 Fax: +49 721 595 2901 E-mail: siwarex.hotline.aud@siemens.com Website: www.siemens.com/siwarex Copyright Statement All rights reserved by Siemens AG This document is subject to change without notice. Under no circumstances shall the content of this document be construed as an express or implied promise, guarantee (for any method, product or equipment) or implication by or from Siemens AG. Partial or full replication or translation of this document without written permission from Siemens AG is illegal. (c)Siemens AG SIWAREX_FTA_SIMATIC_Handling_V20.doc; 01/2011 8