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 5 of 28

6400 PSK Reference Manual, pages 41 to 50

Pages 41 to 50 of 272

The original document is the PDF (1.1 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 Intermec 6400

Page 41

Building Applications

3

This chapter explains how to use the Microsoft Visual C/C++ interactive developer’s environment (IDE) to build, link, and debug your 6400 PSK applications.

Building a Sample Program The PSK library includes several sample source files and make files, which were installed to the C:\INTERMEC\IMT6400\EXAMPLES directory. Two samples are discussed in this section. Note: The PSK requires Microsoft Visual C/C++, Professional Edition v1.0 or v1.5x, which can create 16-bit DOS applications. For more information, see “Microsoft C/C++ Version Requirements” in Chapter 1. GETFLDS.C A sample source file that demonstrates a forms-based application with several fields. Displays several fields for input, manages the navigation between fields, and checks the length of any input. It shows how to display an error message if the input validation fails, and how to force the cursor back into the field that was being processed. GETFLDS.MAK Make file for GETFLDS.C. To build a sample program 1. Start Visual C/C++. 2. From the Project menu, choose Open. 3. From the directory INTERMEC\IMT6400\EXAMPLES, select the desired make file (*.MAK). 4. From the Project menu, choose Build. 5. Debug the program with the 6400 Application Simulator. See Part II, 6400 Application Simulator User’s Manual, for more information. 6. Download the application to the 6400. See the procedure in “Using the Serial Port to Transfer Applications and Files” later in this chapter. 7. Run the application on the 6400. From the directory where you loaded the 6400 application, type the application name and press Enter. For example, c:\GETFLDS

Note: If you have trouble compiling the sample project, verify that the project settings have not changed. Use the Project Settings Checklist from the next section, “Building Your Own Program.”

3-3

Page 42

6400 PSK Reference Manual

Building Your Own Program You need to set several project and compiler options when you build your own programs. The sample programs include these settings in the *.MAK files. Make sure that your source code uses only the Intermec-certified C functions. If you use uncertified functions, the link operation will fail. See Chapter 2, “Programming Guidelines,” for a list of certified C functions. Use the Project Settings checklist following this procedure to set the environment for building PSK applications in Microsoft Visual C/C++. Appendix B, “Microsoft Visual C/C++ Settings,” shows the related dialog boxes for these settings. To build your own program 1. Start Visual C/C++. 2. Create a new project. 3. Use the project settings checklist to set the compiler and linker options. 4. From the Project menu, choose Build. 5. Debug the program with the 6400 Application Simulator. See Part II, 6400 Application Simulator User’s Manual, for more information. 6. Download the application to the 6400. See the procedure in “Using the Serial Port to Transfer Applications and Files” later in this chapter. 7. Run the application on the 6400.

Project Settings Checklist Dialog Box or Command

For This Variable

Select This Setting

Done?

Project Options

Project Type

MS-DOS application

Use Foundation Classes uncheck (turn off foundation classes)

Y Y

Compiler Options

Y

Code generation: CPU Floating Point Calls

80386 Use Emulator

Memory Model

Large

Segment

SS == DS

Linker Options

Libraries oldnames, im64psk.lib

Directories

Include File Path

\INTERMEC\IMT6400\INCLUDE must be listed first, followed by

Y Y Y Y

\MSVC\INCLUDE

Library File Path

\INTERMEC\IMT6400\LIB must be listed first, followed by \MSVC\LIB

3-4

Y

Page 43

Building Applications

3

Building Your Own Program From a Command Line You can build your program from the command line (DOS prompt) instead of from within the Microsoft Visual C/C++ environment. Your *.MAK file must set the correct compile options for the application to run on the 6400.

CFLAGS Settings Required for a Successful Compile Setting

Meaning

/G3

Target CPU is an 8086 processor. If you omit the /G switch, the build defaults to /G0. Using any other /G setting will cause failure that is difficult to debug.

/FPi

Use alternate math for the floating point calls. This switch is required. Any other /FP setting will cause failure.

/AL

Use large memory model. This switch is required.

The following examples show the correct settings to use. Refer to your C/C++ documentation for more information on make files, command files, and batch files.

TMP.MAK # MAKE FILE FOR TEST1 CCPP = cl >>err CC = cl >>err CFLAGS

= /FPi /W3 /Zi /AL /Od /D "_DEBUG" /D "_DOS"\ /I "\msvc\include" /I "C:\INTERMEC\IMT6400\INCLUDE" /Fa /Fr /Fd"TEST1.PDB" OBJ = test1.obj big0.obj POBJ = test1.obj+big0.obj SRC

= $(OBJ:.c=.obj)

H

= im64psk.h

$(OBJ):$(H) MAPFILE LFLAGS

= proj.map = /NOLOGO /NOI /STACK:5120 /ONERROR:NOEXE /CO proj_DEP = c:\intermec\imt6400\include\imstdio.h \ c:\intermec\imt6400\include\IM64psk.h test1.OBJ: test1.C $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c TEST1.C big0.OBJ: big0.C $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c big0.C TEST1.exe: $(OBJ) $(PLIBS) link $(LFLAGS) @tmp.cmd >>err

3-5

Page 44

6400 PSK Reference Manual

TMP.CMD TEST1.OBJ + BIG0.OBJ test1.EXE test1.map c:\intermec\imt6400\lib\+ c:\msvc\lib\+ c:\msvc\mfc\lib\+ oldnames IM64PSK

TMP.BAT DEL ERR NMAKE /F TMP.MAK TEST1.EXE >> ERR TYPE ERR

Using the Serial Port to Transfer Applications and Files The PSK includes a FileCopy utility for transferring files and applications between your PC and a 6400 connected to your PC serial port. FileCopy was installed on your PC when you ran the PSK setup program. The FileCopy utility is installed at Target_Directory/TOOLS/. The FileCopy online help contains detailed information about using the application. Applications running on the 6400 are executable files (*.EXE). FileCopy requires an application to run on the 6400 to handle the transfer on the 6400 end. You can use XMSENDF.EXE and XMRECVF.EXE, or you can create your own application using the PSK functions from the library. Use INTERSVR.EXE and INTERLNK.EXE to transfer XMSENDF.EXE and XMRECVF.EXE to the 6400. Afterwards, you can use the FileCopy utility with XMSENDF.EXE and XMRECVF.EXE running on the 6400. •

INTERSVR.EXE is installed on the 6400.

•

INTERLNK.EXE is installed on your PC. It causes the 6400 drives to appear as virtual drives on the PC, with drive letters immediately beyond the highest drive letter currently used on the PC. For more information about the setup, please refer to the Pen*Key 6400 Hand-Held Computer Programmer’s Reference Guide, Part No. 977-054-004.

Note: You can use the PSK functions to create file transfer applications that use different serial communications settings. Use INTERLNK and INTERSVR device drivers to transfer your file transfer applications to the 6400.

3-6

Page 45

Building Applications

3

To download or upload an application or other file using FileCopy 1. Connect the 6400 to your PC. For more information, refer to your 6400 Hand-Held Computer User’s Guide, Part No. 961-047-093. 2. Start the FileCopy utility. 3. Select the COM Port Setup tab and the Serial Setup tab to verify that the settings for your PC match the settings for the 6400. Any changes you make in these tabs are automatically saved for you. 4. Select the FileCopy tab and type your filename information. Note: The 6400 supports drive C. Do not include a “\” in the 6400 filename. 5. To download a file to the 6400, start XMRECVF.EXE on the 6400. To upload a file from the 6400, start XMSENDF.EXE on the 6400. 6. Click Download to copy the file from the PC to the 6400. Click Upload to copy the file from the 6400 to the PC. 7. Click Exit to close the FileCopy utility. To set up the 6400 to receive a file using XMRECVF.EXE 1. Connect the 6400 to your PC. For more information, refer to your 6400 Hand-Held Computer User’s Guide. 2. On your 6400, start the XMRECVF.EXE utility. This utility sets the following parameters for serial communications: •

Port = COM1

•

File Transfer Protocol = XMODEM1K

•

Baud Rate = 19200

•

Parity = Even

•

Data Bits = 7

•

Stop Bits = 1

3. Follow the instructions on the 6400 screen to specify the filename that you are sending to the 6400. The status of the transmission appears on the 6400 screen. 4. When the file transfer is complete, type any key to exit.

3-7

Page 46

6400 PSK Reference Manual

To set up the 6400 to send a file using XMSENDF.EXE 1. Connect the 6400 to your PC. For more information, refer to your 6400 Hand-Held Computer User’s Guide. 2. On your 6400, start the XMSENDF.EXE utility. This utility sets the following parameters for serial communications: •

Port = COM1

•

File Transfer Protocol = XMODEM1K

•

Baud Rate = 19200

•

Parity = Even

•

Data Bits = 7

•

Stop Bits = 1

3. Follow the instructions on the 6400 screen to specify the filename that you are sending to your PC. The status of the transmission appears on the 6400 screen. 4. When the file transfer is complete, type any key to exit.

3-8

Page 47

nugget

39 helconital nugget

39 helconital

4 Converting Trakker Antares and JANUS Applications to 6400 Applications

Page 48

nugget blank

39 helconital nugget

39 helconital

Page 49

Converting Trakker Antares and JANUS Applications to 6400 Applications

4

This chapter describes the differences between the Trakker Antares PSK, JANUS PSK, and 6400 PSK libraries and explains how to convert your applications from one environment to another.

Differences Between Trakker Antares, JANUS, and 6400 PSK Functions The 6400 offers full alphanumeric keypad input as well as integrated bar code scanning. It features an AMD Am386 SC300 processor with a clock speed of 33 MHz.

SCAN

ENT

ENT

1

2

4

5

3 6

7

8

9

0 F1

F2

F3

F5

F6

F7

F8

F9

F10

F11

F12

SP

F4

I/O

PSKR001.eps

The Trakker Antares PSK and 6400 PSK only support Microsoft C/C++. The JANUS PSK supports Borland C/C++, Microsoft C/C++, Microsoft QuickBasic, Microsoft Visual Basic, and ADA. This chapter discusses only the C/C++ library differences. In general, a C/C++ application written for a Trakker Antares terminal or JANUS computer may require minor changes to run on a 6400.

4-3

Page 50

6400 PSK Reference Manual

You can handle the differences between the JANUS PSK, Trakker Antares PSK, and 6400 PSK libraries using one of these methods: •

Use the information in this chapter to rewrite entire sections of code.

•

Locate each occurrence of the unsupported command in the file and place an #ifdef statement before each occurrence.

•

Create a compatibility file (compat.h) to redefine the unsupported functions. Use a #include statement at the beginning of your program to reference this file.

The first two methods are time consuming and must be performed for each program to be converted. The third method provides a reusable filter that you can quickly customize for individual programs.

Creating Compatible Applications To create compatible applications created for JANUS devices or Trakker Antares terminals that run on 6400, use compatible PSK functions and plan your program flow and logic. Keep these points in mind: •

Use compatible functions to minimize rewriting program segments.

•

Use status code macros to test function return values.

•

Some JANUS PSK functions have runtime requirements, such as a protocol handler. Refer to your JANUS PSK reference manual for more information.

•

For all supported functions, recompile the applications using the 6400 library.

Note: Be sure that when you compile your program you set the appropriate options for the destination. JANUS PSK and 6400 PSK make files use the 80386 compiler option. Trakker Antares PSK make files use the 8086/8088 compiler option. For more information, see the “Project Settings Checklist” in Chapter 3.

Compatible Functions These functions work with all PSKs without modifications. im_backlight_on im_backlight_off im_cancel_rx_buffer im_cancel_tx_buffer im_clear_screen im_command im_cputs im_erase_line im_event_wait

4-4 im_irl_v im_message im_power_status im_putchar im_puts im_receive_buffer im_receive_field im_receive_input im_set_cursor_style