S7 315-2DP / 341 Modbus Master with Multiple Slaves

richyr32gtr

Member
Join Date
Apr 2009
Location
Southwest
Posts
4
Hi all.

[edit] - Sorry about the long intro for a simple question but i know many people have had troubles getting modbus to work in this scenario so i have provided alot more information than required. I will ask my superiors if i can upload the modbus component of this project to help out others with similar modbus master, multiple slaves projects.

I've been working on my first siemens project with the above PLC and Modbus card. I have the comms side of things working brilliantly. I will give you a brief rundown of the system before i ask my question.

S7 315-2DP PLC
341-1CH02-0AE0 Modbus Master Dongle
Whole project will have 16 Modbus Slaves.
Currently testing with 3 slaves.

I have programmed the S7 to do the following.

Each Read (FB7) or Send (FB8) request is triggered by the previous requests done bit. On a Read i use FB7's Done bit, on a write i use FB8's done bit. I also use in parallel with this the send error and a job bypass bit. After every receive, there is a 10ms delay before proceeding to the next job. It will not work without this

The job bypass works as follows.
Every job has it's own job error counter. If a job has more than 2 errors, it triggers its own bypass bit to bypass that job for x time. Then it turns off the bypass and retrys that job. I need this to happen to prevent long timeouts due to having so many slaves. The next job delay always happens wether in bypass or not. This way i have a definate modbus cycle time that wil only change by how ever long the transmission takes, excluding the 2 timeouts required to bypass a job.

OK. so my problem is...

12 of the slaves are Danfoss VSD's. Each vsd i need to write to 2 separate modbus registers (they are 20 registers apart) and read from 2 registers (the same apart) So i require 4 modbus jobs per VSD as i need to specify certain registers. I know i can read a block of 21 registers and just disregard the middle 19 but can't when writing.

To avoid having 2 jobs for each write which means 2 DB's for each job and a hell of a lot more programming, can i use the DBB_No variable of FB8 to specify a DBB offset to start from? The Manual describes this variable as:
DBB_NO
INPUT
INT
Data byte number
0 ≤ DBB_NO ≤ 8190 Send data starting from data byte

I have tried to use this but it stops all my jobs from working with error 1E0F which when looking at SFCERR of DB8 for further details comes back with C0892200 as a Dword which i cant find in the System "Software for S7-300/400 System and Standard Functions" Ref manual

Does anyone know how to use the DBB_NO variable?
 
In addition, my job working DB where the data in sent from is configured as an array. Not sure if this prevents being able to use a DBB_NO ofset. Will try with a defined DB
 

Similar Topics

Dear sir, I am using SIMATIC 300, CPU 315-2DP , (6ES7 315-2AF03-0AB0) VIPA 603-1CC21 A1.0 RAM 32KB, Firmware=V4.0.8 The problem Im using MPI...
Replies
2
Views
158
Hi , Looking for some help. We have a 343-1 PN Lean Card & 315-2DP connected to an external system collecting data. After a recent shutdown...
Replies
0
Views
59
I'll preface this by saying this is the first time I've worked on a Siemens system and I'm fairly unfamiliar with them. I might mess up some of...
Replies
29
Views
712
Hi We were having a few power cuts and the CPU would not work. I had to reset the memory and he CPU would read from the memory card and start...
Replies
13
Views
3,139
Hi! I have never cross this kind of problem.. I have kind of working program on 315-2dp cpu. Program has been working nearly 20 years like this...
Replies
11
Views
2,423
Back
Top Bottom