8/9/2010 8:35 PM | |
Joined: 12/22/2006 Last visit: 1/25/2022 Posts: 1742 Rating: (309) |
Hello, In this Manual (Manual SENTRON Expansion Module PAC RS485), you will see at p.35 that the registers for the values you mention are: start register 63, 2 regsiters wide: Total Apparent Power value type: Float Unit: VA start register 65, 2 regsiters wide: Total Active Power Float W These can be read using the Modbus function code 3 or 4 A float is 32 bit wide, and a modbus register typically 16 bit wide. Therefore two consecutive registers are used. In the S7-1200: The MB_COMM_LOAD function block configures a port on the Point-to-Point (PtP) CM 1241 RS485 or CM 1241 RS232 module for Modbus RTU protocol communications. The MB_MASTER function block allows your program to communicate as a Modbus master using a port on the Point-to-Point (PtP) CM 1241 RS485 or CM 1241 RS232 module. The MB Master has the following parameters (among others) MODE: Mode Selection: Specifies the type of request: read, write, or diagnostic Mode 0 allows to read registers (see page 191 of the system manual of the S7-1200) DATA_ADDR: Starting Address in the Slave: Specifies the starting address of the data to be accessed in the Modbus slave. If you use 30063 as data_addr, you will read starting from register 63 DATA_LEN: Data Length: Specifies the number of bits or words to be accessed in this request. Here you specify 4 registers (to read from 63 to 66 at once and get both data with one request) DATA_PTR: Variant Data Pointer: Points to the CPU DB address for the data being written or read. The DB must be a "NOT symbolic access only" DB type. Here I would try to define a DB with a named structure with the two floats in it. |
Best regards |
|
This contribution was helpful to3 thankful Users |
7/7/2016 3:25 PM | |
Joined: 9/3/2014 Last visit: 3/13/2019 Posts: 4766 Rating: (122) |
New question published by AutoGen_1020194 is split to a separate thread with the subject CB1241 connection to PAC 3100. Best regards |
Follow us on