PN: 2975 Rev F, 3/2004
Page 10 of 24
PRESSURE is Our BUSINESS
™
Digital Interface
The XP2 can be connected to a personal computer via RS-232, using an ordinary DB9
extension cable (male DB9 for the XP2 connection, female DB9 for the PC side). The
interface lets you record displayed readings and recorded peaks. The data string always
includes the pressure units. And the XP2 can be operated remotely, as if you were pressing
the buttons. You can use a simple terminal program to send the commands, or, you can
incorporate them into your own software program.
Turn off the XP2 before connecting the RS-232 cable - if the gauge is on while connecting it
may reset, and clear the zero/tare and the recorded peak values.
I/O Settings
The serial interface settings are:
Baud Rate Parity Data Bits Stop Bits Flow Control
9600 None 8 1 Hardware (CTS/RTS)
Communication Format
Input is case-sensitive; all instructions should be sent in UPPERCASE. Instructions must be
terminated with a single carriage return (CR) character followed by an optional linefeed (LF)
character. Note that while the XP2 expects either CR or CR/LF as command termination on
its input, it always appends a CR/LF pair to its output. For reference, CR is ASCII value 13
decimal, while LF is ASCII character 10 decimal.
You have 30 seconds to complete an instruction. After 30 seconds, the XP2 will evaluate
whatever it has received and try to match it to its table of commands. Since the command is
incomplete, it will fail to match and the XP2 will return: N,Ø. (Negative acknowledgment with
no reception errors, so syntax is wrong.)
Query Instructions
All queries start with a question mark (?). Any pressure values returned are split across
two lines; the first contains a floating-point value, and the second contains the name of
the measurement unit. Each line is right-justified in a fixed width 10 character field. (Since
each line is terminated with a CR-LF pair, this means the total length of the response to a
measurement query is 24 bytes.) A decimal point will always be included with the pressure
value (for clarity) even if it is not displayed on the XP2. For example, a pressure query of a
300 PSI XP2 on the mbar scale could return a reading like this:
2478.
mbar
If the batteries are low enough to trip the low battery message, then any pressure query will
replace the pressure value with the letters “BATT”.
Pressure
?P,U Pressure returns the pressure value, followed by the pressure unit on the second
line. Example:
-7.89
mmH2O