Pages: [1]   Go Down
Author Topic: Telocator Alphanumeric Protocol (TAP)  (Read 1080 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been trying to learn about how to read Telocator Alphanumeric Protocol (TAP) messages being sent from a serial device. The system I would like to interface to is sending rs232 via TAP protocol. This information is typically sent to a paging transmitter, but I would like to read the data into my aduino. The TAP protcol needs to see the following series of events -
RED is what Arduino expects in TAP unit :
Green is what Arduino will send out in TAP units:
Listed below is a proper TAP sequence:
 
<CR>ID=
<ESC>PG1<CR><CR><ACK><CR><ESC>[p<CR>

<STX>101<CR>TEST PAGE<CR><ETX>32><CR><CR><ACK><CR>
<EOT><CR><CR><ESC><EOT><CR>
Would anyone have any advice on or sample code to do this initial sequence in arduino. How do you send a CR, ACK or ETX character?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 553
Posts: 46299
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
How do you send a CR, ACK or ETX character?
Look at an ASCII table. The values are listed. Use Serial.write() to send them.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12487
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


see - http://www.asciitable.com/ -

pseudocode not tested
Code:
#define NUL    0
#define SOH    1
#define STX    2
#define ETX    3
#define EOT    4

#define ACK    6

#define CR     13

#define ESC   27
// etc...

void setup()
{
  Serial.begin(...);
 
  Serial.write(CR);
  Serial.print("ID=");

  Serial.write(ESC);
  Serial.print("PG1");
  Serial.write(CR);

  // etc

}

There are other ways to do it ...
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 :smiley-mr-green:Thanks for the replies. I was looking at the ascii chart, just wasn't sure how to send the non printable ascii characters. Thanks robtillaart for the sample code, this will definately help me get started in the right direction.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12487
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


please notice the difference between  Serial.write  which sends one byte and  the Serial.print / Serial.println

longer commands you can put in a byte array and have a function write them all
Code:
void SerialWriteArray(uint8_t * ar, uint8_t len)
{
  for (uint8_t i=0; i< len; i++) Serial.write(ar[i]);
}
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 553
Posts: 46299
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
longer commands you can put in a byte array and have a function write them all
There is an array version of Serial.write() that does that. The second argument is the length of the array.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


please notice the difference between  Serial.write  which sends one byte and  the Serial.print / Serial.println

longer commands you can put in a byte array and have a function write them all
Code:
void SerialWriteArray(uint8_t * ar, uint8_t len)
{
  for (uint8_t i=0; i< len; i++) Serial.write(ar[i]);
}

Thanks, this all VERY helpful. Would I be correct in using the Serial.Write command if using software serial. I am using pins 2 (RX) & 3 (TX) to communicate with the TAP sending device, then using the hardware serial to display the serial data coming in to the arduino.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 553
Posts: 46299
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Would I be correct in using the Serial.Write command if using software serial.
You would be correct in using the write() method (lower case w) of the SoftwareSerial instance, not the write() method of the Serial instance.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Bicycler

Im looking at creating a TAP server for my alarm system, using the ARM processor..

Have you completed your project ??

Would it be possible to view your code ?, this would give me a head start !

Thank you
Stephen
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Stephen,
I'm still working on my code. I did have another post at this link http://arduino.cc/forum/index.php/topic,101688.0.html. It was about reading serial inputs and parsing. Hopefully it helps. I will post my code if I ever get it figured out.
Logged

Pages: [1]   Go Up
Jump to: