Support Forums
Modbus communication fails

Hello,

we have implemented a DT80 in our system, where we have 14 modbus RS485 slaves.

Main settings are:
Statistics
Rate of statistical schedule 1 seconds
Sensor port
Modbus mast, 9600bps, 8 databits, 2 stop bits, parity none, mode RS-485, flow control none

Schedule rate 5 seconds (reading modbus and analog channels)
Schedule rate 10 minutes (logging averages)

It is working fine, besides the dEx is quite slow, but this is due to the schedule rate (5 seconds). Is it recommended to have slower rate, to be easily able to startup dEx without Holding the program by a menu button (I do not want to implement that because I don't want my client to be able to Hold it).

The biggest problem we are facing is the fact that the DT80 jams when one of the modbus slaves isn't found on the network, while this is just a normal condition (a slave can be shutdown manual). The DT80 stops sampling/logging and there is no communication at all. Is there any way to prevent this?!

My program for one slave is as follows (and I have this for max. 14 slaves):
1MODBUS(TO30,AD1,R3:1,=310..313CV,W) 'read regulator adress 1-4 and write to datalogger adress 310-313
1MODBUS(TO30,AD1,R3:25,=314CV,W) 'read regulator adress 25 and write to datalogger adress 314
1MODBUS(TO30,AD1,R3:30,=315CV,W) 'read regulator adress 30 and write to datalogger adress 315
1MODBUS(TO30,AD1,R3:36,=316CV,W) 'read regulator adress 36 and write to datalogger adress 316
1MODBUS(TO30,AD1,R3:38,=317CV,W) 'read regulator adress 38 and write to datalogger adress 317
1MODBUS(TO30,AD1,R3:31,=318CV,W) 'read regulator adress 31 and write to datalogger adress 318
1MODBUS(TO30,AD1,R3:5,=319CV,W) 'read regulator adress 5 and write to datalogger adress 319 --> Version as logged is 18 (decimal), that means the version is 12 (hex)
1MODBUS(TO30,AD1,R3:26,=10..13CV,W) 'read regulator adress 26-29 and write to datalogger adress 10-13
1MODBUS(TO30,AD1,R3:37,=14CV,W) 'read regulator adress 37 and write to datalogger adress 14
1MODBUS(TO30,AD1,R3:45,=15CV,W) 'read regulator adress 45 and write to datalogger adress 15
1MODBUS(TO30,AD1,R3:47,=16..17CV,W) 'read regulator adress 47-48 and write to datalogger adress 16-17
'calculate scalings
310CV(W)=(311CV/65536+310CV)/32768 ' voltage scaling
312CV(W)=(313CV/65536+312CV)/32768 ' current scaling
'set scaling
10CV("SR1_U_OUT ~mV",NL)=10CV310CV1000 'convert V to mV
11CV("SR1_U_BAT ~mV",NL)=11CV310CV1000 'convert V to mV
12CV("SR1_U_IN ~mV",NL)=12CV310CV1000 'convert V to mV
13CV("SR1_I_OUT ~A/100",NL)=13CV312CV100 'convert A to A/100
314CV(NL,ND)=314CV310CV1000 'convert V to mV
315CV(NL,ND)=315CV312CV100 'convert A to A/100
318CV(NL,ND)=318CV310CV100 'convert V to mV

Hello, we have implemented a DT80 in our system, where we have 14 modbus RS485 slaves. Main settings are: Statistics Rate of statistical schedule 1 seconds Sensor port Modbus mast, 9600bps, 8 databits, 2 stop bits, parity none, mode RS-485, flow control none Schedule rate 5 seconds (reading modbus and analog channels) Schedule rate 10 minutes (logging averages) It is working fine, besides the dEx is quite slow, but this is due to the schedule rate (5 seconds). Is it recommended to have slower rate, to be easily able to startup dEx without Holding the program by a menu button (I do not want to implement that because I don't want my client to be able to Hold it). The biggest problem we are facing is the fact that the DT80 jams when one of the modbus slaves isn't found on the network, while this is just a normal condition (a slave can be shutdown manual). The DT80 stops sampling/logging and there is no communication at all. Is there any way to prevent this?! My program for one slave is as follows (and I have this for max. 14 slaves): 1MODBUS(TO30,AD1,R3:1,=310..313CV,W) 'read regulator adress 1-4 and write to datalogger adress 310-313 1MODBUS(TO30,AD1,R3:25,=314CV,W) 'read regulator adress 25 and write to datalogger adress 314 1MODBUS(TO30,AD1,R3:30,=315CV,W) 'read regulator adress 30 and write to datalogger adress 315 1MODBUS(TO30,AD1,R3:36,=316CV,W) 'read regulator adress 36 and write to datalogger adress 316 1MODBUS(TO30,AD1,R3:38,=317CV,W) 'read regulator adress 38 and write to datalogger adress 317 1MODBUS(TO30,AD1,R3:31,=318CV,W) 'read regulator adress 31 and write to datalogger adress 318 1MODBUS(TO30,AD1,R3:5,=319CV,W) 'read regulator adress 5 and write to datalogger adress 319 --> Version as logged is 18 (decimal), that means the version is 12 (hex) 1MODBUS(TO30,AD1,R3:26,=10..13CV,W) 'read regulator adress 26-29 and write to datalogger adress 10-13 1MODBUS(TO30,AD1,R3:37,=14CV,W) 'read regulator adress 37 and write to datalogger adress 14 1MODBUS(TO30,AD1,R3:45,=15CV,W) 'read regulator adress 45 and write to datalogger adress 15 1MODBUS(TO30,AD1,R3:47,=16..17CV,W) 'read regulator adress 47-48 and write to datalogger adress 16-17 'calculate scalings 310CV(W)=(311CV/65536+310CV)/32768 ' voltage scaling 312CV(W)=(313CV/65536+312CV)/32768 ' current scaling 'set scaling 10CV("SR1_U_OUT ~mV",NL)=10CV*310CV*1000 'convert V to mV 11CV("SR1_U_BAT ~mV",NL)=11CV*310CV*1000 'convert V to mV 12CV("SR1_U_IN ~mV",NL)=12CV*310CV*1000 'convert V to mV 13CV("SR1_I_OUT ~A/100",NL)=13CV*312CV*100 'convert A to A/100 314CV(NL,ND)=314CV*310CV*1000 'convert V to mV 315CV(NL,ND)=315CV*312CV*100 'convert A to A/100 318CV(NL,ND)=318CV*310CV*100 'convert V to mV

Good morning marcoleer,

It is not normal for Modbus slave devices to be shut down while the master is left running.
The dataTaker has no way of knowing if or when a device has been intentionally turned off and will simply keep reading it.

A couple of tips for you to speed up your code and reduce the impact of a device being shut down.
1/ Use block read when ever possible.
For example you are reading registers 1 to 5 with a block read but then jumping back and reading register 5. This requires 2 read cycles instead of 1
You can also use block read for registers 30 & 31 36, 37 & 38 and 45&47. The reduces your access time and times spent timing out when a device is turned off

2/ Use the TO channel option to set the time out to 1 second e.g TO=1
The code as it stands has 11 reads each with a 3 second time out so if you turn off a device it will take 33 seconds to process.
Using block reads (4 off) and a time out of 1 second will reduce the read time to 4 seconds for a device that has been turned off.

Cheers,
Roger

Good morning marcoleer, It is not normal for Modbus slave devices to be shut down while the master is left running. The dataTaker has no way of knowing if or when a device has been intentionally turned off and will simply keep reading it. A couple of tips for you to speed up your code and reduce the impact of a device being shut down. 1/ Use block read when ever possible. For example you are reading registers 1 to 5 with a block read but then jumping back and reading register 5. This requires 2 read cycles instead of 1 You can also use block read for registers 30 & 31 36, 37 & 38 and 45&47. The reduces your access time and times spent timing out when a device is turned off 2/ Use the TO channel option to set the time out to 1 second e.g TO=1 The code as it stands has 11 reads each with a 3 second time out so if you turn off a device it will take 33 seconds to process. Using block reads (4 off) and a time out of 1 second will reduce the read time to 4 seconds for a device that has been turned off. Cheers, Roger

Thanks for you answer.

I've done what you told, but still it jams.
It continuously gives back the error:
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed
dataTaker 80 E124 - Modbus transaction failed

I even tried to add RT=0 (while this already should be standard), but it made no difference.
Note that I even compressed the program for one slave to only one reading: 1MODBUS(AD1,TO1,RT0,R3:1,=310CV,W)
and even when I shutdown only that slave it jams on that one reading.
Is there any other setting I can do?

I've even tested this with the following settings:

Main settings are:
Statistics
Rate of statistical schedule 5 seconds
Sensor port
MODBUS mast, 9600bps, 8 databits, 2 stop bits, parity none, mode RS-485, flow control none

Schedule rate 60 seconds (reading MODBUS and analog channels)
Schedule rate 10 minutes (logging averages)

I understand that normally slaves will not be shut off, however in our business (offshore power supply by solar power), it can happen and especially at that moment it's important to do the measurements of the other parts of the system.

Thanks for you answer. I've done what you told, but still it jams. It continuously gives back the error: dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed dataTaker 80 E124 - Modbus transaction failed I even tried to add RT=0 (while this already should be standard), but it made no difference. Note that I even compressed the program for one slave to only one reading: 1MODBUS(AD1,TO1,RT0,R3:1,=310CV,W) and even when I shutdown only that slave it jams on that one reading. Is there any other setting I can do? I've even tested this with the following settings: Main settings are: Statistics Rate of statistical schedule 5 seconds Sensor port MODBUS mast, 9600bps, 8 databits, 2 stop bits, parity none, mode RS-485, flow control none Schedule rate 60 seconds (reading MODBUS and analog channels) Schedule rate 10 minutes (logging averages) I understand that normally slaves will not be shut off, however in our business (offshore power supply by solar power), it can happen and especially at that moment it's important to do the measurements of the other parts of the system.

Strange behavior... with TO1 and RT0 in all the 11 MODBUS readings and all slaves OFF I would expect a 11 seconds of datalogger stuck every 60 s (schedule time base), so during the first 11s every minute the logger won't respond to commands (blue "Sample" led ON).

Where do you use statistical channel options (5s interval)? If any statistical is used in the MODBUS channels the readings are attempted every 5 s, locking up the logger.

Strange behavior... with TO1 and RT0 in all the 11 MODBUS readings and all slaves OFF I would expect a 11 seconds of datalogger stuck every 60 s (schedule time base), so during the first 11s every minute the logger won't respond to commands (blue "Sample" led ON). Where do you use statistical channel options (5s interval)? If any statistical is used in the MODBUS channels the readings are attempted every 5 s, locking up the logger.

Good morning All,

Good point Teo,

There is not statistical sampling in the program so the cycle time should be 1 second for each read.

Ok, there is another approach that will let you sample 11 of these slave devices
We have 12 schedules in the DT80.
In schedule A read each on the devices in turn and trap the return in a CV.
If the value of the CV = -9e9 then the device is not connected so we can test this in an alarm and call the other schedule to read the data if the device is active

E.g.
Begin

RA1M
1MODBUS(TO1,AD1,R3:1,=1cv,W) 'read device on address 1
1MODBUS(TO1,AD2,R3:1,=2cv,W) 'read device on address 2
1MODBUS(TO1,AD3,R3:1,=3cv,W) 'read device on address 3
AlarmR1(1CV<-9e9)"Device 1 On"{XB}
AlarmR1(2CV<-9e9)"Device 2 On"{XC}
AlarmR1(3CV<-9e9)"Device 3 On"{XD}

RBX
1MODBUS(TO30,AD1,R3:1,=310..313CV,W) 'read regulator address 1-4 and write to datalogger address 310-313
1MODBUS(TO30,AD1,R3:25,=314CV,W) 'read regulator address 25 and write to datalogger address 314
1MODBUS(TO30,AD1,R3:30,=315CV,W) 'read regulator address 30 and write to datalogger address 315

RCX
1MODBUS(TO30,AD2,R3:1,=310..313CV,W) 'read regulator address 1-4 and write to datalogger address 310-313
1MODBUS(TO30,AD2,R3:25,=314CV,W) 'read regulator address 25 and write to datalogger address 314
1MODBUS(TO30,AD2,R3:30,=315CV,W) 'read regulator address 30 and write to datalogger address 315

RDX
1MODBUS(TO30,AD3,R3:1,=310..313CV,W) 'read regulator address 1-4 and write to datalogger address 310-313
1MODBUS(TO30,AD3,R3:25,=314CV,W) 'read regulator address 25 and write to datalogger address 314
1MODBUS(TO30,AD3,R3:30,=315CV,W) 'read regulator address 30 and write to datalogger address 315

End

Cheers,
Roger

Good morning All, Good point Teo, There is not statistical sampling in the program so the cycle time should be 1 second for each read. Ok, there is another approach that will let you sample 11 of these slave devices We have 12 schedules in the DT80. In schedule A read each on the devices in turn and trap the return in a CV. If the value of the CV = -9e9 then the device is not connected so we can test this in an alarm and call the other schedule to read the data if the device is active E.g. Begin RA1M 1MODBUS(TO1,AD1,R3:1,=1cv,W) &#039;read device on address 1 1MODBUS(TO1,AD2,R3:1,=2cv,W) &#039;read device on address 2 1MODBUS(TO1,AD3,R3:1,=3cv,W) &#039;read device on address 3 AlarmR1(1CV&lt;-9e9)&quot;Device 1 On&quot;{XB} AlarmR1(2CV&lt;-9e9)&quot;Device 2 On&quot;{XC} AlarmR1(3CV&lt;-9e9)&quot;Device 3 On&quot;{XD} RBX 1MODBUS(TO30,AD1,R3:1,=310..313CV,W) &#039;read regulator address 1-4 and write to datalogger address 310-313 1MODBUS(TO30,AD1,R3:25,=314CV,W) &#039;read regulator address 25 and write to datalogger address 314 1MODBUS(TO30,AD1,R3:30,=315CV,W) &#039;read regulator address 30 and write to datalogger address 315 RCX 1MODBUS(TO30,AD2,R3:1,=310..313CV,W) &#039;read regulator address 1-4 and write to datalogger address 310-313 1MODBUS(TO30,AD2,R3:25,=314CV,W) &#039;read regulator address 25 and write to datalogger address 314 1MODBUS(TO30,AD2,R3:30,=315CV,W) &#039;read regulator address 30 and write to datalogger address 315 RDX 1MODBUS(TO30,AD3,R3:1,=310..313CV,W) &#039;read regulator address 1-4 and write to datalogger address 310-313 1MODBUS(TO30,AD3,R3:25,=314CV,W) &#039;read regulator address 25 and write to datalogger address 314 1MODBUS(TO30,AD3,R3:30,=315CV,W) &#039;read regulator address 30 and write to datalogger address 315 End Cheers, Roger

Ok I tried it and it works almost.

When one of the slaves is not connected, the DT80 thinks all are not connected; somehow all CV's have the same number (-89999995) when one is off.
When I switch it back on, all are working.'

I tried it with 6 slaves first:
1MODBUS(TO1,AD1,R3:1,=501CV,W)
1MODBUS(TO1,AD2,R3:1,=502CV,W)
1MODBUS(TO1,AD3,R3:1,=503CV,W)
1MODBUS(TO1,AD4,R3:1,=504CV,W)
1MODBUS(TO1,AD5,R3:1,=505CV,W)
1MODBUS(TO1,AD6,R3:1,=506CV,W)
AlarmR1(501CV<-9e9)"Device 1 On"{XB}
AlarmR1(502CV<-9e9)"Device 2 On"{XC}
AlarmR1(503CV<-9e9)"Device 3 On"{XD}
AlarmR1(504CV<-9e9)"Device 4 On"{XE}
AlarmR1(505CV<-9e9)"Device 5 On"{XF}
AlarmR1(506CV<-9e9)"Device 6 On"{XG}

Ok I tried it and it works almost. When one of the slaves is not connected, the DT80 thinks all are not connected; somehow all CV&#039;s have the same number (-89999995) when one is off. When I switch it back on, all are working.&#039; I tried it with 6 slaves first: 1MODBUS(TO1,AD1,R3:1,=501CV,W) 1MODBUS(TO1,AD2,R3:1,=502CV,W) 1MODBUS(TO1,AD3,R3:1,=503CV,W) 1MODBUS(TO1,AD4,R3:1,=504CV,W) 1MODBUS(TO1,AD5,R3:1,=505CV,W) 1MODBUS(TO1,AD6,R3:1,=506CV,W) AlarmR1(501CV&lt;-9e9)&quot;Device 1 On&quot;{XB} AlarmR1(502CV&lt;-9e9)&quot;Device 2 On&quot;{XC} AlarmR1(503CV&lt;-9e9)&quot;Device 3 On&quot;{XD} AlarmR1(504CV&lt;-9e9)&quot;Device 4 On&quot;{XE} AlarmR1(505CV&lt;-9e9)&quot;Device 5 On&quot;{XF} AlarmR1(506CV&lt;-9e9)&quot;Device 6 On&quot;{XG}

Is there anyway to fix this?

I now also understand there are only 12 schedules in the datataker, while I need much more. Already 13 are necessary for this MODBUS sampling as you advise. Is that correct? Please help. Thank you.

Is there anyway to fix this? I now also understand there are only 12 schedules in the datataker, while I need much more. Already 13 are necessary for this MODBUS sampling as you advise. Is that correct? Please help. Thank you.

Good afternoon marcoleer,

It shouldn't the alarms are testing different data.
Ok, lets work out what is happening here:

1/ Remove the W from the channel options. This will show us any error messages for each line.
2/ Set P56=4. This will turn on the Modbus diagnostics.
3/ Change the alarm trigger point to some thing less that -9e9 but greater than the maximum value of any expected readings.

Between the above we will have a better idea of the problem.

Cheers,
Roger

Good afternoon marcoleer, It shouldn&#039;t the alarms are testing different data. Ok, lets work out what is happening here: 1/ Remove the W from the channel options. This will show us any error messages for each line. 2/ Set P56=4. This will turn on the Modbus diagnostics. 3/ Change the alarm trigger point to some thing less that -9e9 but greater than the maximum value of any expected readings. Between the above we will have a better idea of the problem. Cheers, Roger

I've done that.
Please find attached what the logger returns on the command line.

Modbus TX >SS: 01 040000000131ca (8)
Modbus timeout
dataTaker 80 E124 - Modbus transaction failed
Modbus TX >SS: 02 040000000131f9 (8)
Modbus timeout
dataTaker 80 E124 - Modbus transaction failed
Modbus TX >SS: 03 04000000013028 (8)
Modbus timeout
dataTaker 80 E124 - Modbus transaction failed
Modbus TX >SS: 04 0400000001319f (8)
Modbus timeout
dataTaker 80 E124 - Modbus transaction failed
Modbus TX >SS: 05 0400000001304e (8)
Modbus timeout
dataTaker 80 E124 - Modbus transaction failed
Modbus TX >SS: 06 0400000001307d (8)
Modbus timeout
dataTaker 80 E124 - Modbus transaction failed
1MODBUS NotYetSet
1MODBUS NotYetSet
1MODBUS NotYetSet

I don't understand what you mean with your third point? I tried some values (FFFF, FFF) and then I get an error. Also tried -9 for example, no error, but still doesn't work.

And what about the maximum nos of schedules? Is there a way to use more schedules?

I&#039;ve done that. Please find attached what the logger returns on the command line. Modbus TX &gt;SS: 01 040000000131ca (8) Modbus timeout dataTaker 80 E124 - Modbus transaction failed Modbus TX &gt;SS: 02 040000000131f9 (8) Modbus timeout dataTaker 80 E124 - Modbus transaction failed Modbus TX &gt;SS: 03 04000000013028 (8) Modbus timeout dataTaker 80 E124 - Modbus transaction failed Modbus TX &gt;SS: 04 0400000001319f (8) Modbus timeout dataTaker 80 E124 - Modbus transaction failed Modbus TX &gt;SS: 05 0400000001304e (8) Modbus timeout dataTaker 80 E124 - Modbus transaction failed Modbus TX &gt;SS: 06 0400000001307d (8) Modbus timeout dataTaker 80 E124 - Modbus transaction failed 1MODBUS NotYetSet 1MODBUS NotYetSet 1MODBUS NotYetSet I don&#039;t understand what you mean with your third point? I tried some values (FFFF, FFF) and then I get an error. Also tried -9 for example, no error, but still doesn&#039;t work. And what about the maximum nos of schedules? Is there a way to use more schedules?

Good afternoon marcoleer,

Can you please send me a copy of your code for me to review?
I believe you have me email address.

Cheer,
Roger

Good afternoon marcoleer, Can you please send me a copy of your code for me to review? I believe you have me email address. Cheer, Roger
132
9
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft