![]() These make up the Modbus hold registers, and begin at register 40001, continuing for the length of my data array, to register 40010. In this tutorial, we've pointed to an array of data (“DataArray”) within a global data block (“Modbus_server_data”).īelow, my data array ("Modbus_sever_data".DataArray) contains ten words of data that I'm exposing as a Modbus server. This pointer can be any global data block or a memory area (M), and are used for Modbus functions 3 (read Word), 6 (write Word), and 16 (write multiple Words). MB_HOLD_REG: This defines the location (start and size) for the available Holding Registers (40001 to max defined register).MB_ADDR: This corresponds to the Modbus Slave ID, which your master will use to reference this server.There are only two inputs here: MB_ADDR and MB_HOLD_REG, explained below: ![]() You can call this block anywhere in your program and store its data in a single or multi-instance data block-it won’t affect your server. Parameterizing Modbus_Slaveįor this tutorial, I’ve called my Modbus_Slave block in OB1 and created an instance data block (DB5) for it. The Modbus_Slave block is the simplest, so we'll start with that. The Modbus_Slave block configures the data in your server. The Modbus_Comm_Load block configures your connection module for communication using the Modbus RTU protocol. You can find both of these in the “Communication->MODBUS (RTU)” folder.įor reference, you would use the Modbus_Master function block to set up a Modbus master, or client, on your PLC. Siemens Modbus RTU servers center around two built-in instruction blocks, Modbus_Comm_Load and Modbus_Slave. This will configure your port to use the Modbus protocol, and to accept its port parameters from the Modbus_Comm_Load instruction, which we'll talk about later. Set the Protocol of your port to Freeport/Modbus. In your communication module's device view, navigate to the port interface (in the example image, RS-232 interface), then port configuration. Since S7-1500 PLCs don't typically come with onboard serial communication ability, you'll need to use an adapter module that supports the Modbus RTU slave protocol, with a port interface that meets your system connection requirements. When a transmission error occurs, specify the SJ-Ether device that stores the error details.Need to make data available from your 1500 PLC to a Modbus RTU master?Īs long as you have a Modbus RTU capable serial communications adapter module, setting up a Modbus RTU server is pretty simple. Specify the SJ-Ether device to be used as the transmission error flag. Specify the SJ-Ether device to be used as the transmission success flag. Specify the SJ-Ether device to be used as the sending flag. Specify the TCP port number to use when writing. Specify the IP address of the other device you want to write to. Specify the size of the data you want to write. SJ-Which data of Ether is written to the other party. Specify the start address of the device you want to write to. Specify the function to be used when writing. When a reception error occurs, specify the SJ-Ether device that stores the error details. Specify the SJ-Ether device to be used as the reception error flag. Specify the SJ-Ether device to be used as the reception success flag. ![]() Specify the SJ-Ether device to be used as the receiving flag. Specify the TCP port number to be used when reading. Specify the IP address of the other device you want to read. Specify the size of the data you want to read. Where to bring the read data to SJ-Ether. Specify the start address of the device you want to read. Specify the function to be used when reading. 3 fixed.Ĭheck the manuals of each slave product company. The details of the ERX / EWX instruction are explained in detail in the help of KPP. (7) If you want to read the data of the slave station into SJ-Ether, use the ERX instruction. (6) If you want to write data from SJ-Ether to the slave station, use the EWX instruction. (5) The server (slave) setting may be the factory default value, but if it overlaps with the TCP port number you want to use at the master station, change it. (4) Set the timeout / retry count / timeout time in the client (master) settings. (3) Click “Modbus / TCP Clients and Servers”. (2) Check “Modbus / TCP Client and Server” for protocol settings. (1) Set the IP address and subnet mask of SJ-Ether in Port3 of “PLC”-> “PLC setting”-> “general-purpose communication port setting” of KPP (Koyo PLC Programming software). The outline of the procedure for using SJ-Ether is as follows. (For slave station settings, see the product manual of each company you are using.) For details, see Chapter 4 4-4 MODBUS / TCP Communication in the SJ-Ether User’s Manual.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |