richyr32gtr
Member
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?
[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?