Contact Us .............................................................. 10
Overview
INTRODUCTION
Thank you for choosing the XP2i Digital Test Gauge from Crystal Engineering Corporation. Your XP2i is a combination of leading edge technology and rugged
industrial design.
—
Your XP2i can be congured through the use of CongXP™ software available from Crystal Engineering. Your personal computer can disable, enable, or
modify a variety of features of your XP2i. Look for the
A user dened pressure scale, and/or disable unused pressure units
•
Password protection to prevent unauthorized changes
•
Disable keypad recalibration, peak button, and/or units button
•
Expand or decrease allowable Zero range
•
Set the gauge to a dierent density of water factor (4°C, 60°F, or 68°F)
•
Store a 12 digit ID or tag number in non-volatile memory
•
Adjust calibration values
•
We hope your XP2i meets your expectations, and we’re interested in any comments or suggestions you may have.
You can send us a note at: crystal@ametek.com Many features in this and our other products are a direct result of your comments!
logo for programmable features, like:
Overview 1
he XP2i can be connected to a personal computer via RS-232, using an ordinary DB9 extension cable (male DB9 for the XP2i connection, female DB9 for the
T
PC side). The interface lets you record displayed readings and recorded peaks. The data string always includes the pressure units.
The XP2i 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 incorpo-
rate them into your own software program.
I/O Settings
The serial interface settings are:
Baud RateData BitsParityStop BitsFlow Control
96008None1None
XP2i Programming Instruction Manual
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 XP2i 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 XP2i will evaluate whatever it has received and try to match it to its table of commands.
If the command is incomplete, it will fail to match and the XP2i 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 rst contains a oating-point value, and the second
contains the name of the measurement unit. Each line is right-justied in a xed width 10 character eld. (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 XP2i. For example, a pressure query of a 300 PSI XP2i on the mbar scale could return a reading like this:
2478.
mbar
If low batteries cause the low battery message to be displayed, then any pressure query will replace the pressure value with the letters “BATT”.
Overview 2
Message Store
?MSG . . . . . . . .Retrieve the data (usually tag# or ID) from the message store.
Model
?MOD . . . . . . . .Return the model name, up to 20 characters long. For example, a 100 PSI XP2i would return the following:
100PSIXP2I
Pressure
?P,U . . . . . . . .Pressure returns the pressure value, followed by the pressure unit on the second line.
Example:
-7.89
mmH2O
XP2i Programming Instruction Manual
Pressure (one line)
?PRE . . . . . . . .Returns data and units on one line, and separates the reading and units with a comma.
Example:
2.01,PSI
Pressure, High
?P,H . . . . . . . .Pressure, High returns the stored peak pressure value, in whatever pressure units are currently being displayed.
91.3
mmH2O
Pressure, Low
?P,L . . . . . . . .Pressure, Low returns the peak low, or “valley” measurement, in the pressure units currently being displayed.
-10.7
mmH2O
Overview 3
Range
?RNG . . . . . . . .Range, returns the pressure range of the gauge. It is returned in two, 10 character lines.
The rst line is the value, the second line is the pressure unit. For example, a 100 PSI XP2i would return.
100.00
PSI
Return Average Pressure
?P,A . . . . . . . .Using the same format as the “?P,U” command, the average pressure is returned. If averaging is disabled, “X,0” is returned.
Enable averaging through CongXP.
Return the Average Window Size
?AVS . . . . . . . .The average sample size is returned. If averaging is disabled, “X,0” is returned. Enable averaging through CongXP.
XP2i Programming Instruction Manual
Serial Number
?SN# . . . . . . . . The serial number is returned in two strings. A typical example is shown below:
3
12659
Version
?VER . . . . . .Version returns the XP2i’s rmware version as a 4 digit number preceded by the letter “R”. This number is for factory use only.
Example version number:
R0101
Water Density
?H2O . . . . . . . .Applies only to models that include inches of water. Water density returns the current setting for the density of water in terms of
temperature with one of three values possible:
_4C
Overview 4
60F
68F
Zero Check
?Z,U . . . . . . . .Zero Check reveals how much was subtracted from the reading to zero the gauge in the pressure units currently being displayed.
When batteries are installed or the XP2i is reset, the zero is cleared and equals zero.
32.7
kPa
XP2i Programming Instruction Manual
Commands
The following are commands. All commands start with an exclamation mark (!).
GENERAL COMMANDS
Clear Peaks
—
!CLR . . . . . . . .Clear high and peak low values by setting them to the current live reading (which might not be zero). For instance, if the current live reading
were 253 PSI, then both high and low peak registers would contain 253.
Disable/Enable Peak Display
Prevent peak pressure readings from being displayed and disables peak button operation. Works with standard peak mode only.
This command does not aect the display of the PSVtest mode. The PSVtest mode can only be disabled through CongXP.
!NPK . . . . . . . .Prevents peaks from being displayed.
!MSGx . . . . . .Up to 12 characters (usually tag# or ID) can be stored in EEPROM. Set the message with “!MSGx” where “x” is the message.
Next Pressure Unit
!I,P . . . . . . . .This command is acknowledged with a simple “A,Ø”. To check which units were selected, send the command “?P,U” to return the pressure
value and the current pressure units.
No Auto O
!NAO . . . . . . . .Prevents automatic shutdown. The default setting of the XP2i allows the product to automatically shut down 20 minutes after the last button
push or the last RS-232 command. This command will return:
NO
AUTO
OFF
To re-enable automatic shutdown, send the reset !YAO (Yes Auto O) command. This command will return: Auto Off 20 denoting the ability to turn
o the product after 20 minutes of inactivity. The
mand is used.
!NAO and !YAO settings are retained when the product is powered down or when a reset (“!RST”) com-
XP2i Programming Instruction Manual
Reset
!RST . . . . . . . .This command schedules a reset. There will be a three second pause before the XP2i resets; during this time, no commands or queries
should be sent to the unit. When the unit resets, a product identication string, called the Boot Signature, is sent. (See the Programming
on page 9 for more information.) Some communication noise, including a serial framing error, is possible on reset. Resetting the XP2i clears
the zero value, clears the peak high and peak low values, enables automatic shutdown after 20 minutes of inactivity (resetting that timer to
20 minutes on reset), and selects the rst pressure unit on the XP2i (which can vary with product type, but will be consistent for each reset
operation). After a reset, you should query and/or select appropriate measurement units using the “
command fails to operate properly, or appears to “lock up” the device, contact technical support.
?P,U” and “!I,P” commands. If the reset
Tips
Set the Average Window Size
!AVS x � � � Sets the number of pressure reading to be averaged. The valid range is from 1 through 10, i.e. !AVS 5<CR> or !AVS 10<CR>.
If an invalid size is entered, or averaging is disabled, “
X,0” is returned. Averaging is enabled with CongXP, only.
Streaming Data On/O
!SP1 . . . . . . . .Displayed pressure is sent out of the serial port after each new reading at a rate of approximately 4 readings per second, and returns data in the
same format as the
?PRE query. When the gauge is in PSVtest mode the rate is approximately 8 readings per second.
!_4C . . . . . . . .Set the density of water to 4°C (39.2°F)
!60F . . . . . . . .Set the density of water to 15.6°C (60°F)
!68F . . . . . . . .Set the density of water to 20°C (68°F)
Zero
!ZER . . . . . . . .Zeroes the pressure readings by setting a zero value equal to the current applied pressure. The zero cannot be cancelled, but it can be reloaded
by calling this command again. To check the zero value, send the Zero Check command (“
abling it, send the reset (“
!RST”) command. (Read the Reset section rst to be sure you understand all eects of performing a reset.)
?Z,U”). If you want to disable the zero after en-
XP2i Programming Instruction Manual
ACKNOWLEDGMENT OF A COMMAND
The XP2i always returns some indication to let you know a command or query was received and acted on. For queries, the return of the measurement data is
the acknowledgment. For commands, possible acknowledgments are “
—
were any reception errors. The combination is left justied.
A . . . . . . . . . . . . .The XP2i understood the command and acted on it.
N . . . . . . . . . . . . .The XP2i did not understand the command, due to either syntax or reception errors.
X . . . . . . . . . . . . .The command was understood, but is not implemented or supported at this time.
A”, “ N” or “X”, followed by a comma then a single digit. The digit indicates whether there
Commands 7
Following an “
Ø . . . . . . . . . . . . .There were no reception errors.
2 . . . . . . . . . . . . .Buer overow.
4 . . . . . . . . . . . . .Framing error.
6 . . . . . . . . . . . . .There were both buer overow and framing errors.
Example acknowledgment:
A,Ø . . . . . . . . .Understood the command and acted on it. No reception errors.
N,4 . . . . . . . . .Could not understand the command because there was a framing error.
N,Ø . . . . . . . . .Could not understand the command, even though it was received without errors, so syntax must have been wrong.
A”, “ N” or “X”, the single digits mean the following:
XP2i Programming Instruction Manual
Support
TROUBLESHOOTING THE DIGITAL INTERFACE
The following section gives possible reasons for various error codes.
—
N,Ø . . . . . . . . .The “Ø” indicates there were no overrun or framing errors, so the command was properly received. However, the “N” means the XP2i could not
match it to any allowed command. This means the syntax must have been wrong. The command is rejected and nothing is done.
X
Possible reasons:
Instruction sent without a comma between “P” and “U” of the “?P,U” query.
•
More than 30 seconds passed to nish a command.
•
Line termination is incorrect; send carriage returns (CR) only, do not send line feeds (LF).
•
N,2 . . . . . . . . .XP2i buer overow, no action. In an overrun, bytes are lost, consequently the XP2i will not be able to match the command string. If it can’t nd
a match, it returns “
X
Possible reason:
Not enough time allowed between commands. Check the communication parameters.
•
N”.
Support 8
N,4 . . . . . . . . .Framing error: Bytes were lost. Therefore, the command could not be matched. A framing error can sometimes occur after power-on, after reset,
or when the batteries are changed; see the Programming Tips on page 9 for suggestions on handling this.
X
Possible reasons:
Noise on the line either created a false start bit or obscured the stop bit.
•
Multiple, but infrequent, framing errors are probably due to noise on the connection.
•
Frequent framing errors likely mean the XP2i or the PC is not operating at precisely 9600 Baud.
•
Occasionally, plugging the RS-232 connection into the XP2i will create a single framing error.
•
N,6 . . . . . . . . .Both buer overrun (N,2) and framing errors (N,2) occurred during this command. The “6” represents the binary OR masking of the two bits
used to indicate a buer overrun (bit 1) and a framing error (bit 2).
X
Possible reason:
Look at “Possible reasons” for troubleshooting the N,2 and N,4 error codes, above.
•
XP2i Programming Instruction Manual
EFFECTS OF PASSWORD PROTECTION ON COMMANDS
If the XP2i is password protected, the following commands will have no eect and return “X,0”:
!_4C, !60F, !68F, !NPK, !PKS, !MSG, !RAS, and !AVS.
—
PROGRAMMING TIPS
The XP2i is a very straightforward device to communicate with, provided you follow these tips. This advice is derived from our own experiences automating
systems based on the XP2i, as well as the experiences of our users; following these tips will help save you some time.
—
Anytime you establish (or re-establish) communications with the unit, you should use the following initialization sequence, which will help you deal with
possible noise due to reset, etc.:
Support 9
Reset the unit (unless you must preserve zero, peak values, etc.) by sending the “
1
2 Wait 15 seconds.
3 Read the Bootloader Signature, even if you ignore it, to clear it from the PC’s input buer; see below for more details.
4 Send a carriage return to clear any noise in the XP2i’s input buer.
5 An error code, either “
6 Use the “
7 IF APPROPRIATE, zero the XP2i by sending the “
8 IF APPROPRIATE, clear the high and low peak values to the current pressure (zero, if you followed step 6) by sending the “
9 If you are logging data, you should log the serial number of the unit for traceability purposes by using the “
You should also log the product code, hardware revision and rmware version with the “
10 Disable automatic shutdown with the “
?P,U” and “!I,P” commands to select the pressure unit you want to use.
N,Ø” or “N,4” will be returned; this is normal (you have sent an empty command); read it to clear it. The buers are now reset.
!ZER” command, since the zero value will be clear.
!NAO” command.
!RST” command.
?SN#” command.
?VER” command.
!CLR” command.
XP2i Programming Instruction Manual
BOOTLOADER SIGNATURE
A quick note about the Bootloader Signature: This string contains a 19 character, product-specic string (whose contents may vary with product revision),
followed by a carriage return (CR), making the total string length 20 bytes. However, a reset turns the RS-232 interface on and o, so it may be subject to
—
NULL may be received before the signature is sent, and the rst character or so of the Bootloader Signature may be corrupted. A framing error is
noise; a
also possible. The procedure above will deal with this situation properly. Should you want to parse the bootloader signature, it has the following format:
=xxxxxxxxxxxxxxxxx=” where x will vary with product revision. The bootloader signature is used by the rmware upgrade tool, but should NOT be
“
used to identify the rmware version; use the “
can use this signature to determine which device is in use.
Note: Any time you detect the Bootloader Signature, the unit has been reset, or disconnected from and reconnected to power; turning the unit on and o
with the button will not send the Bootloader Signature. You can use this behavior to detect a battery change, or a problem with the XP2i.
Some commands may take up to 500 milliseconds to return a reply. You should always wait at least 50 milliseconds after each reply is received before sending
the next command. After a reset command it may take up to 15 seconds before the gauge resumes normal operation.
Data transmitted from the XP2i will always be 7-bit ASCII. Any high-ASCII characters indicate a line-noise problem, or a problem with the XP2i or PC.
The XP2i has very thorough integrity checks to catch corruption of program or calibration data memory. Should the data memory integrity check fail, the unit
displays “
your program. Should the program memory integrity check fail, the unit will continuously reset, blinking the LCD on and o, and the serial output will alter-
nate between the bootloader signature and a line reading “
contact technical support for details.
ERR 1” on the display as the value line of the serial output. It is important to check for this, or you may mis-parse that line as “1 PSI”, depending on
?VER” command for that purpose. If you have a system that may have Crystal DTG or XP2i units attached, you
CRC FAIL”. This condition can be recovered from in the eld by reloading the unit’s rmware;
If calling, have ready the model number, serial number, date of purchase, and reason for return. You will receive instructions for returning the device to us.