file: vprc4cf_cmd.html
10 May 2007
ASIMET PRECIPITATION MODULE VERSION 4.xx with CompactFLASH COMMAND SET
See ASIMET MODULE OPERATIONS document for instructions
on how to hook up the comms link to your PC and RS-485 adapter.
Refer to Latest Version Information for
reference info on latest firmware version numbers.
CFLASH NOTE 1 - Firmware Ver 4.xx has been tested using SanDisk CompactFLASH
cards (256 MB and 64 MB) with SanDisk CompactFLASH PC Card (PCMCIA) Adapters on WHOI VO80053 Rev C/D CPU boards.
CFLASH NOTE 2 - CompactFLASH cards MUST be formatted using the I command
choice in the FOK command menu. CompactFLASH cards may be read on a PC and will contain 2 files:
a .INF user-defined Info file, and a .DAT Data file. Processing of the new .DAT file is identical to processing the
data files from older PCMCIA-based loggers, since the data file record format is unchanged.
NOTE: this module uses the VOSHPS type of sensor front-end. All PRC modules built after 1 Oct 98 will
use this sensor front-end. Also reference the
VOSHPS Front-End Module Command Set document.
Note: commands sent are indicated in BOLD, responses in normal text.
<crlf> represents ASCII carriage return and line feed; <crlfetx>
represents ASCII carriage return, line feed, ETX (03h).
Command Description
- A Address acknowledge
- returns address of module, terminated by <crlfetx>
- example:
#PRC01A PRC01<crlfetx>
- NOTE: PRC01 is the default address of the PRC module; it
may be changed by the 'U' command but any failure of
EEPROM will result in the use of the default address. In
the event of EEPROM failure, a message is sent to the RS-
232 console port on startup. In addition, use of
defaults is reported in the 'L' command.
- B Output both calibrated and raw values
- outputs both calibrated and raw data values, as follows:
PRC : counts<crlfetx>
- example:
#PRC01B 26.31 : 38265<crlfetx>
- PRC is precipitation level in mm; raw values are 16-bit counts.
- C language format: "%7.2f : %7u\r\n\x03"
- C Output calibrated data
- outputs calibrated value, in mm, as follows:
PRC Level in mm<crlfetx>
- example:
#PRC01C 35.24<crlfetx>
- C language format: "%7.1f\r\n\x03"
- D Set RT clock date/time: 'YYYY/MM/DD HH:MM:SS'
- on module startup, the date and time are initialized from
the battery-backed RTC on the DS87C530 chip. The 'D' command
accepts a fixed format string of exactly 19 characters
representing date and time. For example, sending the
following command:
- #PRC01D2007/04/18 10:35:15
will set the date to 18 April 2007 at 10:35:15 AM.
- the module returns <crlfetx> in acknowledgement.
- the time will be set at the instant that the last digit is
sent; thus you may enter the module address, command and
first 16 characters of the date and time, and finally
enter the 19th character in sync with your reference
clock. The current date and time may be determined using
the 'L' command.
- FOK Menu-driven CompactFLASH command operations
- Upon FOK command entry, and between each command, you will see a prompt:
Enter Flash Cmnd, ? or H for Help:
- a request for Help returns this message followed by another prompt:
Flash Help (All commands end with Enter)
C - Read card Capacity
D - Read the card Directory
E[I,D] - Erase the contents of the Info or Data files
F[W,R] - Write or Read the Info File
H{?} - Display this menu
I - Format & Initialize the card file structures
P - Read the next write & read sector Pointers
R{H,A}{SEC} - Read the next card sector (see P command above)
optional {H,A} -> Hex ASCII or printable ASCII
optional {SEC} -> specific sector number
S - Read the CF status (reg 7 and the ERRORs (reg 1), disp as HEX-ASCII
W{nnn} - Write 512 byte Test Msg to the Data file
optional {nnn} -> 1-3 digits of additional sectors to write
Q - Quit Flash operations
Enter Flash Cmnd, ? or H for Help:
- description of FOK Menu Commands:
- C - displays card capacity info
- D - displays a card directory (similar to a DOS "dir" command output):
Volume in drive is NEWLGR53
Directory of CF:
2007/04/24 19:10 35 LOGR001.INF
2007/04/25 16:42 523904 LOGR001.DAT
2 File(s) 523939 bytes
256179584 bytes free
- EI - erases the contents of the INFO file, and sets its size to 0
- ED - erases the contents of the DATA file, and sets its size to 0
- FR - reads the free-format ASCII contents of the INFO file
- FW - prompts for up to 600 characters of user info; CTRL-C terminates entry
into the INFO file
- I - formats & initializes the CFLASH card for use in the logger. A series of prompts
guides you through the process. This must be done before the logger will recognize the card and
use it for data storage.
- P - reads the next write and read sector pointers. In particular, the next
write sector pointer always indicates the last sector of data on the card. This is useful with the XMODE command.
Flash Write Pointer @ 1345
Flash Read Pointer @ 258
The write sector pointer is always restored to the currently available sector for new data whenever the logger
is powered up. The read pointer is reset to the INFO file sector on power up.
- R - read command allows a number of options, the most useful being the
RH and RH{SEC}
options. For example, to see what's in the last DATA sector, use the P command above to find the
current write sector, then use that in the RH{SEC} command to see the values. So, for the value
of the Flash Write Pointer above, send RH1345 to see the 512 bytes of that sector:
Reading Flash @ 1345
000 10 29 19 04 07 00 64 01 00 00 00 00 00 00 00 00 .)....d.........
010 00 00 0D F2 09 AC 00 00 08 F0 AD 2E 00 00 00 00 ................
020 00 00 00 00 00 00 00 00 00 00 00 00 30 D4 31 38 ............0.18
030 31 9C 32 00 07 5B CD 15 00 01 00 00 00 00 A5 A5 1.2..[..........
040 10 2A 19 04 07 00 65 01 00 00 00 00 00 00 00 00 .*....e.........
050 00 00 0D F2 09 AB 00 00 08 F5 AC F9 00 00 00 00 ................
060 00 00 00 00 00 00 00 00 00 00 00 00 30 D4 31 38 ............0.18
070 31 9C 32 00 07 5B CD 15 00 01 00 00 00 00 A5 A5 1.2..[..........
.
.
.
1B0 31 9C 32 00 07 5B CD 15 00 01 00 00 00 00 A5 A5 1.2..[..........
1C0 10 28 19 04 07 00 63 01 00 00 00 00 00 00 00 00 .(....c.........
1D0 00 00 0D F2 09 AA 00 00 08 D3 AD 6A 00 00 00 00 ...........j....
1E0 00 00 00 00 00 00 00 00 00 00 00 00 30 D4 31 38 ............0.18
1F0 31 9C 32 00 07 5B CD 15 00 01 00 00 00 00 A5 A5 1.2..[..........
If you want to read subsequent contiguous sectors, just do an RH at the next prompt, and the next
sector in sequence will display (1346 in this example). See Record Format
to decode the HEX dump.
- S - CF status info - internal WHOI use only
- W{nnn} - writes test data to the current write sector in the DATA file. Used only for
test. If you use this function, you should ED to erase the DATA file before deploying the
logger, unless you wish to incur the wrath of your data processing guru!
- Q - quit Flash ops and return to logger command mode
- New CFLASH Card Prep - when installing a CFLASH card for the first time, it must be initialized
for use in the logger. The "I" command, Format & Initialize card file structures is used
to prepare the CFLASH card for use. You will be prompted for a Volume name, an INFO File name,
and a DATA file name. The 3 character suffix of the INFO file is always .INF and the 3 character
suffix of the DATA file is always .DAT Once formatting is complete, you can get a directory with a
"D" command, or write user info into the INFO file with the "FW" command, then read the
INFO file back with the "FR" command.
- H Help
- #PRC01H - a multiple line response with text similar
to the first line of each command description in this
document as the help line, with each line terminated
<crlf> and final line terminated <crlfetx>, as follows:
Firmware VOSPRC53 V4.27cf
Module clock 2.4576 Mhz
A - Address acknowledge
B - Output both raw and cal
C - Output calibrated data
D - Set RT clock date/time: 'YY/MM/DD HH:MM:SS'
F - Compact FLASH card access - password 'OK'
H - Display Help message
I - Report ID information
L - Report ID, serial #, cal info, etc.
P - Enter polled test mode
Q - Request cal constants from VOSHPS
R - Output raw data
T - Enter test mode
U - Update EEPROM constants - password 'OK'
XMODE - XMODEM Dump CompactFLASH card via console
- Note: 'FOK' and 'XMODE' are not present unless a CompactFLASH card is
installed.
- I Report ID information
- L Report ID, serial #, cal info, etc.
- the 'L' command provides miscellaneous status information
about the module in a multi-line response. The number of
lines in the response may vary depending upon the EEPROM and
FLASH card status. Normally, after an initial <crlf>,
these lines of info are provided, as follows:
#PRC01L
module id from EEPROM<crlf>
module serial number from EEPROM<crlf>
firmware name and version from program EPROM<crlf>
calibration date from EEPROM<crlf>
current date and time<crlf>
PRC cal constants A, B, C, D
Compact Flash Card present - Compact Flash card status<crlf>
- example normal response (with CompactFLASH card):
PRC01
001
VOSPRC53 v4.02cf
NO CAL
2007/4/17 11:23:35
PRC: 0.00000e+00 2.40000e-02 0.00000e+00 0.00000e+00
Compact Flash Card present - Compact Flash OK!
Volume in drive is VOSPRC53
Directory of CF:
2007/04/24 19:10 35 VPRC001.INF
2007/05/01 16:14 1039232 VPRC001.DAT
2 File(s) 1039267 bytes
255664256 bytes
- the last line is terminated by <crlfetx>.
- NOTE 1: after initial startup, cal constants (which reside in
the VOSHPS sensor front-end) will not be displayed. The message
"Use 'Q'uery command to get constants from VOSHPS front end" will
be displayed. See 'Q' command below.
- NOTE 2: if a FLASH card is installed, a message
will indicate this and either OK or NOT LOGGING status
- NOTE 3: if no FLASH card present, the last two lines will be
replaced by "No CompactFLASH card installed" message.
- P Enter polled test mode
- Q Query command retrieves cal constants from VOSHPS sensor front-end.
- this command will take several seconds to execute; it must
power up the VOSHPS board, wait for VOSHPS initialization, then
request 2 sets of cal constants.
- the message "Requesting cal constants - " will be displayed
immediately. After the above noted delays, the message "OK!"
will be appended if successful, "FAILED!" if not successful.
- example:
#PRC01Q Requesting cal constants - OK!
- R Output raw value
- outputs raw data values, as follows:
counts<crlfetx>
- example:
#PRC01R 38075<crlfetx>
- C language format: "%7u\r\n\x03"
- T Enter test mode
- UOK Update EEPROM contents
- enters the update mode after confirmation of 'OK'
password. New EEPROM values may be entered in this mode.
- upon initial entry, you must send the letters OK after the
command or the command is ignored, e.g. #PRC01UOK. Upon
receipt of the correct password, a set of prompts will be
issued to allow entry of new module address, module
manufacturer's info, sensor info, software info,
calibration facility info, raw and calibrated output
format info, VOSHPS calibration constants,
display entire info area, and exit with or without
update.
- the '0' choice for 'Exit without update' leaves the module
RAM and EEPROM in its original state. The VOSHPS cal constants
are handled separately, as these constants reside in VOSHPS
EEPROM on the sensor front-end board.
- the '4' choice for 'Software Information' now includes 2 parameters
related to operation. The 'ONTIME' value may be set from 1 to 30
seconds of front-end board ON time. This allows for precipitation
gauge output stabilization before a reading is taken. The 'TFLAG'
parameter determines the order of cal/raw data output in the 'T'
command. A 1 sets for cal/raw order (normal ASIMET 'B' command
output format), a 0 sets for raw/cal order (as in older Precip
software versions).
- the '8' choice for 'Enter VOSHPS cal constants' passes commands
through the PRC C51 logger board to the VOSHPS sensor front-end
board vis RS-485. There are some startup delays while the VOSHPS
is powered up, as well as some half-duplex comms delays. After
selecting '8' from the menu, it will take several seconds to get
the 'OK' prompt from the VOSHPS (if it fails to respond, try again
after the menu re-displays). At the OK prompt, you may read existing
or write new cal constants only. Unrecognized commands will result in
a 'Bad command' response. If you get stuck, enter 'Q' to quit VOSHPS
update without making any changes. For complete details on the
VOSHPS EEPROM Update command, see the document
"VOSHPS Front-End Module Command Set".
- all responses to prompts must be terminated with <cr> (Enter)
The final response from the module upon exit is <crlfetx>
- NOTE 1: Upon completion, the newly updated module address
will not take effect until the next reset or power-up.
- XMODE XMODEM Dump CompactFLASH card via console
- XMODE command only works in RS232 mode and only if CompactFLASH card is installed
- CompactFLASH cards will take a LONG TIME to read this way -
the preferred method of reading a large .DAT data file is to remove the CFLASH card
from the module and read it on a PC. Two files will be recognized
by the PC, a .INF INFO file which can contain up to 600 characters of
user information, and a .DAT DATA file which contains the logger data records.
See the FOK command above.
- This command is somewhat rudimentary; if you must dump data this way,
use the L command to display the current directory and file sizes on the CFLASH
card. You can then estimate where to start dumping data, based on one 512 byte record
per hour, and a CFLASH sector size of 512 bytes. Or use the FOK command to look at
the HEX values of particular sectors to decide where to start the dump.
- Command dumps data from the requested starting sector for up to 2048 512-byte sectors
(i.e. a maximum of 1 MB of data). Sector 322 is the first sector of the data file on
the CFLASH card.
- On command entry, requests: Start sector # (322 is first, 0 aborts) ->
followed by: Number of sectors (1 to 2048, default is 512) ->
- i.e. to get first week of data (168 records -> 1 week), enter 322 as
the start sector, and 84 for the number of sectors.
- add 84 to your start sector number to find the start of subsequent week-long portions of data;
i.e. if you entered 322 to start at the first sector on the FLASH card, subsequent weeks
of data start at sector 406, 490, etc...
- Typical example - the following description assumes PCPLUS for terminal software,
but any terminal program capable of XMODEM transfer should work.
- On entry, module will first prompt for start sector:
Start sector # (322 is first, 0 aborts) ->
Enter a valid sector # (see discussion above)
- followed by a prompt for number of sectors:
Number of sectors (1 to 2048, default is 512) ->
Enter a valid sector count (see discussion above)
- Next, you'll be prompted:
Set terminal speed for 38400 then hit any key
- After setting speed and hitting a key, you will see:
XMODEM Send Function
Waiting for start...
- Start a transfer (PgDn in PCPLUS) - on completion, you will see something like:
Sent 160 blocks - done
Restore terminal speed to 9600 then hit any key
NOTE:"blocks" here are XMODEM blocks of 128 bytes each
- After resetting speed to 9600 baud and hitting a key, module will send a
"\r\n"
- Ignore occasional gibberish when changing baud rates!
- Note: Only the .DAT data file portion of the CompactFLASH card is dumped via
XMODEM; See CompactFLASH PRC Record Format.
Revision history:
- Original Release - V4.0 (first instruments with Compact FLASH card capability)
adapted from vhrh3cmd.html