Technical Forum

Communication / Networks

Modbus RTU communication to Sentron PAC3200

Thread Starter: Abyrne   Started: 8/6/2010 5:57 PM   Replies: 1

« Previous thread Next thread »
Page 1 of 1 (2 items)
  8/6/2010, 5:57 PM
Joined 11/26/2008
Last visit: 9/29/2014
Posts: 102
Rating:
Rated: Outstanding [3.33 out of 5 / rated 3 time(s)]. (3) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello,

I have a S7- 1214 CPU connected to a Sentron PAC 3100 via Modbus RTU.
I am trying to access
Total active power
Total reactive power (VAR1)

How do i set up a DB to monitor the values in these registers?
How do i reference the register in the PAC that holds this data? (i.e. what part of the DB do i access?)

Thank you for your help
Top
  8/9/2010, 8:35 PM
Joined 12/22/2006
Last visit: 9/26/2014
Posts: 1421
Rating:
Rated: Excellent [4.07 out of 5 / rated 175 time(s)]. (175) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
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
jklm

Suggestion was helpful? Thanks to rate it.
Top
Thank you for this post from:
Page 1 of 1 (2 items)
Actions