8/19/2014 8:12 AM | |
Posts: 24 Rating: (1) |
Hi guys, I needed few clarifications regarding the Sample Program that is posted on the Siemens Support to configure Modbus RTU for S7-1200. You can find the linkhere. In the program section for the Slave configuration, a DB named Slave_Data [DB3] is created. The DB looks something like the file in the attachment. Here are the few clarifictions that I need to understand the program: 1. I understand Receive_0 and Receive_1 is for the READ data and Send_0 and Send_1 is for the WRITE data. What I'd like to know is why have they configured them as INT data type when BYTE is also available. 2. Those entries, as they have INT data type, have Offset of 2 between them. So is it like: Receive_0 has 400001 (and 400002) Receive_1 has 400003 (and 400004) Send_0 is for 400005 (and 400006) Send_1 is for 400006 (and 400007) Please correct me if I have misunderstood anything. 3. If we use BYTE data type for the elements, can we use Receive_0 for 400001, Receive_1 for 400002, Send_0 for 400003 and so on? 4. Why does the Send_0 has Start Value 22222? 5. Why is STRUCT used for MB_HOLD_REG used and not ARRAY? I am very sorry for the long list of questions. But I had to ask them in order to have a full clarity regarding the program configuration. I would appreciate your valuable inputs. Thanks, Parshva |
8/21/2014 2:28 PM | |
Posts: 24 Rating: (1) |
Hello everybody, I would really appreciate your valuable inputs on this. Thank you. Best Regards, Parshva
|
8/22/2014 6:27 PM | |
Joined: 11/21/2007 Last visit: 3/14/2024 Posts: 2323 Rating: (307)
|
Hello parshva Some of your queries have already been answered by Fafner. Let me try and answer others :
1. Modbus Registers are structured as 16 bit registers ( Words ) and numbered accordingly. You can however Read / Write two 8bit ( Bytes ) values in one Modbus Register, or evenOne 32 bit value ( DWORD / 32 bit float ), can be read / written as two registers. ( i.e. 1 Register = 1 Word Value or 2 Byte values , 2 Registers = 1 32-bit Integer / Real value ) 2.As explained above Modbus Registers are structured as 16 bit registers. Accordingly in your DB if Receive_0= 40001 then Receive_1= 40002 and so on 3. NO ! pl see my reply to your point no-2. Even if you make a byte structure, The Modbus register numbers will cover complete words. e.g. Word1 (Byte1+Byte2) = 40001and Word2 (Byte-3+Byte4) = 40002 4. - This is the value input by you. You can change itby editing the DB Structure. 5 - Already answered by Fafner Hope this helps Cheers Navnag |
There is no such thing as the last bug in a program |
|
This contribution was helpful to1 thankful Users |
Follow us on