The text of a manual · part 7 of 23
DuraTrax/LaserLite, LaserLite Pro/LaserLite Mx Developer's Reference, pages 61 to 70
Pages 61 to 70 of 229
The original document is the PDF (797 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Videx DuraTrax, Videx LaserLite, Videx LaserLite Mx and Videx LaserLite Pro
Page 61
Special Notes on LaserLite Pro Monitor 1.11 Loading from Flash Memory At startup, the monitor program in the LaserLite Pro and the LaserLite Mx reads signature bytes to determine whether to copy the contents of flash memory to RAM. The signature bytes are located as follows: In RAM: In Flash:
7FF9 and 7FFA FFF9 and FFFA
Bank 0 Bank 0
Signature byte values: Location
Value
FFF9–FFFA 5A–A5 (flash) 7FF9–7FFA 5A–A5 (RAM)
7FF9–7FFA 3C–C3
7FF9–7FFA any other values
Monitor program actions at startup Valid image file is stored in flash.
What writes this value and when is it written? Monitor program after validating the image file is loaded in the flash. Monitor program when it Valid image file is stored in RAM. Do not copies the image file from flash. load image file from flash. Automatically start the operating system at 7FFB after monitor program startup. The operating system when Valid image file is stored in RAM. Do not it quits execution and returns to the monitor program. load image file from flash. Do not automatically start the operating system after monitor program startup. No valid image file is All other values indicate that stored in RAM. Check RAM contents are lost or corrupted. This could occur flash. If valid image if batteries were removed file is stored in flash, copy contents of flash from the system for several to RAM and execute at weeks and the backup battery drains. 7FFB.
Chapter 2 Monitor Program
53
Page 62
Startup Model for VX1 Monitor 1.33 and 1.34 Each time the LaserLite Pro and LaserLite Mx awaken from sleep or when they are reset, the system starts with the monitor program. At that time, the monitor program evaluates seven conditions. Based on their values, it selects an appropriate path of execution. These are the seven conditions it evaluates and the bit values it sets: 1. Reads the bytes at 7FF9 and 7FFA. If these bytes evaluate to 3C C3 then the monitor program starts and does not read any of the other values. 3C C3 at 7FF9? Yes = 0000001 No = 0000000
Bit 0
2. Reads internal memory to match against a known valid pair of bytes (5A A5 for LaserLite Pro, 3C C3 for LaserLite Mx). If it matches, this indicates that the data collector went through a normal shutdown and saved the state of the processor. Otherwise it indicates an abnormal shutdown such as a power loss during operations. Valid Internal Signature Yes = 0000010 No = 0000000
Bit 1
3. Reads external memory to match against a known valid pair of bytes (5A A5). If it matches, this indicates that the data collector has a valid operating system loaded into memory. Otherwise, it indicates no operating system is loaded. This could occur if both the main batteries and the backup batteries were allowed to completely drain. Valid External Signature Yes = 0000100 No = 0000000
54
Chapter 2 Monitor Program
Bit 2
Page 63
4. Checks to see if there is a memory card module, if a memory card is present, if it has a recognizable format, and if the memory card has a system boot file. The monitor sets flags regarding these “memory card” checks that may be read by the LaserLite Mx operating system at startup. Card_is_bootable Yes = 0001000 No = 0000000
Bit 3
5. Reads flash memory to match against a known valid pair of bytes (5A A5). If it matches, this indicates that the data collector has a valid operating system and application loaded into flash. Application in Flash Yes = 0010000 No = 0000000
Bit 4
6. Reads the state of the scan button. Scan button down Yes = 0100000 No = 0000000
Bit 5
7. If there is a memory card, it reads the ID of the memory card and compares it against a value stored in external memory at 7F D1. The monitor uses this address to store the most recent ID of the memory card from which the LaserLite Mx booted. Card ID <> value at 7DF1 Yes = 1000000 No = 0000000
Bit 6
Chapter 2 Monitor Program
55
Page 64
The following table uses a bitmap model to indicate the path of execution it will select. IF Bit 0 = 1 IF Bit 6 = 1 and Bit 3 = 1
Go to Monitor Mode Boot from SSFDC
IF 0000010
Go to Monitor Mode
IF 0000100
Set power_fail flag then start OS
IF 0000110
Start OS
IF 0001000
Boot from SSFDC
IF 0001010
Boot from SSFDC
IF 0001100
Set power_fail flag then start OS
IF 0001110
Start OS
IF 0010000
Boot from Flash
IF 0010010
Boot from Flash
IF 0010100
Set power_fail flag then start OS
IF 0010110
Start OS
IF 0011000
Boot from SSFDC
IF 0011010
Boot from SSFDC
IF 0011100
Set power_fail flag then start OS
IF 0011110
Start OS
IF 0100000
Go to Monitor Mode
IF 0100010
Go to Monitor Mode
IF 0100100
Set power_fail flag then start OS
IF 0100110
Start OS
IF 0101000
Boot from SSFDC
IF 0101010
Boot from SSFDC
IF 0101100
Set power_fail flag then start OS
IF 0101110
Start OS
IF 0110000
Go to Monitor Mode
IF 0110010
Go to Monitor Mode
56
Chapter 2 Monitor Program
Page 65
IF 0110100
Set power_fail flag then start OS
IF 0110110
Start OS
IF 0111000
Boot from SSFDC
IF 0111010
Boot from SSFDC
IF 0111100
Set power_fail flag then start OS
IF 0111110
Start OS
IF 1000000
Go to Monitor Mode
IF 1000010
Go to Monitor Mode
IF 1000100
Set power_fail flag then start OS
IF 1000110
Start OS
IF 1010000
Boot from Flash
IF 1010010
Boot from Flash
IF 1010100
Set power_fail flag then start OS
IF 1010110
Start OS
IF 1100000
Go to Monitor Mode
IF 1100010
Go to Monitor Mode
IF 1100100
Set power_fail flag then start OS
IF 1100110
Start OS
IF 1110000
Go to Monitor Mode
IF 1110010
Go to Monitor Mode
IF 1110100
Set power_fail flag then start OS
IF 1110110
Start OS
Chapter 2 Monitor Program
57
Page 66
Notes:
58
Chapter 2 Monitor Program
Page 67
Chapter 3 Operating System Software This chapter contains information on: •= The operating system software. •= The operating system software commands. •= The Default.s application. •= LaserLite Mx memory card operating system commands.
Chapter 3 Operating System Software
59
Page 68
Operating System Software Overview The operating system software (OS) must be installed on the data collector before it can gather and store data. The filename of the operating system software will always end with a .OS extension. The exact filename of the OS will change as new versions are released; however, the OS for the DuraTrax will always begin with Trax, the OS for the LaserLite will always begin with Lite, the OS for the LaserLite Mx will always begin with Lmx, and the OS for the LaserLite Pro will always begin a Pro. (Note: Double-check the actual name of your operating system files.) The OS consists mostly of a virtual machine that executes an application. An application is a special binary machine language compiled from BASIC code that includes instructions to gather events, manipulate integers and strings, manage files, talk to the data collector, and so on. The virtual machine provides all of the functionality available to developers of DuraTrax, LaserLite, LaserLite Pro, and LaserLite Mx software. In addition to the virtual machine, the OS file also presents a command line interface (using the serial port for stdin and stdout), with commands to send and receive files, get the battery level, get and set the clock, change the data collector’s ID, and so on. When the END instruction is executed by the virtual machine, the OS returns to the command line. When the G or L commands are issued to the command line, the OS executes the virtual machine. (The G command is automatically executed by the OS if no characters are received for 60 seconds, or if an Unlock command is received with the wrong ID.) The virtual machine executes the current application. There can be only one application at a time installed with the OS.
60
Chapter 3 Operating System Software
Page 69
Operating System Command Line After the BASIC program ends, the operating system returns to a command line, analogous to the DOS command line. It uses the serial port for standard input and output, so you can communicate with the data collector using a Videx Base Station and standard communications software. When the operating system first returns to the command line, it displays the version of the operating system software on one line, and the data collector’s ID on the next line. It then prompts the user with the standard “>” prompt. If you are using a terminal program, you can type a command at the prompt terminated with a carriage return character. The operating system software will respond to the command, and then display a prompt again. If the command was completed successfully, it displays a “>” prompt. If the command couldn’t be completed for some reason, it displays a “!” prompt. Standard command syntax is: <command> [argument] <cr> All operating systems will ignore the linefeed character after a carriage return, except with the I command. Any command that causes the size of the data file to be reset to 0 must be sent three times in quick succession; this includes the Default Application, Receive, Clear Data, and the Load from Flash commands. After the first and second command, a “+” prompt is displayed, to indicate that it is waiting for more. After the third command, the normal “>” prompt is displayed if the command is successful. If the second or third commands aren’t sent quickly enough, then the error prompt “!” is displayed. (The second and third commands must be received within two to three seconds after the first command.) The command line has a 60-second timeout. If no characters are received for 60 seconds, it automatically executes the G command.
Chapter 3 Operating System Software
61
Page 70
Operating System Commands All commands consist of a single command letter. The command letter is not case sensitive. For some commands, an argument follows the command letter. Any spaces between the command and the first letter of the argument are ignored. (None are required.) The argument extends from the first non-space character to the carriage return that ends the line. Only the first 31 characters of the argument are significant; the rest are discarded. Battery
The Battery command is a B with no arguments. It responds with the current battery voltage (for example, “5.65”). Set ID
The Set ID command is a C with one optional argument. If the argument is supplied, the unit’s ID is changed to the first ten characters of the argument. With or without the argument, it responds with the unit’s ID. Default Application*
The Default Application command is a D with no arguments. Since this command clears data it must be sent three times. In operating systems prior to OS122, this sets the current application to be the default application built into the operating system software. Any data is destroyed, and any application that was previously installed is also destroyed. A listing of the default application is contained in the disk accompanying this software package. The filename of the default application for DuraTrax, LaserLite, and LaserLite Pro is Default.s. The filename of the default application for LaserLite Mx is MX-DEMO.s. See pages 66–73 for more information on the default application. *For operating systems 122 and later, this command behaves identically to the Z (clear data) command.
62
Chapter 3 Operating System Software