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 4 of 23

DuraTrax/LaserLite, LaserLite Pro/LaserLite Mx Developer's Reference, pages 31 to 40

Pages 31 to 40 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 31

Pseudo-code for creating an image file, checking its size, and then loading it into the data collector follows: x = vxcomm_vb(pNull, "", sys, app, crfs, port, 112) 'create image file If (x) Then MsgBox ("Error creating image") Else y = check_file_size("flash.img", 131072) 'check if size>128K If (y) Then MsgBox ("Image too big") Else z = vxcomm_vb(pNull, cmd, sys, app, crfs, port, config) 'load software If (z) Then MsgBox ("Communications error") End If End If End If

Chapter 1 Communications Programs

23

Page 32

Videx Download for Macintosh The communications program for Macintosh computers is Videx Download. Videx Download can be used with a DuraTrax, LaserLite, or LaserLite Pro. (Note: The LaserLite Mx operating system and applications are not Macintosh compatible.) Videx Download executes a series of commands from a commands file. There are four types of documents that can be sent to Videx Download; they are: commands file (text file), operating system software (OS), application files, and cross-reference files. To use Videx Download, drag and drop one or more files onto it. If you are using it as a server, send it an Open Document event, with the list of the files you want transferred. Only one commands file is recognized per Open Document event. If Videx Download fails to execute any of the commands, it quits immediately and returns an error code in the Open Document event. Videx Download Interface (Macintosh only) If Videx Download is run without any documents (it’s sent an Open Application event), then it runs like a normal application. It has a Settings menu, which lists the available serial ports. Following are activities that can be performed by Videx Download: To change the serial port...

run Videx Download, choose Settings, and select a different serial port.

To transfer the data file...

double-click the Download Data icon.

To install new operating system software...

drag the operating system file and an application file to the Videx Download icon. (If unique IDs are required for each data collector, a commands file that changes the ID can also be dragged to the icon at the same time.)

Important Note: You must drag an application (either Default.s or an Application Builder application) along with the operating system to the Videx Download icon. 24

Chapter 1 Communications Programs

Page 33

Communications Program Commands File A commands file is an ASCII text file that lists the actions that the communications program should perform. The communications program attempts to execute the commands sequentially from the top to the bottom of the file. If it encounters an error, the program automatically stops executing and notifies the user of the error. To be recognized by the communications program, the commands file must have a .TXT extension, a .VDX extension, or no extension. You can create a commands file with a text editor or generate it from a custom application program. If the communications program encounters more than one commands file, it only opens and attempts to execute from the last one. A commands file typically includes commands to send a compiled application (*.S file), associated *.CRF or text cross-reference files, receive the data file, set the clock to the computer’s time, resend the operating system software (*.OS file), change the ID, and so on. In addition, commands files support a form of looping that allows transferring data from multiple data collectors. The looping commands are discussed later in this chapter. The communications programs have a built-in, default list of commands that they reference in the absence of an external commands file. Following is a description of the commands contained in the default commands file: Default Commands File I 0000000000

M1 Downloading Data S Z M1 Loading Software R T L

Description of Command Line Unlocks the data collector. This is the Unlock command that signals an exit event to the application and puts the data collector into communications mode. Puts message on line 1 of the data collector’s display. Instructs data collector to send data file. Instructs data collector to clear data file. Puts another message on line 1 of the display. Instructs the data collector to prepare to receive a file or files. Sets the clock in the data collector to match the clock in the computer. Locks the data collector and puts it into sleep mode for minimum power consumption. Chapter 1 Communications Programs

25

Page 34

Commands Any of the following commands can be listed in the commands file in any order; however, it is important to create the list of commands in an order that matches an expected flow of operation for the data collector. For example, the data collector must be unlocked before it can accept any of the other commands in the list, so each commands file list typically begins with an I (Unlock) command. Also, important data should be transferred from the unit prior to loading new operating system, application, or cross-reference files. If any command generates an error, the communications program stops executing and returns the error. The exception to this is errors encountered in the looping commands described on pages 28–42. Vxcom or Download versions 2.0 or later are required to support commands for the LaserLite Mx. Refer to pages 130–140 to work with the LaserLite Mx. Note: A space is required between the command and the argument. '

An apostrophe (') indicates a comment. The communications program ignores any line in the commands file that begins with an apostrophe.

C id Set or change the data collector’s ID to the given ID. If an ID is not given, the command fails. D <file type> <filename> (LaserLite Mx only) Delete a file from LaserLite Mx memory card. F [<output filename>] (LaserLite Mx only) List the LaserLite Mx memory card file management report. G

Run the current application using the operating system GO command.

I id

Send an Unlock command to the data collector using the given ID. This command is sent every 5 seconds for 35 seconds.

K

(LaserLite Mx only) Remove any deleted files from the LaserLite Mx memory card.

26

Chapter 1 Communications Programs

Page 35

L

Send a Lock command and put the data collector to sleep. When awoken with a keypress, immediately run current application.

M1 message Set display line 1 to the given message. M2 message Set display line 2 to the given message. R [<number of bins>] <file type> <filename> Prepare the data collector to receive a file. Using the R command without the [<number of bins>] <file type> parameters, tells the data collector to receive the listed operating system software, application, or flash image file, depending on the files that are included in the communications program. If an operating system, application, or flash image is not being transferred, this command doesn’t do anything (but doesn’t fail). Using the R command with the [<number of bins>]<file type> <filename> parameters sends the listed file to the LaserLite Mx memory card. The [<number of bins>] parameter must be passed if the file does not already exist on the memory card. The <file type> and <filename> parameters are case sensitive. S [<folder path>] <file type> <filename> Sends a file to the computer. Using the S command without the <file type> parameters tells the data collector to send its data file. The file is put in the given [<folder path>]. If no [<folder path>] is given, Vxcom and Download write the file to the current directory. Videx Download for Macintosh writes the file to the desktop. The file is named by the BASIC application in the OPEN statement. For example: OPEN "data.txt" FOR APPEND AS #0

If a file with that filename already exists in the communications folder, then the new data is appended to that file. If an error occurs during transmission of the data, then the destination file is truncated to its original size. Using the <file type> parameter sends the listed file from the LaserLite Mx memory card to the computer. The <file type> and <filename> parameters are case sensitive. Chapter 1 Communications Programs

27

Page 36

T

Set the time on the data collector to the computer’s time (synchronizes the clocks).

Z

Clear (zap) the data in the data collector.

Note: The commands in this list approximate the operating system commands described in Chapter 3. Looping Commands

You can also use the following looping commands in the commands file. FOREACH...END, FORALL...END, FOREVER...END Looping commands are provided for transferring data from multiple units, managing retries, and setting up a continuous loop operation. The purpose of a “loop” in a commands file is to enable a command or set of commands to be repeated until a certain criterion is met. The criterion is determined by the FOREACH, FORALL, or FOREVER statement. The communications program executes each command within the loop, beginning with the FOREACH, FORALL, or FOREVER statement and ending with the END statement. Loops may be nested within loops up to four levels deep. Example: FOREVER commands FOREACH commands END END If an operation fails within a loop, execution continues immediately at the end of the loop and a status message is written to the STATUS.TXT file if the -s1 or -s2 parameter was used in the communications program’s command line. Note: No status message is written for an Unlock command timeout error. Pressing the <Escape> key will terminate the communications program. 28

Chapter 1 Communications Programs

Page 37

When using looping commands to transfer the data from data collectors in a multiple Base Station set up, you must give each data collector a unique ID; this allows the computer to access each data collector and verify that it has transferred the data from each one. Refer to your data collector’s hardware manual for instructions on connecting multiple Base Stations to one computer. Assigning IDs Changing a Data Collector’s ID with a Windows Computer

In Windows you can change a data collector’s ID by first creating a commands text file, then clicking and dragging the file onto the Vxcom icon. Vxcom uses the commands file to unlock the data collector and change its ID. During normal operation, a unit is given an ID of ten zeros. To change the ID, create a text file consisting of the following three command lines: 1) an I command, followed by a space, followed by ten zeros to unlock the unit; 2) a C command, followed by a space, followed by the new ID for the unit; 3) and an L command to relock the unit. I 0000000000

Sends an Unlock command to the data collector. (Note: Ten zeros will unlock any data collector.)

C new ID#

Changes the unit’s ID to the new ID. The ID can be any alphanumeric combination of up to ten characters in length.

L

Sends a Lock command and puts the data collector to sleep. When the unit is awakened with a keypress, it immediately runs the current application.

Chapter 1 Communications Programs

29

Page 38

For example, to change a unit’s ID to 12345: 1.

Use a word processing program to create a text file containing the following three lines: I 0000000000 C 12345 L

2.

Save the file as a text file with a .txt, .vdx, or no extension and quit the program.

3.

Place a data collector into the Base Station slot. IMPORTANT: When sending a file to a data collector, it must be the ONLY data collector attached to the computer.

4.

Click and drag the text file you created onto the Vxcom icon.

5.

Vxcom executes the commands listed in the text file: it unlocks the unit, changes the ID to what is listed after the C command (in this case, 12345), and then relocks the unit.

6.

Remove the data collector from the Base Station slot; it is ready to use.

30

Chapter 1 Communications Programs

Page 39

To continue changing other data collector’s IDs: 1.

Reopen the text file.

2.

Change the ID listed after the C command by selecting 12345 and typing in a new ID. (Note: There must be a space character between the C and the ID.)

3.

Save and close the file.

4.

Insert a data collector into the Base Station slot.

5.

Click and drag the edited text file to the Vxcom icon.

6.

Vxcom executes the commands listed in the text file: it unlocks the unit, changes its ID to what is listed after the C command, and then relocks the unit.

7.

Continue these same steps until a unique ID is assigned to each unit.

Note: Keep a list of the IDs; you will need this list in the section “Transferring Data from Multiple Data Collectors.”

Chapter 1 Communications Programs

31

Page 40

Changing a Data Collector’s ID with a DOS Computer

To assign a unique ID when using a DOS computer, create a commands file, and then enter the name of the commands file on the Download.exe command line. Download.exe then uses the commands file to unlock the data collector and change the ID. During normal operation, a data collector is given an ID of ten zeros. To change the ID, you must create a commands file consisting of the following three command lines: 1) an I command, followed by a space, followed by ten zeros to unlock the unit; 2) a C command, followed by a space, followed by the new ID for the unit; 3) and an L command to relock the unit. I 0000000000

Sends an unlock command to the data collector. (Note: Ten zeros will unlock any data collector.)

C new ID#

Changes the unit’s ID to the given ID. The ID can be any alphanumeric combination of up to ten characters in length.

L

Sends a LOCK command and puts the data collector to sleep. When the unit is awakened with a keypress, it immediately runs the current application.

32

Chapter 1 Communications Programs