Author Topic: MODBUS DATA ERROR  (Read 42184 times)

ONG

  • Guest
MODBUS DATA ERROR
« on: April 02, 2006, 06:30:37 PM »
 ???

Why the READMODBUS data from slave PLC was difference with the original data on slave PLC.
Example: On slave PLC    = 1332 / 2992 / 2660 / 1400
                On master PLC = -13104 / -4047 / -32307 / -23136
How to solve this problem?

Thank You.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:MODBUS DATA ERROR
« Reply #1 on: April 03, 2006, 11:30:37 AM »
What are these data? Are they 16-bit data in DM or 32-bit data A to Z? Are you certain that you have read from the correct register address using READMODBUS? The addresses used in READMODBUS are zero offset from 40001. E.g. To read from address 40011, you have to read from address 10.

Note that READMODBUS only return 16-bit data from the slave. You may want to check
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ONG

  • Guest
Re:MODBUS DATA ERROR
« Reply #2 on: April 03, 2006, 07:08:41 PM »
What are these data? Are they 16-bit data in DM or 32-bit data A to Z? Are you certain that you have read from the correct register address using READMODBUS? The addresses used in READMODBUS are zero offset from 40001. E.g. To read from address 40011, you have to read from address 10.

Note that READMODBUS only return 16-bit data from the slave. You may want to check


 ???   ???

They are 16-bit data in DM. This is the one of command: READMB2 3,5,1000,DM[51],8

ch - PLC COMM port number (1to 8 using Modbus ASCII or 11to 18 using Modbus RTU).
ID - Device ID of the MODBUS slave device (1 to 255)
addr - Zero-offset address of the holding register in the MODBUS slave device starting from 0 = 40001.
var - the starting variable in the master for storing the returned data. (may be a DM or any system variable)
count - number of variables to read (max. =16 in M+ PLC).

ch = 3
slave ID = 5
addr = 1000 (slave DM[1])
var = DM[51] (on master PLC)
count = 8 (read from slave DM[1] - DM[8] to master DM[51] - DM[58])

Is this incorrect command? Or because of noise? Or something else?

Is it 0 to 4092 in the range of 16-bit data? Can the READMODBUS return 0 to 4092 from the slave? How to check?

How to solve this problem?


Thank You.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:MODBUS DATA ERROR
« Reply #3 on: April 03, 2006, 11:24:34 PM »
I setup two PLCs, slave set to ID = 5, then initialized with the data as follow:

DM[1] = 1332
DM[2] = 2992
DM[3] = 2660
DM[4] = 1400

On the master, I have an input trigger a single custom function as follow:

READMB2 3,5,1000,DM[51],8

After execution, I got the following results on the master:

  DM[51] = 1332
  DM[52] = 2992
  DM[53] = 2660
  DM[54] = 1400
  DM[55] = 0
  DM[56] = 0
  DM[57] = 0
  DM[58] = 0

So the data are read correctly from the slave as expected. I did not observe the negative results you mentioned. Did you really execute the instruction:

  READMB2 3,5,1000,DM[51],8

Or did you use the RTU form READMB2 13,5,1000,DM[51],8 ?

If you are using MODBUS RTU mode only for COMM3, you may want to use the SETPROTOCOL command to set the COM port ino RTU mode only. This will eliminate some of the guest work involved by the slave CPU when it is in Auto protocol mode because the CPU has to try to determine if an RTU command is valid at any one time.
« Last Edit: April 03, 2006, 11:35:02 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ONG

  • Guest
Re:MODBUS DATA ERROR
« Reply #4 on: April 04, 2006, 03:29:57 AM »
 ???   ???   ???

If only two PLCs, I also got the same results on the master:
  DM[51] = 1332
  DM[52] = 2992
  DM[53] = 2660
  DM[54] = 1400
  DM[55] = 1332
  DM[56] = 2992
  DM[57] = 2660
  DM[58] = 1400

from slave data:
  DM[1] = 1332
  DM[2] = 2992
  DM[3] = 2660
  DM[4] = 1400
  DM[5] = 1332
  DM[6] = 2992
  DM[7] = 2660
  DM[8] = 1400

But the problem is: I have connected 15 PLCs on the large plant. And the data read from slave was not stability. In between one minute, the data will switching between the normal data and the negative data once.

What is MODBUS RTU mode? May I know more about it.

Thank You.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:MODBUS DATA ERROR
« Reply #5 on: April 04, 2006, 02:27:05 PM »
In your original post you seem to suggest that the READMB2 does not read the data correctly even between one master and slave. But now you reveal that you are using multiple master/slave PLCs, then it seems more likely that there are problem in your setup of master/slave communications between multiple PLCs.

We have a number of customers using multiple slaves (10 or more) in RS485 network, mostly using the NETCMD$ command but some also uses the READMODBUS or READMB2 command for communications. There were no  similar report that the DMs were not correctly read. There are many ways for the data in DM to change, most often the changes is caused by the PLC program itself (assignment of DM to other values in the other part of the program) either in the master or the slave? Do you have more than 1 PLC using the same ID? You should try to isolate where the problem occur by letting the master PLC monitor when the data change and pause  for you to examine where thing goes wrong.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ONG

  • Guest
Re:MODBUS DATA ERROR
« Reply #6 on: April 05, 2006, 03:21:55 AM »
 ???   ???   ???   ???

Dear Mr. / Mdm / Ms. Support:

Sorry about your misunderstanding on my first post, that is one example data of error data.  

What difference between one master / slave PLCs and multiple master / slave PLCs?
How does the setup of master / slave communications between multiple PLCs make this problem?
Can you show me the example of correct setup  of master / slave communications between multiple PLCs?

I'm sure didn't have more than 1 PLC using the same ID.

Now, we have new PLC problem.
Our customer using 31 PLCs as master / slave in RS485 network (another network, not 15 PLCs that once). The PLCs in use are T100MD888+, T100MD2424+ and EXP4040. This network is to read 30 slave PLCs DM data to the master PLC DM data (one master).
 
All PLCs in normal condition without RS485 network connection.
After a few hours RS485 network connected, some problem was occur as bellow:
1) Some PLC RTC indicator LED turn off. (without setting the real time clock)
2) Some PLC Pause indicator LED turn on. (message display "Pause by user" in On-line Monitoring but user didn't do that.)
3) Some PLC Run Error indicator LED turn on. (message display "Divide by Zero" or "Illegal Opcode - Please inform manufacturer!")
4) Some PLC cannot detect the ID address.
5) Some PLC ID address was changed.
6) Some PLC no respond.
7) Some PLC no error.

This few error was occur randomly. (every time the error occur, the same PLC will get difference error or no error)

All the protection of RS485 listed on T100MD+ User's Manual and filter the noise already done, but still cannot solve the problems.

Thank You.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:MODBUS DATA ERROR
« Reply #7 on: April 05, 2006, 07:37:06 AM »
Do you mean that when an error occur, it affects multiple PLC simultaneously? i.e. before the first error is observed, all PLCs runs fine but when an error occur, a few PLCs go into different error mode? Sounds like a spike of electrical interference could have occurred and cause various PLCs to enter fault state

1) Is there large frequency inverters in your environment, or large motor contactors? The RS485 should not be bundled into the same trunkings or conduit that carry very noisy power system such as inverter or motor current. If your environment comprises a lot of large noise generator then you should try to run a separate metal trunking for the RS485 and ground the trunking at one point to the earth ground to create a Faraday cage effect to shield the interference.

2) Secondly, each PLC's own 24V power supply wire must not be bundled with the motor or inductive load current in the same control panel. Although they may still work when run standalone, the problem caused by electrical noise entering the power supply to the PLC may get amplified when the PLC s are linked together in a large network. Power supply to the PLC is like blood in the body and contamination to the power supply is like poisoning of the blood and can lead to serious problems.

3) Of the 31 PLCs, are there any unit that never enter error state? If so, how many of them actually never fail? How many  units experience different fault state?

4) If you keep the RS485 wire connected to all the PLC but stop the master PLC from sending commands, does the PLC still experience fault state after several hours? This test is to determine if corrupted host link commands are the problem or just mere connection of them to RS485 itself is already a problem.

5) Did you connect the RS485 to two biasing resistors that are pull to a +9V and 0V separate power supply? This helps to keep the RS485 line in known state when no master is driving the RS485 line and can be effective in reducing communication errors caused by floating RS485 picking up noise voltages.


« Last Edit: April 05, 2006, 08:30:55 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ONG_FQ

  • Guest
Re:MODBUS DATA ERROR
« Reply #8 on: April 05, 2006, 09:44:35 PM »
No PLCs are never enter error state, all 31 PLCs have experience on different fault state.

When error occur, some RS485 driver IC on PLC also damaged.
0.3V between +485 and -485, normally 1.5V between them without load.

If we follow all the suggestions that you mentions, the problem still cann't eliminated
How to protect the network from the noise?

Thank for your supports

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:MODBUS DATA ERROR
« Reply #9 on: April 06, 2006, 10:32:44 AM »
If the RS485 driver are also damaged, then you are getting more than noise interference. In fact they are receiving enough energy to kill the RS485 IC driver. Please check your RS485 wiring to ensure that there is no possible leakage to other high voltage sources

If you can't shield/isolate the PLCs from the electrical damage, then you may want to consider using Fibre optic cable to link the PLCs together. To do so you need RS485 to fibre cable converter. An example is shown at our webpage at:

http://www.tri-plc.com/ioboard.htm

Scroll down to the end of he page and see a picture of RS485 converter made by RE Smith (www.rs485.com, model FC485). We tested this unit previously and work flawlessly.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Dogface

  • Newbie
  • Posts: 33
  • Woof$
    • View Profile
Re:MODBUS DATA ERROR
« Reply #10 on: April 06, 2006, 03:03:29 PM »
I'm not sure if this is related or will help.  I too managed to kill the RS485 IC Driver on my PLC.  Using my OIT as the master, I unthinkingly tried to run TLserver using an Auto485.  Zapped it!  The IC Driver on the PLC's is not fault tolerant.  Is there any chance that you have more than one master on the network?

ONG_FQ

  • Guest
Re:MODBUS DATA ERROR
« Reply #11 on: April 07, 2006, 07:36:19 PM »
 ???   ???   ???   ???   ???   ???

If using Fibre optic cable to link the PLCs together, how many units RS485 to fibre cable converter is needed for 31 PLCs. How about the cost?

Other them replacement of Fibre optic cable, do you have any more experiences to shield/isolate the PLCs from the electrical damage?

To kill the RS485 IC driver, how much energy or noise interference is needed?
How much energy or noise interference is needed to affects multiple PLC simultaneously as follow:
1) Some PLC RTC indicator LED turn off. (without setting the real time clock)
2) Some PLC Pause indicator LED turn on. (message display "Pause by user" in On-line Monitoring but user didn't do that.)
3) Some PLC Run Error indicator LED turn on. (message display "Divide by Zero" or "Illegal Opcode - Please inform manufacturer!")
4) Some PLC cannot detect the ID address.
5) Some PLC ID address was changed.
6) Some PLC no respond.
7) Some PLC no error.

What difference between one master / slave PLCs and multiple master / slave PLCs?
How does the setup of master / slave communications between multiple PLCs make this problem?
Can you show me the example of correct setup  of master / slave communications between multiple PLCs?

Thank for your supports.

ONG_FQ

  • Guest
Re:MODBUS DATA ERROR
« Reply #12 on: April 11, 2006, 03:37:59 AM »
60 units RS485 to fibre optic cable converter is needed for 31 PLCs.  :(

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:MODBUS DATA ERROR
« Reply #13 on: April 11, 2006, 10:25:08 AM »
It is quite rare that induced voltage from electrical applicances have enough energy to kill RS485 driver (typically only surge induced by a direct lightning strike to the building could cause such damage). The first thing you want to investigate should be the possibility of some short/leakage of the RS485 wire to high voltages. Also make sure that you don't  bundles the RS485 wires with power cable that are carrying high energy motor current. Why not start off by removing the existing RS485 cable, then run a separate shielded twisted pair cable to link up 6 PLCs at a time, forming five different regions. Without any communication going on, check if the PLC runs into any fault state after some time.  Then eventually link up the five regions together into a large network and connect up the master to run the test.

It is important that all the PLCs that are linked together share the same 0V. Typically, you connect the 0V of each PLC power supply to the shield to provide a common reference.

Fibre optic does cost more but they are free of electrical interference and would be the only solution if you can't resolve the electrical problem in your system.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ONG_FQ

  • Guest
Re:MODBUS DATA ERROR
« Reply #14 on: April 15, 2006, 03:48:54 AM »
M2017P IC also damaged and no respond from PLCs!!!  :'(