Author Topic: 'Illegal Function' and 'Illegal Data Address' messages  (Read 2581 times)

Aviraj

  • Newbie
  • *
  • Posts: 46
    • View Profile
'Illegal Function' and 'Illegal Data Address' messages
« on: December 02, 2015, 09:09:33 AM »
Hi

So I have an HMI with a bunch of Pilot Lights connect to check the status of some inputs and outputs on the PLC. I am pretty sure that the PLC addresses are correct because I initially tested them on a similar PLC. So now when I run the HMI, I see a message saying 'Illegal Function' on the pilot lights connected to the outputs and 'Illegal Data Address' on the pilot lights connected to the inputs.

The input addresses are like 12051, 12054, 12055 ... and the output addresses are 02053, 02054, 02055 ...., and these were tested to work on another similar PLC (DirectLogic 06 DO-06DD1)

I haven't really come across these message ever before !

Thanks in advance for the help

Aviraj
« Last Edit: December 02, 2015, 09:19:20 AM by Aviraj »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: 'Illegal Function' and 'Illegal Data Address' messages
« Reply #1 on: December 02, 2015, 11:49:48 AM »
An address that starts with a 0 will use function code 1 for reading and function code 5 for writing.

An address that starts with a 1 uses function code 2 for reading. There is no valid function code for writing.

Make sure you are not using 1xxxx address in PLCAddressClick. Make sure your PLC supports function codes 1,2, and 5

Aviraj

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: 'Illegal Function' and 'Illegal Data Address' messages
« Reply #2 on: December 02, 2015, 11:58:03 AM »
So where am I suppose to list the function code ? In front of the PLC Address ? Like 212021 ? That gives me an illegal address message because the addresses are supposed to start with a 0 and a 1

Thanks
Aviraj

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: 'Illegal Function' and 'Illegal Data Address' messages
« Reply #3 on: December 02, 2015, 12:05:07 PM »
The first digit of the addresses tells the driver which function code to use. If your address srarts with a 0, the driver will use function codes 1 and 5.

Under the Tips and Tricks section of this forum there is a topic on Modbus addressing that is very helpful in understanding it.

Aviraj

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: 'Illegal Function' and 'Illegal Data Address' messages
« Reply #4 on: December 02, 2015, 12:21:55 PM »
Ok, I will have a look at the forum and I just confirmed that the PLC actually does support those function codes.

http://www.automationdirect.com/static/manuals/d006userm/d06uservol1.pdf

Page 142, it states it as 01, 02, 05 etc.

So when I explicitly add a 01 in front of the output address, e.g. 0102053 to read the state of the output, that 'Illegal Function' message does not show! However, I still cannot see the correct state though.

Thanks a lot

Aviraj

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: 'Illegal Function' and 'Illegal Data Address' messages
« Reply #5 on: December 03, 2015, 11:41:25 AM »
The address 0102053 tells the driver to use function code 1 to read offset 102053

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: 'Illegal Function' and 'Illegal Data Address' messages
« Reply #6 on: December 03, 2015, 11:45:50 AM »
It looks like the address range for inputs and outputs is 0-1777, so you would use an addresses  like 00000 through 01777 for outputs