7/26/2010 6:32 AM | |
Joined: 3/30/2010 Last visit: 7/26/2021 Posts: 13 Rating:
|
Hi, I have a CP341 (6ES7 341-1CH02-0AE0) RS485 communications module and have purchased the Modbus master licence and dongle to go with it to make it a modbus master. now I want to read the boiler Information by using this card. I use this card 1 st time. their are 3 boiler and all 3 boiler information came in single slave. see the attachment. i want to read this boiler information. How the write the logic for this? i read the manual but cannot understand. please help me. kiran AttachmentWyeth_CB_Modbus_Mapping_R1.pdf (175 Downloads) |
7/28/2010 10:06 PM | |
Joined: 9/27/2006 Last visit: 3/27/2025 Posts: 12344 Rating:
|
Hello kiran; To write code on a Siemens PLC to configure a Modbus master, you have to understand a bit of Modbus, and a lot of Step 7, I am afraid. For more information on the following details, please refer to the Modnus Master manual that you alreadyhave. http://support.automation.siemens.com/WW/view/en/1220184 First steps first: let'start with this: Modbus uses various Functions to request data from its slaves, and each request is grouped by "jobs". And let's say that your 3 slaves use addresses 1, 2 and 3. In your case, you will be requestingfrom each of the 3 slaves96 Input bits (with starting Modbusaddress 10000, offset 0001-0096), and for this you will need Modbus Function 02. You will also be reading from each of the 3 slaves72 holding registers (with starting Modbus address 30000, offset 0001-0072); this will require ModbusFunction 04. So you will need 2 jobs for each one of your slaves, one for Function 02 and one for Function 04, 6 different jobs in all. For details on the folling section, look at the chapter on Function Codes in the suggested manual: For each job, you will construct 2 DBs: a SEND_DB and a RCV_DB. They will contatin the information required by your S7 program to request and recieve data from the slaves. A SEND_DB contains the slave's address, the Modbus Function code (either 02 or 04 in your case), The bit start address (start of offset, 01 in your case for both functions) and the number of bits or registers you request: 96 for Function 2 and 72 for Function 4. The RCV_DB will create the destination area where you will store the arriving bits (Function 02) or words (Function 04). Once this is done, use the example application in the manual, using the various SEND_DB and RCV_DB you have created to access your slaves one by one. This will be a validation of basic communications. Byte swapping issues, reading 2 registers (16-bit each) as a DINT or a REAL value can be dealt with later. To gather all the required data, you will have to call (request data from) first your Function 02 on slave 1, followed by Function 04 for slave 1, then Function 02 for slave 2, Function 04 for slave 2.... Next use these different discussions tpo help you better understand issues with the different Modbus functions; the last link also provides you with a program by member DR75 to connect to multiple slaves, you can preobably use it as a basis for your own application. Discussion on Function 02: /tf/WW/en/Posts/44226 Discussion on Function 04: /tf/WW/en/Posts/43381 Discussion and code for accessing multiple Modbus slaves: /tf/WW/en/Posts/16268 Hope this helps, Daniel Chartier |
Last edited by: dchartier at: 7/29/2010 4:33 AMLast edited by: dchartier at: 7/28/2010 10:07 PM |
|
This contribution was helpful to
3 thankful Users |
Follow us on