Up

 

  

 
TDVCmdProtocol

The TDVCmdProtocol is a simple text-format where commands and values are separated with the ‘;’-character. A command is defined as a string and a value is defined by a tag and a value separated with an ‘=’ character.

A typical message consists of a command and a couple of values:

Example : watch;program=scorpion;value=on

Using a text protocol where values are identified with tags and commands are commands means that application protocols can be defined and extended without having the receiving parser to fail even if command or values not known are received.

The RS232TDVCmdProtocol defines the following transport layer to securely transmit the messages over RS-232. The protocol is kept very simple to make it easy to implement it on any device or controller.

  • <stx> is used to start the packet. By default <stx> has ASCII value 02h.
  • <etx> is used to end a packet. <etx> has ASCII value 03h.

An optional <checksum> is two bytes wide and is inserted before <etx>
The data sent over the wire without checksum is:

  •  <stx>watch;program=scorpion;value=on<etx>

with checksum:

  • <stx>watch;program=scorpion;value=on;<checksum><etx>

Supported packetformats

The following packet formats are supported:

  1. stx <Data> etx
  2. stx <Data> <Checksum> etx
  3. soh stx <Data> etx
  4. stx <Data> etx cr
  5. <Data> cr
  6. <Data> cr lf
  7. <Data> lf
  8. soh <Data> etb

where

  • stx - start of text
  • etx - end of text
  • cr - carriage return
  • soh - start of header
  • etb - end of tran. block
  • Data - is printable ascii characters on tdvcmdprotocol format

Checksum

The checksum is represented by a 2-character ASCII hexadecimal format and is transmitted along with the data string. The checksum equals the modulo-256 (100h) sum of all the ASCII values in the data string.

In the above example the checksum is:

77h (w) + 61h (a) + 74h (t) + 63h (c) + 68h (h) + 3Bh (;) +
70h (p) + 72h (r) + 6Fh (o) + 67h (g) + 72h (r) + 61h (a) + 6Dh (m) + 3Dh (=) +
73h (s) + 63h (c) + 6Fh (o) + 72h (r) + 70h (p) + 69h (i) + 6Fh (o) + 6Eh (n) + 3Bh (;) +
76h (v) + 61h (a) + 6Ch (l) + 75h (u) + 65h (e) + 3Dh (=) + 6Fh (o) + 6Eh (n)

= C66h mod 100h = 66h

Ascii Table






 

 

 

Scorpion Vision Version XII : Build 646 - Date: 20170225
Scorpion Vision Software® is a registered trademark of Tordivel AS.
Copyright © 2000 - 2017 Tordivel AS.