Author Topic: Mitsubishi FX5 via ModbusTCPCOM  (Read 1837 times)

SEissing

  • Newbie
  • *
  • Posts: 3
    • View Profile
Mitsubishi FX5 via ModbusTCPCOM
« on: February 09, 2018, 10:50:02 AM »
Hey guys,

got some problems using a Mitsubishi FX5 with ModbusTCP.

For my test I'm using just 1 AnalogDisplayValue.
In general it is working. I checked Standard-register from documentation D0 (MODBUS-address 40001). No problem.

But for my project I need to use extension registers R.
In the documenttation I found address mapping R0 - R32767 (MODBUS address 2140h - A13Fh)

So in my opinion correct address for R0 should be: 40000 + 8512 + 1
But with this address I always get  MODBUS error 03: Illegal data value

I'm not sure what the problem is. Can anyone help me?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Mitsubishi FX5 via ModbusTCPCOM
« Reply #1 on: February 11, 2018, 10:12:34 AM »
I checked the manual and came to the same conclusion you have. The address 48513 should be correct. The error code 3 is a direct response from the PLC, so it is receiving and responding to the command.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Mitsubishi FX5 via ModbusTCPCOM
« Reply #2 on: February 11, 2018, 11:07:48 AM »
Should't these extended registers be addressed as 6xxxx and read with function code 20?

I am not familiar with use of these extended registers but some info on the Internet did suggest that data from extended registers would be referenced as 4xxxxx and would be written to/from 4xxxx registers, so it could be only what function code should be used (with manuals suggesting 20 instead of 3).
« Last Edit: February 11, 2018, 08:23:00 PM by Godra »

SEissing

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Mitsubishi FX5 via ModbusTCPCOM
« Reply #3 on: February 12, 2018, 04:17:07 AM »
Just read this prior answer regarding MODBUS function codes:


Re: VLINX MESR911 ModBus TCP to Modbus Serial Converter to Badger M-5000
« Reply #1 on: August 19, 2013, 05:40:00 PM »

Currently the Modbus driver doesn't support floating point. Modbus works by function code, so AdvancedHMI could be using a function code that is not supported by your device. Below is the code that parses the addresses and converts it to function code. It's based on the first digit of the address and only 0,1,3, and 4 are supported.

The easiest troubleshooting route may be to use wireshark to look at the packets and see what function codes are working.

Code: [Select]
                    Select Case CInt(AddressFirstDigit)
                        Case 0 : m_ReadFunctionCode = 1
                            WriteSingleFunctionCode = 5
                            WriteMultiFunctionCode = 15
                            m_BitsPerElement = 1
                        Case 1 : m_ReadFunctionCode = 2
                            WriteMultiFunctionCode = 0 '* Invalid
                            m_BitsPerElement = 1
                        Case 3 : m_ReadFunctionCode = 4
                            WriteMultiFunctionCode = 0
                            m_Element = CInt(Address.Substring(1)) - 1
                            m_BitsPerElement = 16
                        Case 4 : m_ReadFunctionCode = 3
                            WriteSingleFunctionCode = 6
                            WriteMultiFunctionCode = 16
                            m_Element = CInt(Address.Substring(1)) - 1
                            m_BitsPerElement = 16


Is it still working like this?
That would mean if address is 4xxxxx, Functioncode will be automatically: 3
Am I right?


Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Mitsubishi FX5 via ModbusTCPCOM
« Reply #4 on: February 12, 2018, 08:34:30 AM »
I would say that you are right.

My question/suggestion was based on manuals pointing out that function code 20 would be used to read extended registers (as well as this website https://www.rtaautomation.com/technologies/modbus-tcpip/).

Archie might need to suggest of what the correct code should be when dealing with these extended registers.


On a slightly different note, for the error 03: Illegal data value, Rockwell explains it as "The data value being written is not allowed, either because it is out of range, or it is being written to a read-only address". Would any of this apply in your case (assuming Mitsubishi treats these errors the same as Rockwell)?


Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Mitsubishi FX5 via ModbusTCPCOM
« Reply #5 on: February 12, 2018, 09:07:59 AM »
Here is another suggestion:

You could call Mitsubishi support and ask them of how to read/write these extended registers with a 3rd party software.

If anybody should know these things, they probably would because it's their PLC that you are using.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Mitsubishi FX5 via ModbusTCPCOM
« Reply #6 on: February 12, 2018, 11:48:32 PM »
SEissing, if you would like to experiment then try the ModbusTCP driver from this topic:

http://advancedhmi.com/forum/index.php?topic=1975.0

It does have support for 6xxxxx addresses and is using function codes 20/21 to read/write.
Unfortunately, I don't have access to a Modbus device that supports extended registers, so this driver was only tested with MODRSsim2 simulator.

SEissing

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Mitsubishi FX5 via ModbusTCPCOM
« Reply #7 on: February 14, 2018, 08:35:08 AM »
Hi Godra,

tried this experimental driver with support for extended registers. But unfortunately it is still not working.
Same error: illegal data value
Tried: 4XXXX ; 4XXXXX ; 6XXXXX

Thanks anyway for your help!!!

Will give the mitsubishi guys a call now. Maybe I find one who knows about MODBUS issues ;-)