Introduction / Overview - Mantracourt T24-BSi Technical Manual

T24 series
Hide thumbs Also See for T24-BSi:
Table of Contents

Advertisement

Introduction / Overview

This manual contains advanced information on T24 telemetry range of devices. This includes more detailed
information than supplied in the device manuals and also programming information.
To communicate with T24 devices a base station is required. Base stations will offer RS232, RS485 and USB
interfaces.
Refer to the Base Station section T24-BSi and T24-BSU for details on connections and interfacing.
2.4GHz Radio General
Communicating with T24 Devices
To communicate with T24 devices a base station is required. Base stations offer RS232, RS485 and USB interfaces.
In this section we will describe the interfaces and how data shall be sent to and retrieved from other T24 devices
via the base station.
For details regarding device specific communications you will need to refer to the appropriate device section of
the manual.
Packet Types
There are several different packet types which are used depending on the type of data carried.
Read and Write packets are used to communicate with a device (When it is awake) and can read or write
parameter values.
Some devices transmit data at regular intervals and this data does not need requesting.
Woken packets are received when a device is successfully woken.
Packet Structure
All packets conform to the following structure. The Data Packet part changes depending on what packet is being
transported.
**Length
**Length
1 Byte
1 Byte
This Transport Packet is used to carry the Data Packets into and out of the target device via the base station.
Where:
Length bytes are identical and contain the length of just the Data Packet section.
The CRC bytes are CRC 16 values of all bytes from Length up to and including Data section.
Base Address is the address of the base station used where multiple base stations are deployed. Base station
addresses can range from 1 to 16 and is set by DIP switches on the base station. NOTE: The T24-BSU is fixed
at address 1.
The Packet Type byte defines the packet type thus defining the Data Packet Structure. In received packets
this byte also indicates Error, Low Battery and Broadcast status.
Handling Base Station Data
The packets arriving at the base station serial or USB port are not handshaken. Data may arrive as a partial
packet or many packets may arrive together. Therefore the recommended best practice to handle data is to place
arriving data into a circular buffer and to detect the packets from this buffer by looking for a length byte pair.
Then look forward in the buffer at the CRC position (if the buffer contains enough bytes) and check whether the
CRC is valid. If so you can extract and use the packet. If not then advance the start of the circular buffer until
you find a matching byte pair then check for a valid CRC again.
CRC
The CRC algorithm is identical to that used in Modbus communications and should be calculated for outgoing
packets and checked on incoming packets. The following BASIC example is of a function that will calculate the
CRC of a string and append the two CRC bytes to the end of the string
SUB GenerateCRC16(sTarget AS STRING)
Mantracourt Electronics Limited T24 Technical Manual
Base
Packet
Address
Type
1 Byte
1 Byte
* CRC calculated on this part
** Length refers to this section
Data Packet Structure
Variable Bytes
*CRC1 LSB
*CRC2 MSB
1 Byte
1 Byte
6

Advertisement

Table of Contents
loading

Table of Contents