
63
As a policy of continual improvement, STAUFF reserves the right to alter the specification without prior notice.
201.031
Date of Issue: 06 November 2018
The <250 bytes of data> contains the contents of the 125 registers requested. Each 16 bit register is
encoded in two sequential bytes, in high-
low (“big-endian”) order.
The simplest method is then to read the required registers directly out of the data area of this response
frame. For example, the LPM product ID code appears in Modbus register 0. This would therefore
appear in the first two bytes of the data area above, or at the 4th and 5th bytes counting from the start of
the frame. In a programming language
like “C” the product ID could be extracted from an array
containing the frame using a statement like:
unsigned product_id = 256*buf[3+0] + buf[3+1];
Users of PLCs or other programming languages will hopefully be able to translate using the information
provided here.
The LPM product ID is 0xD3DD (hexadecimal) or 54237 (decimal). This fact can be used as a check
when attempting the above implementation.
Finally we come to extracting the test result. Referring to the LPM Modbus register map, the test result
codes appear in registers 56-63. In the case of NAS1638, the overall NAS code is in register 56. So a
program can extract the overall NAS code from the result frame using lo
gic equivalent to the “C”
language expression:
unsigned NAS = 256*buf[3 + 56*2 + 0] + buf[3 + 56*2 + 1]
This is a statement in the “C” programming language that reads the 116th and 117th bytes of the
response frame, and forms a 16 bit number from these two 8 bit bytes. This reads modbus register 56,
the NAS code.
Similar expressions can be used to read the other registers according to the data required.
For PLC users the details will be dependent on their own programming environment and facilities. But
hopefully the above can be used as a guide for their own implementation.