Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 13 of 23

DuraTrax/LaserLite, LaserLite Pro/LaserLite Mx Developer's Reference, pages 121 to 130

Pages 121 to 130 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 121

I - Send the status report to the memory card processor to update The status string retrieved by the C S command may be sent to the memory card processor with the C I command. The LaserLite Mx operating system and BASIC language automatically update the state of the memory card in its sleep/wake routines. Normally, you will not be concerned with updating status, except when developing complex operations using multiple files. Example: Restore the status after waking from sleep: P c I &4F001503006A04 Returns: 00

Previous status restored.

Successful return values: File management report (for C F); status report (for C S); 00 (for C I). Possible error codes that can be returned from this command: 01, 03, 04, 10, 31, 51, 52, 63 (See pages 128–129 for a description of the error codes.)

Chapter 5 LaserLite Mx Memory Card Data Management

113

Page 122

D [modulus] {file type} {filename} or

D {file handle} or

D {file handle} {file type} {new filename} Deletes or renames a file on the memory card. To delete a file, list the file type (indexed (I or H), sequential (S), identification (D), or boot (B)) and filename of the file to delete. The filename can have up to 18 bytes, or you can use the file handle number (if known from a previous O command). To rename a file, you must refer to the file by the file handle number and file type, and pass it the new filename. Example 1: Delete an indexed file with filename data.txt: P d I "data.txt" Returns: 00

File deleted successfully.

Example 2: Rename an indexed file with filename data.txt and file handle 03 to olddata.txt: P d 03 I "olddata.txt" Returns: 00

File renamed successfully.

Successful return values: 00 Possible error codes that can be returned from this command: 01, 03, 04, 09, 10, 31, 33, 40, 63, 65 (See pages 128–129 for a description of the error codes.)

114

Chapter 5 LaserLite Mx Memory Card Data Management

Page 123

F [hash value] [key field] or

F Searches for a record with the given key field in the memory card’s open file and sends it to the host. This command only functions with file types I and H. When a key field is not provided, and the last command was an H or an F command with a key field, it tries to read the next record with the same key field as was used in the last H command. For example, to read multiple records with the same key field, the following commands can be used: Assuming there are three records with the key field "ABCDEFG" in an indexed file, then: P f "ABCDEFG": reads the first record; P f: reads the second record; P h: deletes the third record. To read all of the records in an indexed file with the same hash value, the following commands can be used: P f [key field]: first record in the chain; P f: second record in the chain. Example: Find a record in the open indexed file test1: P f "abc" Returns: "abc" <field2> <field3> Record found.

No records match the find request.

35

Successful return values: A record. Possible error codes that can be returned from this command: 01, 03, 04, 06, 08, 10, 32, 35, 53, 63 (See pages 128–129 for a description of the error codes.) Chapter 5 LaserLite Mx Memory Card Data Management

115

Page 124

H [hash value] [key field] or

H Deletes a record with the given key field from the memory card’s open file. This command only functions with file types I and H. For an indexed file, the program goes through the hash table, finds the record, and sets the record status bit to 0. It does not change the pointer or erase the record. When a key field is not provided, and the last command is an F or an H command with a key field, it tries to delete the next record with the same key field as in the last H command. Example: Delete a record from the open indexed file test1: P h "abc" Returns: 0

Record deleted.

Successful return values: 00 Possible error codes that can be returned from this command: 01, 03, 04, 06, 08, 10, 32, 35, 39, 40, 53, 63, 65 (See pages 128– 129 for a description of the error codes.)

116

Chapter 5 LaserLite Mx Memory Card Data Management

Page 125

K &1092 Removes deleted files from the memory card. This command copies the file management report from the control blocks to other blocks, changes content, erases the control blocks, and copies the information back to the control blocks. Do not interrupt the processor (power down or reset) during the operation or you could lose file management information. This command should only be used after important data has been transferred from the memory card to the computer. Example: Clean up the card: P k &1092 Returns: 00

Deleted files removed from the memory card.

Successful return values: 00 Possible error codes that can be returned from this command: 01, 03, 04, 10, 40, 61, 62, 63, 65, 67, 68 (See pages 128–129 for a description of the error codes.)

Chapter 5 LaserLite Mx Memory Card Data Management

117

Page 126

M {number of records/bytes} {F/R} or

M or

M H {file handle} Moves the pointer within the memory card’s open file. For indexed (I or H) files, this command moves the pointer forward (F) or backward (R) a certain number of records within the open file, and sends out the current record that the pointer is pointing to. When number of records = FFFF, the pointer is moved to the end-of-file (F) or the beginning-of-file (R). For sequential (S) and identification (D) files, the number is in bytes, and the program sends out 256 bytes. When the number of bytes = 0 (or is omitted), the program sends out the current record or 256 bytes, but does not move the pointer. When a file is opened, the move pointer is set at the end-of-file. An F or an H command sets the move pointer to that record. Example 1: Move forward 128K records from current position in open indexed file test1: P m &020000 F Returns: "abcdefg" <field 2> <field 3> <…> Record found; data reported. 36

118

End-of-file encountered.

Chapter 5 LaserLite Mx Memory Card Data Management

Page 127

Example 2: Move to beginning of the open indexed file test1: P m &FFFF R Returns: "abcdefg data"

Record found, data reported.

23

There is no data in the file.

Example 3: Delete the record at the move pointer: P m h Returns: Record deleted.

00 Successful return values:

A record or 256 bytes of binary data. Possible error codes that can be returned from this command: 01, 03, 04, 10, 23, 36, 37, 39, 40, 53, 63, 65 (See pages 128–129 for a description of the error codes.)

Chapter 5 LaserLite Mx Memory Card Data Management

119

Page 128

The Move Pointer The M card command moves a pointer within an open data file. The following table indicates the location of the move pointer under different circumstances. Condition

Location for file types I/H (indexed files)

Location for file types B/D/S (sequential files)

Open file

Last record.

Last 256 bytes.

Append record

Last record.

Last 256 bytes.

Scrolling

Current record.

Current 256 bytes.

Closed file

Invalid.

Invalid.

Open file with no data

“No data condition” (error 23).

“No data condition” (error 23).

Delete record with the H command or M H command

At the deleted record. Must issue another M command before issuing an M H command. The M command then moves to the next record in the data file. If there is not a valid next record, then the move pointer moves to the previous record.

Not applicable.

F command

At the found record, or if not found, at the bottom of the data file.

Not applicable.

S command

At the found record, or if not found, at the bottom of the data file.

Not applicable.

120

Chapter 5 LaserLite Mx Memory Card Data Management

Page 129

N [param1] Formats the memory card. N, by itself, closes any open files and restarts the memory card program. It also locks some of the physical functions, so the IRAM, XRAM, and memory card contents cannot be changed accidentally by using low-level routines. Issuing the N command without a parameter, returns the ID of the memory card. The parameter &0129 unlocks low-level physical functions permitting writing directly to the card module’s XRAM memory and formatting the memory card. The parameter &1092 erases the entire card and formats the card, if it is not formatted. Example 1: Format memory card: P n &1092 Returns: Memory card formatted.

0

Example 2: Determine memory card ID: P n Returns: "092612456"

The card ID name, card module formatted.

Successful return values: ID of the memory card. Possible error codes that can be returned from this command: 01, 03, 04, 07, 10, 22, 63, 65 (See pages 128–129 for a description of the error codes.)

Chapter 5 LaserLite Mx Memory Card Data Management

121

Page 130

O [modulus] {file type} {filename} or

O {file handle} Opens an existing or a new file on the memory card. To open an existing file, only the file type (indexed (I/H), sequential (S), identification (D), or boot (B)) and the filename is needed, or you can use the file handle number (if known from a previous O command). The modulus (number of hash table entries) can be zero. The modulus can be omitted for sequential, identification, or boot files; for indexed or hashed files the modulus can be from 1–65535. (Note: See pages 141–142 for information on the modulus.) The filename can have up to 18 bytes. When a file is opened, any following operations are directed to the open file; any previously opened files are closed. When the module is powered up, the firmware boots the memory card and starts to run the DMS program from the XRAM. If successful, the O command returns the file handle number of the opened file. One memory card ID file can be opened per card. The filename is used as the card ID, and any contents can be written to the file as a sequential file. The ID can be found by writing an ID file to the memory card with any name. It can also be found by issuing an N command (see page 121) without a parameter.

122

Chapter 5 LaserLite Mx Memory Card Data Management