S7-1200 Modbus

B

Thread Starter

Barbican

Hi

I am kind of stuck with this... I got a S7-1200 CPU (1215C) with the RS485 communication module (CM1241). My plan is to read data from a genset controller that i have (DSE 8610) via Modbus. Am stuck with the Modbus part, i can't figure out how to get for example the data like the "Plant battery voltage" from the DSE controller to the PLC. Does any one here have a sample project on TIA13 which is programmed to read for example the DC voltage on the DSE controller "Plant battery voltage" using Modbus? I am planning to use this as a reference to figure out how this is done correctly.

PS

In the DSE manual it says that a formula is used to get the data address. this is the formula mentioned in the manual
(Data Address = Pagenumber x 256 + Register offset). i am a bit confused here. the offset is a single number. if i got this right, why are some offsets mentioned like this:<pre>
Plant Battery Voltage Register Offset: 0-1
Engine RPM Register Offset: 2-3
Engine Temperature Register Offset: 4-5</pre>
How are these offsets calculated using the formula mentioned above?

I am not sure you guys have time to help but your support in any way will be highly appreciated.

Thanks in Advance
 
I haven't seen the use of a "page number" before, but the formula is similar to an industrial wireless gateway's register addressing.

The wireless gateway collects data from multiple wireless field nodes. Each node has 32 registers. Each node has a node ID number, 1 - 32.

All Modbus data is in holding registers in the (4)xxxxx memory area.
Data is in integer format, using one, 16 bit Modbus register for each integer data value

The formula for accessing any given data point is<pre>
node ID * 32 + register offset.

node 1's data will reside in registers (4)0033 through (4)0064; 1 * 32 + offset 1 through offset 32
node 2's data will reside in registers (4)0065 through (4)0096; 2 * 32 + offset 1 through offset 32</pre>
The field node radio's documentation then describes which data value has which offset, just like the examples you provided.

In your case the plant battery voltage uses two registers, 0 & 1, so it is likely a 32 bit floating point, given that each Modbus register is 16 bits, although some devices use 32 bit long integers.

The page numbering concept is likely similar to the node concept, you just need to find out what a page represents.

This type of data is normally in Modbus Holding Registers accessed by Function Code 03.
 
Hi David

Where i am stuck at now is the part where the data is in two separate 16bit registers. I don't know the trick behind combining the two registers at the PLC and displaying them as one meaningful value. I'm using S7-1200 Siemens CPU. any information would be very helpful.

Thank you
 
I don't know the trick either. I have no Siemens experience.

You might try looking through the Siemens app note for Modbus between an S7-1200 and an energy meter. It has references to both real (floating point) and UDint (unsigned double integer) formats.

Go to this page, scroll down to downloads, it's the first download on the list:
http://tinyurl.com/jpxg7og
 
You say that the data is in 2 16 bit registers - is this simply a REAL format? I don't know your level of experience so this may be teaching you to suck eggs - if you have a 16 bit Word say MW20 and a subsequent 16 bit word in MW22 then displaying as a REAL (if indeed it is iEEE format) is as simple as displaying MD20.
 
Top