The text of a manual · part 8 of 12
EZBuilder Tutorial, pages 71 to 80
Pages 71 to 80 of 114
The original document is the PDF (3.0 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.
Filed in the catalog under the Intermec 2420, Intermec 2425 and Intermec 2481
Page 71
5 Testing Your Program on the Simulator
Page 72
ds
Page 73
Testing Your Program on the Simulator
5
This chapter describes how to the build your application program using the EZBuilder code generator and how to test it using the Simulator. It also provides information on downloading your program to your terminal and points you to some example applications available for study.
Overview In earlier chapters, you learned how to create menus, screens, and transactions, as well as data fields, labels, and various actions. In this chapter, you will test your application program (your .IMP file), and you will set certain options. You will also have EZBuilder build, or “compile,” your executable program (an .EXE file). Using the Simulator, you can test your program immediately after it is compiled. You will also learn how to download your application to your terminal and test it again from there.
Exercise 16: Building the Program In this exercise, you will build your program. To set your Build options 1. Choose Build from the Options menu.
You can use one of three Categories, or “modes,” to build your program. •
Debug mode. This mode adds the debugging information required by CodeView Debugger to the executable file. Generally, debug mode is used only by C programmers. Because the debug information is included, this mode produces a larger application.
•
Normal mode. This mode produces the most efficient executable file.
5-3
Page 74
EZBuilder Tutorial
•
Min externs (minimal external functions). This mode produces the smallest executable file.
Note: If you add any C program code to the program after EZBuilder generates its code, be aware that when recompiling in EZBuilder, EZBuilder will regenerate all code, rewriting over any C program code changes you may have made outside of EZBuilder. 2. Select the Normal radio button. 3. In the Build Options dialog box, click the Paths tab.
EZBuilder searches for the compiler and certain libraries as it builds your program. You must indicate correct paths to these components, and you must also indicate where you want your generated EZBuilder application output file (your executable C program) stored. •
The Compile path indicates the location of the Microsoft Visual C++ compiler on your computer. Make sure the path is correct.
•
The PSK path indicates the location of the PSK libraries and Simulator on your computer. Make sure the path is correct.
•
The Output path indicates the location where you want your generated application program to be stored after EZBuilder has built it. This path specifies where the Simulator will look for all files opened in your application as well as all files used to simulate COM or network input and output. Make sure the path is correct.
You will find some EZBuilder example applications on output path C:\INTERMEC\EZBUILD\EXAMPLES. For more information on these examples, see the EZBuilder Getting Started Guide. 4. Click OK to build the program.
5-4
Page 75
Testing Your Program on the Simulator
5
To build (compile) your application program 1. Choose Build from the Build menu. The Build Status dialog box appears, showing the status of the build.
If you build your program in Debug mode rather than Normal mode and receive warnings, run your program anyway to test it. If you receive errors when building, you will not be able to run your program until you have debugged it.
2. Click Close. Congratulations! You have completed Exercise 16. Save your work, and continue with Exercise 17.
5-5
Page 76
EZBuilder Tutorial
Exercise 17: Testing the Program After EZBuilder has built your program, test it using the EZBuilder Simulator. To test the program using the Simulator •
From the Tools menu, choose the Trakker Simulator command (choose this command for Trakker, 6400, or T2090). The Simulator screen appears showing the Main Menu of your program.
You can choose to perform tests in any order, but you must test everything you coded. Some suggested tests are listed in the “Suggested Tests” section. While testing your program on the JobOn and JobOff screens, use the Esc key to return to the Main Menu. You can exit your program and return to Windows 95, Windows 98, Windows NT, and Windows 2000 at any time by pressing Ctrl-C twice. For online help, you can access the Simulator Editor, as described in the EZBuilder Getting Started Guide.
Suggested Tests The following are some suggested tests to get you started. Depending on your options in coding the tutorial application (or your enhancements you made), you should think of additional tests. In testing a program, every branch, data field, action, screen, menu, transaction, and programmed function key should be thoroughly tested before the program is deemed ready for users. 1. From the Main Menu, test the use of the functions keys on your keyboard to see if the program branches correctly to the MM_Help screen, the JobOn screen, and the JobOff screen, respectively. Test to see that Esc returns you to the Main Menu from the JobOn and JobOff screens.
5-6
Page 77
Testing Your Program on the Simulator
5
You can bring up the JobOn and JobOff screens from the Main Menu by moving to the appropriate option and pressing Enter. Test that these navigation options work. 2. From the JobOn screen, select the three data fields, one at a time, and use the F1 key to see if the Data_Help screen appears for each data field. 3. From the JobOff screen, repeat the test described in Step 2. Note: If you created the CopyBadge transaction, as soon as you entered the Badge ID number for a JobOn transaction, it was automatically entered into the JobOff transaction’s storage place for Badge ID Number. Remember, you do not need to key it again for your JobOff transaction records. (Optionally, you may have coded the same logic for automatically moving Part and Order data.) 4. From the MM_Help screen, use the up and down arrow keys on your keyboard to test the scrolling section to be sure you can read all of the help text. Check for any typing, logic, or semantic errors; if you find any, make a note to correct them later in EZBuilder and to recompile. 5. From the Data_Help screen, repeat the test described in Step 4. 6. On the JobOn screen, enter data for the three fields. When you completely fill the Badge field, it automatically goes to the Part field for data. Test with shorter Badge ID data, and use F4 or Tab to move to the Part field. (See the Note in Step 3 regarding automatic entry of data.) 7. Use F4 to tab back to previous fields so you can re-enter data. 8. Test the Part Number field by entering 25 characters to see that it wraps to the next line. Also, test by entering shorter Part data, and then use F4 to move to the Order field and enter that data. 9. From the JobOn screen, test how you can use the right and left arrow keys to move to certain characters in the data to correct those characters. 10. When you finish testing and have made notes on how you want to enhance or correct your program, press Ctrl-C twice to exit the program. 11. Go to the location where your program files are kept (as per your Output search path), and see how many files were generated by EZBuilder. 12. List your JOFILE output file on your screen or a printer, and look at your JOTRAN and JOFTRAN records. Are they correct as per the data you entered? Did you plan and write down your test data before testing? If not, repeat the tests using the example data listed on the next page. Note: You should make your program available for others to use on the terminal only after you are satisfied with your test results and you have enhanced your program as needed. To make your program available to others, you must download your executable program to the terminal. This process is described in Exercise 18 later in this chapter.
5-7
Page 78
EZBuilder Tutorial
Example Data Whether you are testing your program with test data or your user is executing your program with real data, the three input data terms Badge ID Number, Part Number, and Order Number data can either be keyed on a keyboard or scanned with a terminal. The data is stored as output records and sent to a file that can be listed to your screen or printed, depending on your device capabilities. The output file contains two types of transaction records: Job On transactions and Job Off transactions.
Record Identification Codes The first item in each record is the six- or seven-letter identification code. •
JOTRAN identifies the record as having Job On transaction data.
•
JOFTRAN identifies the record as having Job Off transaction data.
Without the identification code, it is impossible to tell the two records apart.
Record Data Order In the record, the identification code (in this case, JOTRAN or JOFTRAN) is always the first item. The identification code is followed by a comma, the Badge ID Number, a comma, the Part Number, a comma, the Order Number, a comma, the system date, a space character, and the system time. Except for the space between date and time, the data fields are run together and delimited by commas, as shown here by their field names: IDCode,BadgeNo,PartNum,OrderNo,Date Time
Because a carriage return ends the record after the Time data, each record can be printed on one line in a listing.
Automatic Data Entered into the Record Aside from data entered or scanned for the BadgeNo, PartNum, and OrderNo fields, some information (other than the identification code) is automatically attached to the record when the transaction is packaged (prepared for output).
5-8
•
As soon as the user completes the Order Number for a transaction, the date, time, and carriage return characters are automatically appended before the transaction record is sent to the output file.
•
If your program includes any optional copy transactions (CopyBadge, CopyPart, CopyOrder), the appropriate data for a JobOn transaction is sent to its corresponding place in the JobOff Transaction as soon as it is entered by the user. This saves operator time and ensures accuracy.
Page 79
Testing Your Program on the Simulator
5
Example Output Listing You can list your output file and see one transaction record per line on the listing. The data fields will be in the same order in which you listed them in the JobOn and JobOff Transaction Fields lists. An example listing of eight transactions follows. Your test data may be different. JOTRAN,1234567890,1111133333444,2342345,04-23-1997 04:30:00 JOFTRAN,1234567890,1111133333444,2342345,04-23-199 04:45:02 JOTRAN,22222,2339AB-345473-XYZ,04-23-1997,5678990 04:48:00 JOFTRAN,22222,2339AB-345473-XYZ,04-23-1997,5678990 05:30:10 JOTRAN,35353,ASMCJK-234-88,04-23-1997,1526125 05:35:17 JOFTRAN,35353,ASMCJK-234-88,04-23-1997,1526125 07:02:00 JOTRAN,67612,22222333334444488,4837573,04-23-1997 08:15:01 JOFTRAN,67612,22222333334444488,4837573,04-23-1997 08:55:10
Congratulations! You have completed Exercise 17. You can go back to EZBuilder and make any modifications you want to your program, or you can begin a new program. Save your work before continuing with Exercise 18.
Exercise 18: Downloading Your Program When your EZBuilder application program has been built and thoroughly tested, download it to your terminals for users. In this exercise, you will connect to the terminal and download your program. To prepare for a download 1. Connect your terminal to the development PC or host computer. Be sure to note the computer’s COM port to which you are connecting the cable. For help, see your user's manual. Refer to your terminal’s documentation for complete details on the physical connection. 2. Open your EZBuilder application. Be sure you know your filenames and directory paths.
5-9
Page 80
EZBuilder Tutorial
3. Choose Download from the Tools menu. The Download Application dialog box appears.
4. From the Communications dialog box, make sure the Communications settings shown on the screen and those shown on the terminal are the same. •
The COM2 port is listed in the above example. Be sure you know the COM port on your computer to which your cable is connected. Make sure your terminal setting matches the setting used by your computer.
•
The default (19200) Baud Rate is shown in the example. The baud rate must match the setting on the terminal; change it if necessary.
•
Terminal Drive C is the only drive from which you can run your EZBuilder application on the terminal. Do not change this drive. (For more information, see the EZBuilder Getting Started Guide.)
From the Download Application dialog box, you can choose whether or not to run the program when you download it. To run the program, be sure Run Program is selected. Note: The Default, Download, Exit, Cancel, and Help buttons (available on the Download Application dialog box) are also available on the two other Download Application dialog boxes (Data and Validation), so you can review the settings in any order, and then download your program and run it when you are ready.
5-10