file: vspn4cf_cmd.html
24 Aug 2007
ASIMET SPN1 SHORTWAVE RADIATION 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.
This module uses the Delta-T Devices SPN1 Sunshine Pyranometer as its sensor front-end. It interfaces directly
to the VOSC530 CPU board via RS232. Calibrated total radiation and diffuse radiation values are received directly from the
SPN1.
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 (VOSC530) 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.
Ops Note 1: When the module is setup for RS232 comms, total and diffuse radiation values
(the same values stored in CFLASH each minute, and in the same format as the 'C' command output) can be sent to the console each
minute. See the UOK command for enable/disable info.
Ops Note 2: 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:
#SPN01A SPN01<crlfetx>
- NOTE: SPN01 is the default address of the SPN1 SWR module; it
may be changed by the 'U' command but any failure of
EEPROM will result in the use of the default address. Use of
defaults is also reported in the 'L' command.
- B Output both calibrated values
- outputs calibrated total and diffuse values, as follows:
SWR Total, SWR Diffuse<crlfetx>
- example:
#SPN01B 254.4, 158.3<crlfetx>
- Values of shortwave radiation are in watts per meter square (W/M2).
- C language format: "%7.1f, %7.1f\r\n\x03"
- C Output calibrated data: SWR Total & SWR Diffuse
- outputs calibrated values, in W/M2, as follows:
SWR Total, SWR Diffuse<crlfetx>
- example:
#SPN01C 735.2, 238.6<crlfetx>
- C language format: "%7.1f, %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:
- #SPN01D2007/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
First data sector is sector 322
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 VOSSPN53
Directory of CF:
2007/07/24 19:10 35 VSPN001.INF
2007/07/25 16:42 523904 VSPN001.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. The first DATA sector is 322.
- 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
CompactFLASH SPN1 SWR 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
- #SPN01H - 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 VOSSPN53 V4.04cf
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
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.
- P Enter polled test mode
- responds with individual scans of data in the 'C' command
response format, except <crlf> terminator only. Upon
receipt of any character except ESC, another scan of SWR
data is sent. For example:
#SPN01P
26.3, 22.3<crlfetx>
send <cr> (or other character)
254.4, 158.4<crlf>
send <cr> (or other character)
155.7, 96.1<crlf>
.
.
- the command terminates on receipt of an ASCII ESC (1Bh)
character. The last scan sent is terminated by <crlfetx>.
- R Output raw values
- Not applicable currently - see 'B' command
- T Enter test mode
- responds with continuous scans of data in the 'C' command
response format, except <crlf> terminator only. For
example:
#SPN01T
26.3, 22.3<crlf>
254.4, 158.4<crlf>
155.7, 96.0<crlf>
67.4, 24.1<crlf>
151.2, 96.0<crlf>
.
.
- the command terminates on receipt of an ASCII ESC (1Bh)
character. The last scan sent is terminated by <crlfetx>.
- 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. #SPN01UOK. 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, 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.
- choice '8' - Enable/Disable 1 minute DATA transmission in RS232 mode allows
transmission to the console of the 1 minute data sent to CFLASH. That is, if
enabled, you will see the total and diffuse radiation values once per minute (same output
as a 'C' command). Remember, this ONLY applies when the module is in RS232 mode.
- 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 168 for the number of sectors.
- add 168 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 490, 658, 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 SPN1 SWR Record Format.
Revision history:
- Original Release - V4.0 (first instruments with Compact FLASH card capability)
adapted from vswr4cmd.html