beautypg.com

Binary protocol, Rs232 interface, Datagram structure – PNI TCM 5 User Manual

Page 29: Parameter formats, 3 binary protocol – rs232 interface, 1 datagram structure, 2 parameter formats

background image

PNI Sensor Corporation

Doc #1007537 r12

TCM3 & TCM5 User Manual

– Sept 2012

Page 29

4.3 Binary Protocol

– RS232 Interface

4.3.1 Datagram Structure

Transport Layer for RS-232 communication:

ByteCount

(UInt16)

Packet Frame

(1 - 4092 UInt8)

CRC-16
(UInt16)

Payload

(1 - 4091 UInt8)

Frame

ID

(UInt8)

Note:

1. ByteCount is the total number of bytes in the packet including the CRC-16
2. CRC-16 is calculated starting from the ByteCount to the last byte of the Packet Frame (see in-

cluded C function at end of document).

3. ByteCount and CRC-16 are always transmitted in BIG ENDIAN.

4.3.2 Parameter Formats


Floating Point
The floating-point based parameters are in the IEEE standard format, ANSI/IEEE Std 754-1985.

64-Bit (double precision floating point)
Shown below is the 64-bit float format in big endian, in little endian bytes are in reverse order in 4
byte groups (ie: big endian:ABCDEFGH little endian: DCBA HGFE).

Exponent

S

Mantissa

63 62

52 51

0


The value (v) is determined as (if and only if 0 < Exponent < 2047): v = (-1)

S

* 2

(Exponent-1023)

* 1.Mantissa

This manual is related to the following products: