The text of a manual · part 4 of 12
JANUS Application Simulator User's Manual, pages 31 to 40
Pages 31 to 40 of 112
The original document is the PDF (557 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.
Filed in the catalog under the Intermec J2020, Intermec JG2020, Intermec JR2020, Intermec J2010, Intermec J2050 and Intermec JG2050
Page 31
Running and Debugging an Application
2
This chapter describes how to use the Simulator TSR when you run and debug a JANUS application with application development software.
Deciding Where to Start the Simulator TSR The Simulator TSR is a terminate and stay resident program. TSRs are small programs that are loaded into DOS memory and run in the background. Therefore, it is important that you start the TSR from MS-DOS. It is recommended that you start the Simulator TSR from MS-DOS without Windows running. That way, you can be sure that the Simulator TSR remains in memory until you exit the Simulator TSR or shut down you PC. You can start the Simulator TSR if you are in an MS-DOS session from Windows or an MS-DOS shell spawned from your application development software. However, when you exit the session or shell, the Simulator TSR is removed from memory.
Starting the Simulator TSR You can add a command to your AUTOEXEC.BAT file to start the TSR whenever you reboot, or you can perform the following procedure. To start the Simulator 1. At the MS-DOS prompt, change to the directory where the Simulator files are stored. For example: cd c:\janussim 2. Start the Simulator TSR with either of these commands: • To start the TSR with the default INI file, JANUSSIM.INI, type this command at the DOS prompt and press Enter: janussim • To start the TSR with a customized INI file, type this command at the DOS prompt and press Enter: janussim filename.ini Where filename.ini is the name of your customized INI file.
2-3
Page 32
JANUS Application Simulator User’s Manual
3. This message may appear: Environment variable JANUSSIM not found
If so, type this command at the MS-DOS prompt and press Enter, or add this command to your AUTOEXEC.BAT file and reboot your PC: set janussim=path\ Where path is the drive and directory where the JANUS Application Simulator software is installed. The path must have a terminating backslash. For example: set janussim=c:\janussim\ 4. When the Simulator TSR is loaded into memory, it displays this message: The Simulator has been loaded!
You can now use your application development software to run and debug JANUS applications. For help, see the next section.
Running and Debugging a JANUS Application Once you start the Simulator TSR, your next task is to start Windows and use your application development software to run and debug the JANUS application. Your application development software executes as usual because the Simulator TSR does not affect it. You can use standard debugging techniques. Here are some suggestions: • If you are editing JANUS application with the Microsoft Visual C++ editor, you can select the Tools menu and choose Codeview for DOS. The software displays the source code for your application in a DOS session. You can set break points, set watching, and step through the application using PSK library calls as well as standard library calls. • JANUS applications are DOS applications, so make sure you use a DOSapplication debugger, such as Codeview for DOS. You cannot use a Windows-application debugger, such as Codeview for Windows. • Follow the instructions in the documentation provided with your application development software.
2-4
Page 33
Running and Debugging an Application
2
Understanding the Limitations of the Simulator TSR Read these notes to understand the limitations of the Simulator TSR: • Be sure to start the Simulator TSR before you run a JANUS application on your development PC. If you run a JANUS application on your PC without first starting the Simulator TSR, the application may lock up your PC. If this happens, reboot your PC immediately. • The JANUS Application Simulator does not help you test the application’s user interface or performance. You can test those characteristics far better on a JANUS reader than on any simulation program. You should always test your application by running it on a JANUS reader after you have finished debugging the logic. • An application containing an erroneous input combination will fail on the JANUS reader, but will not be detected by the Simulator TSR. Specifically, if a JANUS application performs the following two steps, it generates an error condition when it is run on a JANUS reader: 1. The application calls the im_set_input_mode function and sets the input mode to IM_PROGRAMMER or IM_DESKTOP. 2. The application calls a stdlib function (such as getch or gets) or iostream input function (such as cin) to read input from the keyboard. The JANUS reader does not receive the keyboard input from the stdlib or iostream function. Instead the application hangs because the reader waits for input that it cannot receive. However, if you run this application on your PC with the Simulator TSR, the PC receives the keyboard input. The Simulator TSR does not detect that this combination causes an error condition on the reader. Make sure your JANUS applications do not combine a non-Reader Wedge input mode with a stdlib or iostream keyboard input function. Also, make sure you test your applications on a reader after you finish debugging them.
2-5
Page 34
JANUS Application Simulator User’s Manual
Exiting the Simulator TSR To unload the Simulator TSR from memory, type this command at the DOS prompt and press Enter: janussim -d This message appears: Simulator has been unloaded.
2-6
Page 35
3 Learning About the INI File
Page 36
Page 37
Learning About the INI File
3
This chapter describes the parameters in the JANUS Application Simulator’s initialization file. It also explains which JANUS PSK library functions and JANUSspecific system interrupts will receive the INI parameters as return values and out parameters.
How to Customize the Parameters You can customize the parameters in the initialization file using the Editor or an ASCII text editor: • The Editor is more of a configuration tool than an editor. It helps you create INI files and customize their parameters. For help using the Editor, see Chapter 4. • You can create and edit INI files with any text editor. Use a copy of the JANUSSIM.INI file to make sure you conform to the formatting conventions. Read this chapter to learn the values for each parameter.
How the Parameters Are Organized in This Chapter The parameters in this chapter are listed in the order they follow in the INI file. For reference, here is the JANUSSIM.INI file with all the parameters set to their default values: ; ; Filename: JANUSSIM.INI ; port1_read_file = comport1.rcv port2_read_file = comport2.rcv port3_read_file = comport3.rcv port4_read_file = comport4.rcv port1_write_file = comport1.trx port2_write_file = comport2.trx port3_write_file = comport3.trx port4_write_file = comport4.trx rx_check_status_return = 0600H - Comm Operation successful protocol_ext_status_return = 0600H - Comm Operation successful cancel_rx_buff_return = 0600H - Comm Operation successful cancel_tx_buff_return = 4603H - Comm util no PH for config UART_status = 37H
3-3
Page 38
JANUS Application Simulator User’s Manual expanded_keyboard_status = 0 - command complete kb_insert_string_status = 0 - success kb_insert_string_capacity = 255 flush_exp_keyboard_status = 0 - success warmboot_status = 0 - warmboot disabled power_status_line = 1 - AC line connected power_status_battery = 2 - critical battery power_status_backup = 1 - backup low power_status_batt_life = 93 power_status_return = 0800H - Power management success display_contrast_level = 16 display_size_mode = 0 - 80 x 25 display_video_mode = 3 - std video mode 3 (80x25) display_scroll_mode = 1 - scroll at 16 display_viewport_lock = 0 - locked display_x_pos = 0 display_y_pos = 0 display_backlight = 0 - backlight off display_char_height = 0 - standard height characters appl_break_status = 0 - break not been made follow_cursor = 1 - follow cursor mode on control_key = 0 - control key disabled keyclick = 0 - keyclick off numeric_keypad_switching = 0FFH - numeric keypad switching permitted numeric_keypad_status = 0FFH - number pad enabled label_symbology = 1 - Code 39 sim_wand_key = CTRL/G clear_abort_callback_return = 0500H - Reader Wedge success command_return = 0500H - Reader Wedge success link_comm_return = 0500H - Reader Wedge success serial_protocol_control_return = 0500H - Reader Wedge success standby_wait_return = 0500H - Reader Wedge success unlink_comm_return = 0500H - Reader Wedge success
Note: This example JANUSSIM.INI file shows the text message for each value as it appears in the INI file, in the software, and on the JANUS. However, the rest of this manual shows messages without abbreviations to make them more readable.
3-4
Page 39
Learning About the INI File
3
Overview of Parameters This section contains the following information about each parameter in the JANUS Application Simulator’s initialization file:
parameter name Description
The purpose of the parameter.
Default
The default value for the parameter.
Values
The values you can set for the parameter.
Function
The JANUS PSK library function that receives the parameter as a return value or out parameter. An out parameter specifies a value that is returned by the function. In this manual, the JANUS PSK library functions are called by their C library function names. The QuickBasic library function names are similar, except they use capitalization instead of underscores to make the names readable.
Interrupt
The JANUS-specific system interrupt that triggers the Simulator TSR. Developers who are not using the JANUS PSK can use the interrupts in their JANUS applications.
Notes
More information about the parameter. For example, this section may specify the name of the PSK function’s out parameter that will contain the value of this INI parameter. The JANUS PSK documentation describes each PSK function and lists its out parameters and return values. The Notes section is optional.
3-5
Page 40
JANUS Application Simulator User’s Manual portn_read_file Description
Names the ASCII file that contains data to be read by the JANUS application as if it were received on a COM port. The n in portn_read_file is the port number (1 to 4).
Default comportn.rcv, where n is the COM port number (1 to 4)
Values
Any filename
Function im_receive_buffer im_receive_buffer_no_wait im_receive_buffer_noprot im_receive_byte im_receive_input im_irl_v im_irl_y
Interrupt
INT 14H
Notes
Do not set this parameter to comn.rcv. Your PC will expect data from its COMn port. You must test the application on a JANUS reader to make sure that the application is handling the input communications protocols correctly. If you use the Editor to specify a new file for the portn_read_file parameter, the Editor lets you select an RCV file in any directory or on any drive that is accessible from your PC. However, the Editor saves only the filename to the INI file. If the RCV file will not be in the current directory when you run the JANUS application on your PC (or in a directory listed in the PATH statement in your AUTOEXEC.BAT file), you must edit the INI file to add the file’s path to the RCV filename.
3-6