Technical FAQs

Ask a Question

EGX300 Custom web page troubleshooting - getting '801a' text instead of register value

Troubleshooting EGX300 custom web pages.

Related to resolution FA180074 and error code 0x801a - Unknown Error, when experimenting with custom web pages, the error code "801a" appears as a text in the custom web page, instead of a register value or comma (,) separated registers values.
EGX300 is in reality receiving Exception 01: "Illegal Function Code".
Why and when the "801a" error appears?
It appears when a device/script within EGX300 sends a Modbus request containing an unknown Modbus function code to a Slave.
For example: Modbus Scattered Read of Holding Registers is performed using Modbus function 100. When incorrectly setting up a device as, say PM3255 type, while the real device is a pure Modbus device (could be even a simulator), the EGX will try to perform scattered reads on the Modbus Slave using function code 100. The Slave does not understand the request and correctly replies with Exception 01: "Illegal Function Code".
Though, the web page is showing "801a" text instead of requested and expected register values.
If the JavaScript in the custom web page is requesting the registers 3011, 3037 and 3111, the script will contain this:
"Registers = [PL__1^3011,3037,3111__PL];"
The answer from EGX300 firmware to Client browser (this is visible in the source code of the shtml page) will be the JavaScript substituted like this:
"Registers = ['801a'];"
While the actual device register values would be for example: 1234, 5678, 9999 an expected answer should be:
"Registers = ['1234,5678,9999'];".
This is NOT happening because Modbus Function Code 100 - Holding Registers Scattered Read is NOT understood by the Slave, hence it replies with Exception 01: "Illegal Function Code". The EGX300 firmware takes this answer and does the above described replacement.

Causes and Fixes:
This is a "problem" of the Slave Device, not of EGX300.
To fix this issue on the EGX300 side, the script has to be changed to use Modbus Function Code 3.
To keep consistency with the above example, there are 2 possibilities:
1) to read as a block of 101 registers which includes all we need: "Registers = [PL__1^H3011[101]__PL];"
2) to read as 3 separate requests:
"Register1 =[PL__1^H3011[1]__PL];
 Register2 =[PL__1^H3037[1]__PL];
 Register3 =[PL__1^H3111[1]__PL];"

Created on 22nd OCT 2015 by
Adrian Dicea
Global Expert Technical Support Engineer - Support Prime PSE / EGX
Was this helpful?
What can we do to improve the information ?