beautypg.com

Host protocol – Dynasonics TFXP Series Transit Time Ultrasonic Flow Meter User Manual

Page 118

background image

Digital Communications Protocol for TFX Flow Meters

Host protocol

A digital communications protocol is utilized. Each message is guarded with the standard CRC-16
error detection (C source code is included)

The host protocol is a master-slave type protocol with the flowmeter being the slave. The
messages have the following format:

A unit may be assigned an address that responds to (valid addresses are 1-7E). All devices
respond to address 7F (ie. this address may not be used for multidrop) and all devices listen to
address 0 but do not respond (this is the “broadcast” address).

The following special commands are defined:

Command

Description

65

Special “short” commands

66

Special “long” commands

Command 65 allows up to 255 data items to be transferred while command 66 allows up to
65535 items (The actual maximum size is limited by the memory allocated for the communication
buffers and for TOF it is 2048 bytes). There is special encoding for the data for commands 65 and
66 as follows:

Command 65:

1

>…

N-1

>

N =

Command 66:

1

>…

N-1

>

N = *256 +

The target device will respond the same for both 65 and 66 commands. The host program needs
to make sure that the proper opcode will be used based on the data size requested.

In case of an error, the target will reject the message by replying with an error code. The target
will not reply to an ill-formed command (ie. incomplete or CRC-16 error). The error reply is:

where:

is the requested opcode with the Most Significant bit turned on.

The following error codes are defined:

Error Code

Description

1

Bad Command (Invalid command)

2

Bad Command Data

71h

Command not allowed.

72h

Buffer overflow (data exceeded internal allocated memory)

73h

Command not implemented in this version