~ 15 ~
PEF-
321АВР
NOVATEK-ELECTRO
The subroutine for generating LRC checksum is in C language:
1: uint8_t GenerateLRC(uint8_t *p
СendRecvBuf, uint16_t uCount)
2: {
3: uint8_t lrc = 0x00;
4: uint16_t i;
5: for(i=0; i<(uCount-1); i++){
6: lrc = (lrc + p
СendRecvbuf[i]) & 0xFF;
7: }
8: lrc = ((lrc ^ 0xFF) + 2) & 0xFF;
9: returnlrc;
10: }
6.3.4 Set of instructions
6.3.4.1 Function 0x03 - read operation of a group of registers
The 0x03 function reads the contents of 321ABP registers. The master
‟s request contains the address of the
initial register, as well as the number of words to read.
Answerback of
321АВР contains the number of bytes returned and the requested data. The number of
registers returned is limited to 50. If the number of registers in the request exceeds 50, the response is not split
into frames.
An example of a request and response in the
MODBUS RTU
is shown in Figure 11.
Request
Address
Function
In. address
HB
In. address
LB
Number of words
HB
Number of words
LB
CRC LB
CTC HB
01h
03h
00h
A0h
00h
02h
C4h
29h
Answerback
Address
Function
Number of
bytes
HW HB
data
HW LB
data
LW HB
data
LW LB
data
CRC LB
CTC HB
01h
03h
04h
44h
7Ah
00h
00h
CFh
1Ah
Fig. 11 -
Example of request and response of function 0x03 - reading a group of registers
6.3.4.2 Function 0x06 - register entry
Func
tion 0x06 provides writing to one 321ABP register. The master‟s request contains the address of the
register and data for entering.
The answer of the device coincides with the request of the master unit and contains the address of the
register and the established data. An example of a request and answer in the
MODBUS RTU
mode is shown in
Figure 12.
Request
– register 00A0h = 1000 (INT)
Address
Function
In. address
HB
In. address
LB
HB
data
LB
data
CRC LB
CTC HB
01h
06h
00h
A0h
03h
E8h
89h
56h
Answerback
Address
Function
In. address
HB
In. address
LB
HB
data
LB
data
CRC LB
CTC HB
01h
06h
00h
A0h
03h
E8h
89h
56h
Fig. 12
- Example of request and answer of function 0x06 - register setting
7 MAINTENANCE
7.1
Safety precautions
THE TERMINALS AND THE DEVICE INTERNAL ELEMENTS CONTAINS POTENTIALLY LETHAL
VOLTAGE.
DURING MAINTENANCE IT IS NECESSARY TO DISABLE THE DEVICE AND CONNECTED
DEVICES FROM THE MAINS.
7.2
Maintenance of the device must be performed by the skilled professionals
.
7.3
Recommended frequency of maintenance is
every six months
.
7.4
Maintenance Procedure
:
1) Check the connection reliability of the wires, if necessary, clamp with the force specified in Table 1;
2) Visually check the integrity of the housing, in case of detection of cracks and damages take the device out
of service and send for repair;
3) If necessary, wipe the front panel and the housing of the device with cloth.
Do not use abrasives and solvents for cleaning.