Newland NLS-HR100L Guia Del Usuario página 22

Tabla de contenido

Publicidad

** Enter Setup
Enable/Disable EEPROM Write
By default, EEPROM write is disabled after the device is powered up. You need to enable it before a write
operation and recommendedly disable it afterwards to prevent miswriting.
Syntax: {Prefix1} {Types} {Lens} {Address} {Datas} {FCS}
Prefix1 : 0x7E 0x00
Types
: 0x03 (EEPROM write enable)/ 0x00 (EEPROM write disable)
Lens
: Byte count of Datas, 0x01 recommended.
Address : No specific significance.
Datas
: No specific significance.
FCS
: CRC-CCITT checksum (2 bytes).
Computation sequence: Types+ Lens+Address+Datas;
polynomial: X
The following C language program is provided for reference.
unsigned int crc_cal_by_bit(unsigned char* ptr, unsigned int len)
{
unsigned int crc = 0;
while(len-- != 0)
{
for(unsigned char i = 0x80; i != 0; i /= 2)
{
crc *= 2;
if((crc&0x10000) !=0)
crc ^= 0x11021;
if((*ptr&i) != 0)
crc ^= 0x1021;
}
ptr++;
}
return crc;
}
Exit Setup
16
12
5
+X
+X
+1 (0x1021), initial value: 0x0000.
18

Publicidad

Tabla de contenido
loading

Este manual también es adecuado para:

Nls-hr100l-70

Tabla de contenido