Modbus Communication

aprilchu

Member
Join Date
Sep 2004
Posts
26
Dear All,

I want to ask how can i recevice/send data through Modbus.

I use Simatic S7-300 CPU 314(6ES7 314-1AF10-0AB0)
and also I bought Simatic S7-300 CP341 (6ES7 341-1CH01-0AE0) and
the software (I guess) SIMATIC S7, MODBUS Master V3.1 (6ES7 870-1AA01-0YA0)

Moreover, I don't know how to connect them in hardware and software connection.

Do I need to write some programs in order to transfer data ?
Or need to call any function blocks ?

Pls halp me ~
Thx

April
 
Hello!
Modbus communication is very tricky in S7.
You must install the configuration program in Step7.
in this program you must configurate the data areas eg. DB ->modbus value eg.db1.dbw0-dbw10-> 1000-10000 and so on.
You must insert the modbus master (small) card in the CP-card backplane.

The PLC requires programming with standard blocks that are included in the package.

Read the manual for examples(also there is examples on the modbus cd/diskettes)

I personally would not use modbus if it´s possible to use any other communication.
 
CP341 as modbus master

Included two pdf files that together with the modbus sample program forms a working modbus master setup.
It simply reads 10 registers 40001..40010 from modbus address 201. It starts communication by itself and should at least, after the correct serial cable is attached, give you a green flashing light on the CP341.

icon7.gif
Have fun.
icon7.gif


I know that this not an example of neat programming.o_O
 
I have just finished a project using a CP341 card as a modbus master.

I used the standard program that Siemens have in the library and built my program around that.

I call data from 6 different slaves at 1 second intervals. This is used by the plc to set alarms and is displayed on an HMI with a trend chart for each channel of data.

What i do is "Block move" data from the recieve datablock, each time fresh data is recieved into my "Working datablocks"
 
Hi guys,

I am not to firmilliar with Siemens S7 (have worked with them in the past), but from what i understand configuring a Modbus RTU master on a S7 can be tricky and a extra CPU is needed. The use of a gateway is an alternative solution that might be worth considering. There are several vendors to choose from, among others HMS.
http://www.anybus.com/support/support.asp?PID=104&ProductType=Anybus Communicator
The gateway acts as a slave on the Profibus network and can act as a master on Modbus RTU. The anybus gateway can also be used for almost any ASCII protocol. The configuration tool is really easy to use. (No scripts)

Feel free to contact me at [email protected], for any technical questions.

//Patrick L
 
Hi All,
I want to set modbus communication between S7-300 CPU 317 PN/DP with GE Multilin 239 (Motor protection relay)
any body have experience how to set modbus communication between S7-300 CPU317 to GE Multilin 239?

Thx,
Kangzaini
 
Where is Jesper MP? He helped enormously with this - I used a small module that was quite inexpensive and worked a treat - cannot remember what it was - IM something?
 
Fulfill the prerequisites ...

Hi All,
I want to set modbus communication between S7-300 CPU 317 PN/DP with GE Multilin 239 (Motor protection relay)
any body have experience how to set modbus communication between S7-300 CPU317 to GE Multilin 239?

Thx,
Kangzaini

Is that GE Multilin 239 a modbus master or a slave?
In modbus terminology a master requests slave(s) and listens to their answers. A slave is anything that when adressed replies to requests and otherwise keeps silent.
A master may address multiple slaves, normally a slave replies to a single master. The initiative for communciation always comes from the master.
I simply assume that the GE Multilin 239 will be a modbus slave. You have to verify that!
For a slave to reply everything has to be correct:
1. wiring
2. baud rate
3. parity
4. stop bit(s)
5. protocol type RTU or ASCII
6. message type
7. checksum (for ASCII) or crc (for RTU)
If anything is incorrect the slave will play stupid longer than your patience.


This device is a slave that uses the RTU-type modbus protocol. As it uses RS485 as its electrical interface it should also have a RS485 specific address.
A RS485 device is addressed by its device number it may then be addressed by its modbus address.
As it is addressed it may receive the modbus message (type 3, 4 or 16)
if it receives the message it will check if the request is correct by its crc and evaluate the request for further details.
If both the modbus address and crc is correctly receieved a slave will always reply, either with the requested data or with an error message.
 
Last edited:
i have plc kinco cpu508 k-508-40AR if anyone have experience how to connect this cput with modbus communiaction and how read analog data (4-20ma) signal and program for it
 
Read analog inputs

Any plc that says that it is modbus capable may have some deviations on its implementation. If it follows the modbus reference then you should be able to address it and read 30001 series registers.

1. If not readily available look for a modbus tester software on the internet.
2. Set all communications parameters correctly.
- often 9600 baud, even parity or no parity.
2a. There are three ways to communicate: serial binary, serial ascii and ethernet.
3. With the modbus tester try to read something, be sure to have rx & tx properly crossed. Often modbus address 1 or anything else mentioned in the units DOCUMENTATION.
4. Something to read might also be holding registers referenced as 40001, but in the protocol referenced as 0 and message type 3 (single value) or 6 (multiple values). The Modbus reference is freely available on the internet.
5. Beware of the reference numbering schemes: avoid the first numbers as some count from zero others from one, so start at one and verify what you get.
6. Success and stay calm, step by step you will get there.
 
i have plc kinco cpu508 k-508-40AR if anyone have experience how to connect this cput with modbus communiaction
What is the PLC communicating with? Is it a field device that is a Modbus slave/server? Or does an HMI that is a Modbus master/client need to talk to the PLC (which would make it a server/slave).

and how read analog data (4-20ma) signal
reading an analog value via Modbus is common.

and program for it
What is it? Program for what? (suggestion: never use the word it on a forum because it is likely to cause confusion)

Field devices that are a Modbus slave/server need to have a Modbus network address and if it uses serial communications, the serial comm needs to be setup or configured. Modbus server/slave field devices do not really need to be "programmed".

If you mean how to program the PLC to be a master, that's a project, which is typically dealt with by using an example from the PLC manufacturer and editing it for your task.
 
Hi all,

My 2 cents: If you have good implementation of Profibus in your system, and you have with the S7, then don, t struggle with modbus in your PLC. I recommend a Profibus-modbus convertor like the Anybus gateway from HMS.
They are easy to setup, and working perfect as a Modbus Master.
They are not the cheapest in the market, but will save you tonns of time.

greetings
John.
 

Similar Topics

Apologies for not being the best IDEC programmer. I recently was doing some inspections on a site that had 3 FC6A IDEC processors. The issue is...
Replies
0
Views
72
Hi all I need help on this As in my project used Schneider TM241 controller. Now I want to communicate Elite energy meter with controller by...
Replies
3
Views
148
Hello, I need to access the bits from the fire system control panel through RS-485. So, I used Read Var block to read from the panel...
Replies
0
Views
179
Hi, i cant establish communication between fatek plc with an energy meter, both capable for modbus tcp, i did with modscan but fatek plc does not...
Replies
1
Views
149
Hi Guys, I am a new member and this is my first post! I have a little PLC experience but it is mostly with siemens logo and using ladder...
Replies
4
Views
899
Back
Top Bottom