Command Programming
Besides the barcode programming method, the EM3095 can also be configured by serial commands sent
from the host device. Note that communication parameters on the engine and the host must match so
that two devices can communicate with each other. The default settings of the engine are 9600bps, no
parity check, 8 data bits, 1 stop bit, and no flow control. The engine uses 8-bit registers.
Read Register
The read command is used to read the contents of 1 to 256 contiguous registers in the engine.
Syntax: {Prefix1} {Types} {Lens} {Address} {Datas} {FCS}
Prefix1 : 0x7E 0x00
Types : 0x07
Lens
: 0x01
Address: 0x0000~0x00FF, starting register address.
Datas : 0x00~0xFF, number of registers to be read. When Datas=0x00, 256 contiguous
FCS
: CRC-CCITT checksum, 2 bytes.
Computation sequence: Types+ Lens+Address+Datas;
polynomial: X
The following C language program is provided for reference.
3
registers are to be read.
16
12
5
+X
+X
+1 (0x1021), initial value: 0x0000.