Modbus Protocol

motson

Member
Join Date
Jul 2002
Posts
3
Hello All,
Hi im a new user and i am very interested to see if anyone could help me with my problem. Currently i have a job for a water treatment plant in which i have to use the modbus protocol to talk between two PLCS. The master in this network is Koyo plc which is a DL405 450 cpu. I am using port one on the cpu to comunicate with the other plc which is an Allen Bradley SLC5/03. On the allen bradley there is a prosoft module which i will using to talk the the koyo plc. I have just recently graduated from uni and this is my first major project. I understand i have to set up a transmit and recieve table on the plc. I was wondering if anyone could give me any advice on how i should go about this and anyone had any or know of where i could obtain any sample program that would guide me on how to complete this. Thankyou for all you help
Best Regards
 
When shipped the prosoft module documentation has sample code. Showing modbus addressing and SLC/PLC data table mapping. If you do not have the CD then try their website.
www.prosoft-technology.com
Else if you can supply the prosoft Part no I may be able to find the sample logic on my own copy.
 
Hello Modson,

If you have both master and slave PLCs, there is nothing
keeping you from victory ! But keep cool, and prepare your action
by dividing the problem in several basic tips you can dominate separately :

- Base level hardware compatibilities : which common physical
layer do you choose ? (RS232, 422, 485, O.F, Ethernet
embedded protocol... ) First choose your network hardware,
and always prefer insulated interfaces, or add them if not
available on boards. Caution 1 : "RS422" or "RS485" can be
interpreted / wired in different manners by two
manufacturers ! Third-party's interfaces can eliminate this
pitfall.

- If you don't clearly understand what means "Modbus protocol"
look for informations describing methods and requests. Easy to
find, since any material's manufacturer offers such a link port.
Two sec. needed to find this page for example :
"http://tesla.selinc.com/instruction_manual/701-1/701-1_0C_20011005.pdf" (I never heard about this company before...)
Caution 2 : Be sure that your two PLCs use the same Modbus
protocol. RTU (binary coded) is common, but ASCII too, and are not
compatible... Look for details.

- At this step, become familiar with the few usual commands,
and identify those which are equally recognized by your two PLCs.
If you don't have time enough, try to use 'Read n bits / n words'
and 'Write n bits / n words'. In fact, you could only use
Read/write n word (always from master point of view), depending on
how is built your exchange table.

- Open your manuals, and configure the link : baudrate, parity,
data bits, start/stop bits. Caution 3 : Be sure that the whole
number of bits is the same one on each side. Certain systems only
use fixed frame length.

- Slave side : usually, slave units are passive. They receive
messages and only answer if the question is recognized.
Message accepted if : slave address, function number, data
parameters are recognized, and control byte is correct (CRC
or LRC depending on your Modbus type)
Caution 4 :
As far as I remember, on A-B's SLC5xx coupler, perhaps have you
in the CPU to transfer datas (bits/words) to/from a shared
memory (shared by coupler and CPU) from/to central memory.
(Clearly mentionned in the coupler's Prosoft manual)
Contact your reseller (or A-B experts on this site !)

- Validation of the slave side : I always suggest to download
a master software for slave validation, allowing to test
simultaneously both physical layer and slave's software
configuration.
Have a look at http://www.kepware.com/32bitdrv.html
Download your modbus OPC server (5 types available !)
And control with your PC that you can exchange datas with
the slave. Those complete drivers can run in demo mode,
and a quick OPC client is available for tests.
Notice : you can test too from an MS Excel's sheet.
Download the help files you need, if you're not familiar
with that 'fundamental test tool'.

- Master side : here is the program you have to build, but take
time before, to build your exchange table. Datas set in the
Write area by master, will be copied in the slave's memory
at asked addresses. Incoming datas in the Read area are copied
from the slave.
So if the number of datas (bits/words) is low, only two requests
can solve your whole problem. (Usually, up to 2048 bits can be
transmitted in a single frame).
Identify in your manual which function blocks can be used to
manage basically the two kind of requests described above.

I've tried to summarize many years in implementation of
heterogeneous networks, but when reading my reply, I'm afraid it's not so easy at all !!

Feel free to ask for help
Regards
 
hi
take a look at the prosoft web site and download the relevant manual(s) and the sample code. READ the manuals(s) and port the code into a test application. The important thing to understand is the way the module handles the mapping of data from the plc (write) and data into the plc (read) as blocks. The sample code is well documented and worked first time, once i got my head around the configuration.
It was easier to build a small test rig so that i could play without affecting any other processes, once it worked correctly the code was copied into the final project.

One final thing do not forget to implement a watchdog timer to cover the loss of comms possibility. If the timer times then take some action or at the very least post an alarm!

regards

kevin
 
modbus vs at command

Hi,

I am also new in communicating plcs and also have a municipal water application, but i still have to decide wich is better to use modbus or at commands using a SRM6000 radiomodem fron datalinc?. The application is the following, there are 3 different pumping stations that pump water to 3 different reservoirs and 1 pc station which will work as a very little scada reading and storing data from the 6 sites mentioned, i've thought of using modbus with the pc station as a master and other sites as slaves, but i have to communicate the pumping station and the reservoir station via the master radiomodem, so i can have two possible communications loss, but with at commands i can communicate directly between the reservoir and the pumping station but i feel its more complicated specially when there is a posibility that there will be more sites added (about 16 more), i will appreciate very much every comment since i cant make up my mind,

thanks everyone
 
hi victor
I assume that each pumping station feeds a res. Are there signals back from the res to the pumping station so that the duty and/or assist pump(s) stop on a high level. If so can you get the required res signals from the respective pumping station. Have you got a radio channel allocated for every station? If so then fit three modems in the scada section and let them talk continually to the pumping stations.

If you let me have more info, plc type, distances etc i will try to help further.

regards

kevin
 

Similar Topics

Hello Guys, I have been trying to study a Machine that have Omron 3g3mv VFDs that is controlled by CJ1m CPU and SCU41-V1 communication card. The...
Replies
0
Views
481
Hello Guys, I have a packaging machine in the company that I work for that have 8 Omron VFDs (3G3MV ) that are controlled via Modbus with CJ1M...
Replies
1
Views
651
Dear guys, I have a software that sends data to PLC using modbus. I want to connect my software with siemens plc, how can i do that?
Replies
19
Views
4,731
I am finally lucky enough to work w/ an actual high level programmer. I can follow a tag from the pnp junction up to an hmi. He knows the other...
Replies
20
Views
5,762
Hi! Please share the MODBUS protocol code for the subject Regards
Replies
10
Views
2,444
Back
Top Bottom