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 10 of 12

EZBuilder Tutorial, pages 91 to 100

Pages 91 to 100 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 91

Using EZBuilder Features

A

/* convert sum back to string _ltoa(field1long, fieldres, 16);

*/

} void main() { char sum_str[20]; /* temp holding place for result */ im_clear_screen(); tohex("18", sum_str); }

When the application is built and run on the Simulator, it produces the correct output so we know that function works.

Building a Static Library From the Function A library is just a collection of functions. To build a function library, you need to remove the main program statements. #include <stdlib.h> #include "imt24lib.h" void tohex(char *field1, /* pointer to first EZBuilder field */ char *fieldres /* pointer to the EZBuilder field to*/ /* place the results */ ) { long field1long; /* long integer version of first field */ field1long = atol(field1);

/* convert first to long

/* convert sum back to string _ltoa(field1long, fieldres, 16);

*/ */

}

To build a static library 1. In the Microsoft Visual C/C++ 1.5X Options menu, choose Project. 2. Set Project Type to Static library (.LIB).

A-7

Page 92

EZBuilder Tutorial

3. Set the following compiler options. CPU 8086 / 8088* Floating Point Calls

Alternate Math

4. Choose Build from the Project menu, build the library, and copy it to your working directory.

Placing Function Calls in the EZBuilder Application Next, you need to place a call to the new function in the User Function activity in the On Entry tab in the Object Manager.

The complete entry is shown below: (1);tohex(Screen0_Field0_F,Screen0_Field2_F);

(1); tohex

Required in EZBuilder if the function does not return a value. Hex conversion function.

Screen0_Field0_F The name of the input field. Screen0_Field2_F The name of the field that displays the value in hex.

Configuring EZBuilder to Link With Your Library Next, you need to configure EZBuilder to link with your library. To configure EZBuilder to link with your library 1. Open EZBuilder. 2. Choose Options from the Build menu. 3. In the Include Libraries field, add the name of the library you created. The library must be included in the library subdirectory.

A-8

Page 93

Using EZBuilder Features

A

4. Choose Build from the Build menu. If the application has no errors, run it in the Simulator. Your screen should be similar to the previous example. Note: Click the Includes tab and add any header (.h) files you created.

Parsing a Single Scanned Label Into Multiple Fields This section describes how to set up an EZBuilder application to scan a single bar code with multiple fields and parse the multiple fields in the EZBuilder application. This approach assumes that each field within the bar code is a fixed length or is delineated by a character. The EZBuilder application created for this example is on the EZBuilder CD-ROM with the filename PARSE.IMP. To parse a single label into multiple fields 1. Create an input field for the scanned bar code that is at least the length of the bar code. 2. Create the required number of input fields to receive each data field. 3. Create a transaction to move the contents of the first field into each of the other fields. 4. Click the On Exit tab of the first field and set the Do Transaction action to call the transaction you created. To create an input field for the scanned bar code 1. With the desired screen displayed, choose Add Field from the File menu. 2. Set the field size and type to the desired settings. This field should be at least as long as the bar code. You can set the field to be either visible or invisible depending on your application needs.

A-9

Page 94

EZBuilder Tutorial

To create the required number of input fields to receive each field of data 1. With the desired screen displayed, create the fields that will contain the scanned data. 2. Set the field size and type to the desired settings. These fields can be on the same screen or other screens. They can also be visible or invisible depending on your application needs.

To create a transaction to move the contents of the first field to the other fields 1. Set the Transfer Direction property to From Screen0.Field0 (source field name). 2. Set the Delineation property to Length or Delimiter depending on your requirements. 3. If you use Delimiter, set the Delimiter property to the desired character (this character must appear in the bar code to separate each field). 4. In the Transaction Editor, copy each of the destination fields from the Available Fields list to the Transaction Fields list by double-clicking each destination field. To set the Do Transaction to call the transaction you created 1. Go back to the screen with the first field on it, and double-click the first field. 2. Click the On Exit tab.

A-10

Page 95

Using EZBuilder Features

A

3. In the Do Transaction field, enter the name of the transaction you just created, Tran0.

4. Choose Build from the Build menu. 5. Choose Trakker Simulator from the Tools menu, and run the application. When data is scanned or typed into the first field, it is parsed into the appropriate fields and the cursor returns to the original field.

Scrolling Through a File and Selecting a Record This section describes how to read a file into a scrolling field and allow the user to select a particular record. You can find this example application on the EZBuilder CDROM with the filename SCRLFILE.IMP. To read a file and select a record 1. On a given screen, choose Add Scrolling Selection from the File menu. The Scrolling Selection field is added to the screen. Place it in the desired location and adjust the size. Only the height can be adjusted.

A-11

Page 96

EZBuilder Tutorial

2. Click the Properties tab to set the following properties: Selection Key Exit

This key makes the selection.

This key causes the cursor to exit the Scrolling Selection Field.

Navigation Choice This is where the cursor moves upon exit of the Scrolling Selection Field. Highlight Attribute This is the highlight bar that shows which record is being pointed to currently. Typically, you will set this attribute to Inverse.

3. Click the On Entry tab. 4. Enter the name of your data file in Load From File. 5. Click the On Selection tab. You may move the contents or the index of the selected record to another field. Set the following actions: Move Selection To Specifies the field that will hold the selected record. It can be on the same screen or another screen. Move Index To Specifies the field that will hold the index of the selected record. This field must be a numeric field. It can be on the same screen or another screen. Here is the output from this example:

A-12

Page 97

Using EZBuilder Features

A

Clearing All Fields on a Screen at One Time This section describes one way of clearing the contents of all input fields on a screen. In this example, when the cursor leaves the last field and enters the first field again, we would like all fields to be empty. You can set each field to clear on entry; however, this only clears the field that the cursor is in. After the first round of entries the cursor is back in the first field which is clear, but the rest of the fields still contain their data. When the last field is exited, we want all fields on the screen to be cleared and the cursor placed in the first field. You can find this example application on the EZBuilder CD-ROM with the filename CLRFLDS2.IMP.

Old Screen

Screen With Fields Cleared

To clear fields on a screen 1. Choose Add Field from the File menu. 2. Set the following properties for this field. Display Attribute

Normal.

Visible False.

A-13

Page 98

EZBuilder Tutorial

Display Only True (this is so that the cursor will not navigate to this field). Length

Must be at least as long as the longest field on the screen.

3. Choose New Transaction from the File menu. 4. Click Transfer Direction, and then click the field button. The Transaction Direction Editor dialog box appears. 5. Set the following parameters: Direction box

Click Transaction From.

Source/Destination box field.

Click Field, and then choose the name of the hidden

6. Click OK. 7. Copy each of the input fields from the Available Fields list to the Transaction Fields list by double-clicking each input field. Note: Do not include the hidden field in the Transaction Fields list.

8. Activate the screen of fields in your viewport. 9. Double-click the last input field (not the hidden field) on the screen.

A-14

Page 99

Using EZBuilder Features

A

10. Click the On Exit tab. 11. Set Do Transaction to the transaction you just created. Now you can build and test the application.

Transferring Data Between a TCP/IP Server and a Trakker Antares TCP/IP Terminal Direct TCP is the way a client application running on a Trakker Antares terminal with TCP/IP can open a direct TCP/IP socket with a host server application without using the DCS 30X. You can accomplish this by transmitting data to the network port and receiving data from the network port. The following example describes an EZBuilder application that transmits data to an echo server and receives the response. You can find this example application on the EZBuilder CD-ROM with the filename EZDIRTCP.IMP. To build an application to transmit data to an echo server and receive a response 1. On a given screen, add two fields, one for outgoing data (Field0) and one for incoming data (Field1).

2. Add a new transaction (Tran0). 3. Set Transfer Direction to To Network. 4. In the Transaction Editor, copy Field0 (first field) from the Available Fields list to the Transaction Fields List. 5. Add another transaction (Tran1). 6. Set Transfer Direction to From Network.

A-15

Page 100

EZBuilder Tutorial

7. In the Transaction Editor, copy Field1 (second field) from the Source Fields list to the Transaction Fields List. 8. Go to Tran0 (first transaction) and click the Success tab. 9. Set Do Transaction to Tran1 (second transaction).

10. Go to Field0 (first field), and click the On Exit tab. 11. Click the Validation tab. 12. Set Do Transaction to Tran0 (first transaction). When you exit Field0, Trans0 is called to move the data from Field0 to the network port. If transmission was successful, then Trans1 is called to move data from the network port to Field1 as shown below.

A-16