8/19/2016 5:21 PM | |
Joined: 9/27/2006 Last visit: 3/19/2025 Posts: 12344 Rating:
|
Hello marvin; I am not sure I understand your question. First, is this a Modbus RTU (serial, RS-232 or RS-485), or a Modbus/TCP project? The manual you refer to describes the S7-1500 master, or your slave? To my knowledge, to write to multiple registers you must use Modbus function 16; that way you can access up to 124 regiters of the type 40000 in the slave; so you must specify to the master which slave he will access( the slave address), which Modbus function he will use, how many registers or bits he will read/write, starting at what offset in the «modbus register adrtesses, See how it is done in the relevant sample projects that follow: Tips : S7-1500 – Modbus RTU https://support.industry.siemens.com/tf/ww/en/posts/104271/ How do you program and parameterize Modbus/TCP communication between S7-1500 CPUs and S7-1200 CPUs? https://support.industry.siemens.com/cs/ww/en/view/102020340 Hope this helps, Daniel Chartier |
8/19/2016 7:17 PM | |
Joined: 9/27/2006 Last visit: 3/19/2025 Posts: 12344 Rating:
|
Hello marvin; To setup Modbus RTU on a S7-1200 CPU (as a master), you need 2 instructions: - MB_Load: sets parameters for communication (baud rate, parity...) - MB_Master: sets the parameters to exchange data with a slave I have attachjed an extract form this manual that explains how MB_Master parameters are used: S7-1200 Programmable controller https://support.industry.siemens.com/cs/fr/en/view/36932465 You select the Modbus function you want to use as part of the MODE parameter; Function 16 is MODE= 1, or 2; see page 4 of the document i attached. Then you prepare the data to be written inside a DataBlock that you refer to in parameter DATA_PTR, .See the examples I proposed in my earlier reply for more details. Hope this helps, Daniel Chartier AttachmentS7-1200 Programmable Controller manual - MB_Master intruction.pdf (734 Downloads) |
This contribution was helpful to
1 thankful Users |
11/11/2018 4:09 AM | |
Posts: 1 Rating:
|
Tkanks you very much, you save my day. ^^ |
Follow us on