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 6 of 36

Trakker Antares Application Development Tools System Manual: Part I - Trakker Antares PSK Reference Manual, pages 45 to 54

Pages 45 to 54 of 340, from Trakker Antares Application Development Tools System Manual

The original document is the PDF (1.6 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, Intermec 2435 and Intermec 2481

Page 45

Chapter 3, Building Applications

Although a host can call for a CLOSE, TCP will not close a connection for the client. TCP on the terminal only supports closing initiated by the application through the socket interface.

Building a Sample Program The PSK library includes sample source files and make files, which were installed to the C:\INTERMEC\IMT24\EXAMPLES\PSK directory. Three samples are discussed in this section. You build your sample program differently for terminals running .BIN applications and terminals running DOS .EXE applications. PSK Library Sample Source Files and Make Files Source File DEFAPP.C

Make File DEFAPP.MAK

Description Accepts user input, transmits the input to the host, and displays any data received.

GETFLDS.C

GETFLDS.MAK

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.

ISMT24.C

ISMT24.MAK

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.

To build a sample .BIN program for terminals 1 Start Visual C/C++. 2 From the Project menu, choose Open. 3 From the directory INTERMEC\IMT24\EXAMPLES\PSK, select the desired make file (.MAK). 4 From the Project menu, choose Build. 5 Debug the program with the Trakker Antares Application Simulator. See Part II, Trakker Antares Application Simulator User’s Manual, for more information. 6 Convert the application to a binary file using EXE2ABS.EXE. See the set of steps on page 28. 7 Download the application to the terminal. See the set of steps on page 31.

Trakker Antares PSK Reference Manual

25

Page 46

Chapter 3, Building Applications

8 Run the application. Note: If you have trouble compiling the sample project, verify the project settings. Use the Project Settings Checklist in the next section, “Building A .BIN Program Using Microsoft Visual C/C++.” To build a sample DOS .EXE program for terminals using Microsoft Visual C/C++ 1 Start Visual C/C++. 2 From the Project menu, choose Open. 3 From the directory INTERMEC\IMT24\EXAMPLES\PSK, select the make file (.MAK). 4 Use the project settings checklist to set the compiler and linker options. See the checklist on page 29. 5 From the Project menu, choose Build. 6 Debug the program with the Trakker Antares Application Simulator. See Part II, Trakker Antares Application Simulator User’s Manual, for more information. 7 Download the application to the terminal. See the set of steps on page 31. 8 Verify the terminal is running ROM-DOS. 9 Run the application. Note: If you have trouble compiling the sample project, verify the project settings. Use the Project Settings Checklist from “Building A DOS .EXE Program” on page 28.

Building a .BIN Program Using Microsoft Visual C/C++ This section describes how to build a .BIN application using Microsoft Visual C/C++. To learn how to build a .BIN application using Borland Turbo C++, see the documentation that came with your software. When you build your own programs, you need to set several project and compiler options. The sample programs already 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. Make sure that you have configured the environment for building PSK applications in Microsoft Visual C/C++. You use different settings for terminals that are running .BIN applications than for terminals that are running DOS .EXE applications. Appendix B, “Microsoft Visual C/C++ Settings,” shows the dialog boxes. 26

Trakker Antares PSK Reference Manual

Page 47

Chapter 3, Building Applications

Note: If your program uses file actions such as open or close file, you need to include imstdio.h instead of stdio.h. See the example “TMP.MAK” on page 30. To build a .BIN program using Microsoft Visual C/C++ 1 On your PC, start Visual C/C++. 2 Create a new project. 3 Use the project settings checklist to set the project options. 4 From the Project menu, choose Build. Or, you can build a program from the command line. For help, see “Building Your Own Program from a Command Line” on page 29. 5 Debug the program with the Trakker Antares Application Simulator. See Part II, Trakker Antares Application Simulator User’s Manual, for more information. 6 Convert the application to a binary file. See the set of steps on page 28. 7 Download the application to the terminal. See the set of steps on page 31. 8 Run the application. Project Settings Checklist for Microsoft Visual C/C++ .BIN Programs Dialog Box or Command Project Options

For This Variable Project Type

Select This Setting MS-DOS application

Use Foundation Classes uncheck

Code Generation CPU Floating Point Calls Disable stack checking

8086/8088 Alternate Math uncheck

Memory Model Model Segment

Large SS == DS

Linker Options

Libraries oldnames, llibca, IMT24LIB

Directories

Include Files Path

\INTERMEC\IMT24\INCLUDE must be listed first, followed by \MSVC\INCLUDE

Library Files Path

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

Compiler Options

Trakker Antares PSK Reference Manual

27

Page 48

Chapter 3, Building Applications

Converting an Application to a Binary File For your application to run on a Trakker Antares terminal that is not running ROM-DOS, it must be stored as an executable binary file (.BIN). Use the EXE2ABS.EXE program that comes with the PSK to convert the .EXE file to a .BIN file. Note: The FileCopy utility automatically converts an executable file (.EXE) to an executable binary file (.BIN) if you select the Convert.EXE check box. To convert an executable file to a binary file • On your PC in the directory where you want to create the .BIN file, type this command and then press Enter: c:\intermec\imt24\lib\exe2abs filename.exe where filename is the name of your application.

Building a DOS .EXE Program Using Microsoft Visual C/C++ This section describes how to build an .EXE application using Microsoft Visual C/C++. To learn how to build an .EXE application using Borland Turbo C++, see the documentation that came with your software. When you build your own programs, you must set several project and compiler options. If you want to run the sample programs on your terminals running in DOS mode, you must create a new .MAK file. 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. Make sure that you have configured the environment for building PSK applications in Microsoft Visual C/C++. There are different project settings for terminals that are running DOS .EXE applications than for terminals that are running .BIN applications. After this procedure, there is a project settings checklist that you can use. Appendix B, “Microsoft Visual C/C++ Settings,” shows the dialog boxes. Note: If your program uses file actions such as open or close file, you must include imstdio.h instead of stdio.h. See the example “TMP.MAK” on page 30. To build a DOS .EXE program using Microsoft Visual C/C++ 1 On your PC, start Visual C/C++. 2 Create a new project. 3 Use the project settings checklist to set the project options.

28

Trakker Antares PSK Reference Manual

Page 49

Chapter 3, Building Applications

4 From the Project menu, choose Build. Or, you can build a program from the command line. For help, see the next section, “Building Your Own Program From a Command Line.” 5 Debug the program with the Trakker Antares Application Simulator. See Part II, Trakker Antares Application Simulator User’s Manual, for more information. 6 Download the application to the terminal. See the set of steps on page 31. 7 Verify the terminal is running ROM-DOS. 8 Run the application. Project Settings Checklist for Microsoft Visual C/C++ DOS .EXE Programs Dialog Box or Command Project Options

For This Variable Project Type

Select This Setting MS-DOS application

Use Foundation Classes uncheck

Code Generation CPU Floating Point Calls Disable stack checking

8086/8088 Use Emulator check

Memory Model Model Segment

Large SS == DS

Linker Options

Libraries oldnames, llibce, IMT24LIB

Directories

Include Files Path

\INTERMEC\IMT24\INCLUDE must be listed first, followed by \MSVC\INCLUDE

Library Files Path

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

Compiler Options

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++ or Borland Turbo C++ environment. Your .MAK file must set the correct compile options for the application to run on the Trakker Antares terminals. CFLAGS Settings Required for a Successful Compile Setting /G0

Trakker Antares PSK Reference Manual

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

29

Page 50

Chapter 3, Building Applications

CFLAGS Settings Required for a Successful Compile (continued) Setting /AL

Meaning Use large memory model. This switch is required for all applications.

/FPa

Use alternate math for the floating point calls. This switch is required to compile .BIN applications.

/Gs

Disables stack checking. This switch is required to compile DOS .EXE applications.

These examples show the correct settings to build your own .BIN program from a command line. The bold settings represent the CFLAGS settings that are required. 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

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

= $(OBJ:.c=.obj)

H

= IMT24.h

$(OBJ):$(H) MAPFILE LFLAGS

= proj.map = /NOLOGO /NOI /STACK:5120 /ONERROR:NOEXE /CO proj_DEP = c:\intermec\imt24\include\imstdio.h \ c:\intermec\imt24\include\IMT24.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

30

Trakker Antares PSK Reference Manual

Page 51

Chapter 3, Building Applications

TMP.CMD TEST1.OBJ + BIG0.OBJ test1.EXE test1.map c:\intermec\imt24\lib\+ c:\msvc\lib\+ c:\msvc\mfc\lib\+ oldnames llibca IMT24

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

Downloading Applications You can download applications and files to a terminal using either the serial port or network communications. The advantage to downloading files using network communications (RF or Ethernet) is that you can download multiple files to one or more terminals.

Using the Serial Port to Transfer Applications and Files The PSK includes a FileCopy utility for transferring files and applications from your PC to a terminal connected to your PC serial port. FileCopy was installed on your PC when you ran the PSK setup program. The FileCopy online help contains detailed information about using the utility. To download an application or other file 1 Connect the Trakker Antares terminal to your PC. For more information, refer to your terminal user’s manual. 2 Start the FileCopy utility. 3 Select the COM Port Setup tab and the Serial communications Setup tab to verify that the settings for your PC match the settings for the terminal. Any changes you make in these tabs are automatically saved for you. Note: Use the TRAKKER Antares 2400 Menu System to view or configure the communications settings on the terminal. 4 Select the FileCopy tab and type your filename information. The Trakker Antares terminals support drives C, D (248X only), E, and G. Do not include a “\” in the Trakker Antares filename. 5 (.BIN applications only) Select the Convert.EXE check box.

Trakker Antares PSK Reference Manual

31

Page 52

Chapter 3, Building Applications

6 (.BIN applications only) If you want to run the application on the terminal immediately after it is downloaded, select the Run Program check box. 7 Click Download to copy the file from the PC to the terminal. 8 Click Exit to close the FileCopy utility.

Using the DCS 300 to Download Applications You use RF or Ethernet communications to download applications and files from the DCS 300 to terminals running UDP Plus or from the host to terminals running TCP/IP. This section provides a brief overview of how to use the DCS 300 to download applications and files. For detailed instructions, see your terminal user’s manual or your DCS 300 User’s Manual (P/N 067296). Before you start, make sure the terminal is communicating with the DCS 300. For help downloading applications from your host, see your host user’s manual. To download applications and files using RF or Ethernet communications 1 Copy the applications and files to the DCS 300. 2 Use the Configure Download Server option to download the applications and files to the terminal. 3 On the terminal, enter the TRAKKER Antares 2400 Menu System. 4 Use the System Menu to load and run an application.

32

Trakker Antares PSK Reference Manual

Page 53

4

Converting Trakker Antares and JANUS Applications

This chapter describes the differences between the Trakker Antares® PSK and JANUS® PSK libraries and explains how to convert your applications from one environment to the other. This chapter covers these topics: • Differences between Trakker Antares PSK functions and JANUS PSK functions • Creating compatible applications • Converting applications: Trakker Antares to JANUS • Converting applications: JANUS to Trakker Antares

Trakker Antares PSK Reference Manual

33

Page 54

Chapter 4, Converting Trakker Antares and JANUS Applications

Differences Between Trakker Antares PSK Functions and JANUS PSK Functions Some of the features and functions from the JANUS PSK do not work with Trakker Antares terminals. The Trakker Antares PSK supports either Microsoft® C/C++ or Borland® C/C++. The JANUS PSK supports Microsoft C/C++, Borland 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 requires minor changes to run on a JANUS device. However, an application written for a JANUS device can require major changes to work properly on a Trakker Antares terminal. You can handle the differences between the JANUS PSK and Trakker Antares 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 incompatible functions. Use an #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. Note: This chapter refers to the Trakker Antares PSK as the “Trakker PSK.”

Creating Compatible Applications To create applications that run on both JANUS devices and Trakker Antares terminals, 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. Note: Be sure that when you compile your program you set the appropriate options for the destination. JANUS PSK make files use the 80386 compiler option. Trakker PSK make files use the 8086/8088 34

Trakker Antares PSK Reference Manual