The text of a manual · part 9 of 10
LaserLite Pro and LaserLite Mx Hardware Manual, pages 81 to 90
Pages 81 to 90 of 99
The original document is the PDF (2.9 MB). 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 LaserLite Mx and Videx LaserLite Pro
Page 81
FOREVER Looping Command The following example shows how the FOREVER loop is used in a commands text file to continually look for data collectors to transfer. Example FOREVER Commands File: FOREVER 'Begin the loop. I 0000000000 'Unlock any unit. M1 Transferring Data 'Put message on display. S 'Transfer data from unit. Z 'Clear data from unit. T 'Set time by computer’s time. G 'Restart the application. END 'End loop, begin re-executing at top.
Note on the Unlock command (I id): No additional characters should be included on the same line as the Unlock command. Any characters after the unit ID (for example, space characters or comments) will cause this command to fail. In the above example, the comment associated with the Unlock command is on a separate line.
Appendix E Using Multiple Data Collectors and Base Stations
75
Page 82
FOREACH Looping Command The following example shows how the FOREACH loop is used in a commands text file to attempt to transfer the data from each data collector in the list once. Example FOREACH Commands File: You can either list the IDs individually as in the first line of Example 1, or you can make a text file of the IDs and use the filename in quotes as on the first line of Example 2. Example 1 Commands Text File for Transferring Data from Multiple Data Collectors (IDs listed on command line): FOREACH ID1, ID2, ID3
'Begin the loop. All IDs 'listed on line.
I loop_id 'Unlock the unit using the special identifier. This 'identifier substitutes for all the units listed on 'the first line. M1 Transferring Data 'Put message on display. S 'Transfer data from unit. Z 'Clear data from unit. T 'Set time by computer’s time. L 'Lock unit and put to sleep. END 'End loop, begin re-executing at top.
Note on the loop_id argument: When the argument of the Unlock command is a specific ID (as in the previous FOREVER example), the program attempts to unlock the unit 8 times at 5-second intervals. This ensures that a unit is unlocked regardless of its sleep cycle (a unit sleeps for 25 seconds, then wakes for 5 seconds). If the program does not unlock a unit, the program returns an error and aborts. On the other hand, when the argument of the Unlock command is loop_id (as in the FOREACH example), the program only makes one attempt to unlock the unit. If it is successful, it performs the remaining commands in the loop; if not successful, it moves on to the next value for loop_id without aborting the program. Given the unit’s sleep cycle, it is unlikely that one attempt will successfully unlock a unit. Therefore, it would generally not be reasonable to use a FOREACH loop by itself as in the above
76
Appendix E Using Multiple Data Collectors and Base Stations
Page 83
example. For examples showing appropriate use of a FOREACH loop, refer to the discussions of Scenarios 3 and 4 on pages 80–81. Example 2 Commands Text File for Transferring Data from Multiple Data Collectors (IDs listed in IDs.txt file): FOREACH "IDs.txt"
'Begins the loop. All IDs 'listed in the IDs.txt file.
I loop_id 'Unlock the unit using the special identifier. This 'identifier substitutes for all the units listed on 'the first line. M1 Transferring Data 'Put message on display. S 'Transfer data from unit. Z 'Clear data from unit. T 'Set time by computer’s time. L 'Lock unit and put to sleep. END 'End loop, begin re-executing 'at top.
The IDs.txt file must contain a list of the IDs. The IDs in the text file must be separated by commas or spaces.
Appendix E Using Multiple Data Collectors and Base Stations
77
Page 84
FORALL Looping Command The following two examples show how the FORALL loop is used in a commands text file to transfer the data from each data collector in the list. Example FORALL Commands File: You can either list the IDs individually as in the first line of Example 1, or you can make a text file of the IDs and use the filename in quotes as on the first line of Example 2. Example 1 Commands Text File for Transferring Data from Multiple Data Collectors (IDs listed on command line): FORALL ID1, ID2, ..., IDN
'Begins loop. All IDs 'listed on this line.
I loop_id 'Unlock the unit using the special identifier. This 'identifier substitutes for all the units in the 'IDs.txt file. M1 Transferring Data 'Put message on display. S 'Transfer data from unit. Z 'Clear data from unit. T 'Set time by computer’s time. L 'Lock unit and put it to sleep. END 'End loop, begin re-executing at top.
Example 2 Commands Text File for Transferring Data from Multiple Data Collectors (IDs listed in IDs.txt file): FORALL "IDs.txt" 'Begin the loop. I loop_id 'Unlock the unit using the special identifier. This 'identifier substitutes for all the units in the 'IDs.txt file. M1 Transferring Data 'Put message on display. S 'Transfer data from unit. Z 'Clear data from unit. T 'Set time by computer’s time. L 'Lock the unit and put it to sleep. END 'End loop, begin re-executing at top.
The IDs.txt file must contain a list of the IDs. The IDs in the list must be separated by commas or spaces. 78
Appendix E Using Multiple Data Collectors and Base Stations
Page 85
In order to clarify the functioning of these different looping structures, it is helpful to consider four different scenarios for transferring data from multiple units. Scenario #1: The user has multiple data collectors to transfer, but only one at a time will be put in the Base Station or in front of the JetEye. A computer is dedicated to transferring data collectors as they become available. In this situation, the units do not need to be assigned individual IDs and a FOREVER loop can be used: FOREVER I 0000000000 M1 Transferring Data S Z T L END
This loop will continue indefinitely, unlocking any data collector that is available. It is important that only one unit at a time be in the Base Station or in front of the JetEye when using this looping structure. This loop will unlock any data collector; if more than one data collector is unlocked at a time, communications will fail. Scenario #2: The user has multiple data collectors to transfer. Some or all of them may be in the Base Station at any time. Each of the units must be transferred exactly one time. A computer is dedicated to transferring the units as they become available. In this situation, each unit must be assigned a unique ID and the FORALL loop can be used: FORALL "IDs.txt" I loop_id M1 Transferring Data S Z T L END
This loop will continue until the data from each unit in the IDs.txt file has been transferred once. Multiple units can be in the Base Station at one time because only one unit will be unlocked at a time. Appendix E Using Multiple Data Collectors and Base Stations
79
Page 86
Scenario #3: The user has multiple data collectors to transfer. Some or all of them may be in the Base Station at any time. Each unit is to be transferred when it is placed in the Base Station; some of the units may be transferred more than one time. A computer is dedicated to transferring the units as they become available. In this situation, each unit must be assigned a unique ID and a FOREACH loop nested inside a FOREVER loop can be used: FOREVER FOREACH "IDs.txt" I loop_id M1 Transferring Data S Z T L END END
This loop will continue indefinitely, continually attempting to unlock any units whose IDs are contained in the IDs.txt file. Unlike the FORALL loop in Scenario #2, this loop will continue attempting to transfer the data from a data collector even after it has been successfully transferred one time. Scenario #4: The user has multiple data collectors to transfer; all of the units to be transferred are in their Base Stations. However, some of the units (listed in the IDs.txt file) are not available to transfer. If the computer is unable to unlock a particular unit, the computer will stop trying to unlock that unit. In this situation, each unit must have a unique ID and a FOREACH loop can be used: FOREACH "IDs.txt" I loop_id M1 Transferring Data S Z T L END
80
Appendix E Using Multiple Data Collectors and Base Stations
Page 87
As was explained in the earlier discussion of the FOREACH loop, when the argument of the Unlock command is loop_id, the program only makes one attempt to unlock the unit. Given the unit’s sleep cycle, it is unlikely that one attempt will successfully unlock a unit. However, it is possible to ensure that each unit is awake when the program attempts to unlock it. This is done by placing six unused IDs at the beginning of the IDs.txt file (Figure E-2). Dummy1 Dummy2 Dummy3 Dummy4 Dummy5 Dummy6 ValidID1 ValidID2 ValidID3 ValidID4 Figure E-2 Sample IDs.txt File If a unit is awake and receives an Unlock command with the wrong ID, it will stay awake as long as it detects activity on the serial port. By placing six unused IDs at the beginning of the IDs.txt file, it is possible to ensure that each unit receives at least one Unlock command with an invalid ID and then stays awake. Then each unit is awake when the FOREACH loop attempts to unlock it and the data from the unit is transferred. The program only attempts to unlock each unit one time; if a unit is not present, the program moves on to the next ID. The program quits after attempting one time to unlock and transfer each unit. For complete information on using the commands file, see Chapter 1 of the Developer’s Reference Manual.
Appendix E Using Multiple Data Collectors and Base Stations
81
Page 88
Notes on Using Multiple Data Collectors To avoid problems when using multiple data collectors and Base Stations, you need to be aware of the following cautions: • Each LaserLite Pro and LaserLite Mx used in a multiple Base Station arrangement must have a unique ID. See the preceding section in this appendix for information on changing the ID of a LaserLite Pro or LaserLite Mx. • When the data transfer process begins do not remove a LaserLite Pro or LaserLite Mx from its Base Station, quit the program, or shut down the computer until the transfer process is completed. Caution: When sending an operating system and/or application to a LaserLite Pro or LaserLite Mx, you must have only one LaserLite Pro or LaserLite Mx at a time in the multiple Base Station set up. If there is more than one, the data collectors will not be damaged, but they will not be properly programmed. When transferring data, do not interrupt the process by removing the unit from its Base Station or aborting the program. The system is designed to avoid data loss, but observing this caution provides added protection.
If you remove a LaserLite Pro or LaserLite Mx while it is in the process of transferring data, the software displays a message that it was unable to communicate with the unit and then continues to try to transfer the data from all of the other data collectors. The data in the interrupted unit will not be cleared and can be transferred after the others have completed their data transfer.
Key Points on Using Multiple Data Collectors •
Each LaserLite Pro and LaserLite Mx must have a unique ID.
•
When sending files to a LaserLite Pro or LaserLite Mx, it must be the only unit in a Base Station.
•
Do not interrupt the data transfer process.
•
Data is not cleared from a LaserLite Pro or LaserLite Mx until all of the data is correctly transferred to the computer.
82
Appendix E Using Multiple Data Collectors and Base Stations
Page 89
Appendix F Resetting the LaserLite Pro and LaserLite Mx In the unlikely event that a LaserLite Pro or LaserLite Mx locks up and does not correct itself after sitting for 2 to 3 minutes, you will need to manually reset the unit to Monitor mode and resend the operating system software to the data collector. To manually reset the unit to Monitor mode: 1) Remove the battery end cap. 2) Hold the scan button down while replacing the battery end cap. 3) The unit will beep three times, indicating a successful reset. 4) The LaserLite Pro will show VX1 Monitor 1.11 or VX1 Monitor 1.34 on the first line, and Ready, bps=9600 on the second line of the display. The LaserLite Mx will show VX1 Monitor 1.33 or VX1 Monitor 1.34 on the first line, and Ready, bps=9600 on the second line of the display. 5) Verify that the computer’s IR station (Base Station, JetEye, or internal IR transceiver) is attached to the computer and ready to use. 6) Prepare the LaserLite Pro or LaserLite Mx to communicate with the computer, by either inserting the unit into the Base Station or pointing its IR transmitter (located in the end cap) towards the JetEye or built-in IR transceiver. The next steps guide you through resending the operating system software to the LaserLite Pro or LaserLite Mx. (Note: The LaserLite Mx is not Macintosh compatible.) • If you are using Windows 95/98/NT, go to Step 7 on page 84. • If you are using DOS, go to Step 7 on page 87. • If you are using a Macintosh computer (LaserLite Pro only), go to Step 7 on page 88.
Appendix F Resetting the LaserLite Pro and LaserLite Mx
83
Page 90
For Windows users (from page 83): If you have previously used Vxcom, proceed to Step 9. If you have not used Vxcom, complete Steps 7 and 8 before proceeding to Step 9. Note: The original Vxcom filename was Vxcomm.exe; newer versions of Vxcom have names of the form Vxcomxxx.exe, where xxx corresponds to the version number (such as, Vxcom138.exe). 7) Choose the Run command from the Windows Start menu and click Browse (Figure F-1).
Figure F-1 Run Window - Click Browse 8) Locate and open the Vxcom program. Click at the end of the path name to add the parameters (Figure F-2). The syntax is: [-p<port number>] [-d<IR device>]. Spaces are used to separate the parameters from each other.
Figure F-2 Add Vxcom Parameters The first parameter is the serial port (-p); the program uses 1 by default. If you are using serial port 1, you do not need to enter 84
Appendix F Resetting the LaserLite Pro and LaserLite Mx