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 17 of 26

Trakker Antares 248X Stationary Terminal User's Manual, pages 161 to 170

Pages 161 to 170 of 257

The original document is the PDF (1.9 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 2486

Page 161

nugget

39 Operating the Terminal in a Network

4

CLIENT.CPP Sample Application for a TCP/IP Direct Connect Network #include <windows.h> #include <stdio.h> #include "Utils.h" // our application uses a fixed port number const unsigned short SERVER_PORT = 6000; const unsigned short CLIENT_PORT = 6001; // we will default to the local host machine // unless argv[1] has a hostname const char SERVER_HOSTNAME[] = "ncm"; int main(int argc, char *argv[]) { // turn on the socket library for this process WSADATA wsad; int error = WSAStartup(MAKEWORD(1,1), &wsad); if (error != 0) ErrorMessage("WSAStartup", WSAGetLastError()); // create an unitialized connection-oriented socket SOCKET connection; connection = socket(PF_INET, SOCK_DGRAM, 0); if (connection == INVALID_SOCKET) ErrorMessage("socket", WSAGetLastError()); // lookup the IP address of the requested host HOSTENT *phostent = gethostbyname(argc == 2 ? argv[1] : SERVER_HOSTNAME); if (phostent == 0) ErrorMessage("gethostbyname", WSAGetLastError()); // define a SOCKADDR to contain the IP address of the // server and the port number of our application SOCKADDR_IN serverAddress; memset(&serverAddress, 0, sizeof(serverAddress)); serverAddress.sin_family = PF_INET; serverAddress.sin_port = htons(SERVER_PORT); memcpy(&serverAddress.sin_addr, phostent->h_addr_list[0], phostent->h_length); // Bind a well known port of 6000 to the socket SOCKADDR_IN clientAddress; memset(&clientAddress, 0, sizeof(clientAddress)); clientAddress.sin_family = PF_INET; clientAddress.sin_port = htons(CLIENT_PORT); clientAddress.sin_addr.s_addr = htonl(INADDR_ANY); if(!(bind(connection, (LPSOCKADDR)&clientAddress, sizeof(clientAddress)) ==0)) { ErrorMessage("bind", WSAGetLastError()); }

4-31

Page 162

TRAKKER Antares 248X Stationary Terminal User’s Manual nugget 39

CLIENT.CPP Sample Application for a TCP/IP Direct Connect Network (continued) // attempt to connect to the server error = connect(connection, (const SOCKADDR *)&serverAddress, sizeof(serverAddress)); if (error != 0) ErrorMessage("connect", WSAGetLastError()); // check the local name for the socket SOCKADDR_IN localName; memset(&localName, 0, sizeof(localName)); int localNameLength = sizeof(localName); error = getsockname(connection, (LPSOCKADDR)&localName, &localNameLength); // run the user-interface char sz[1024]; char rz[1024]; BOOL bConnectionAlive = TRUE; printf("> "); int Scount, Rcount; int cbRecv, cbSend; Scount = Rcount = 0; int cbLen, rcLen; unsigned char *psend = (unsigned char *)sz; // continue while not EOF on the console and the connection is alive while (bConnectionAlive) { // send the string entered by the user printf("Enter Command:\n"); printf("> "); gets(sz); if(sz[0] != 'q') { cbLen = strlen(sz); cbSend = send(connection, (const char *)psend, cbLen, 0); if (cbSend < 0) { Scount++; printf("send failed %d\n", Scount); bConnectionAlive = FALSE; ErrorMessage("send", WSAGetLastError()); } Sleep(2000); // receive the converted string from the server memset(&rz, 0, sizeof(rz)); rcLen = sizeof(rz); cbRecv = recv(connection, rz, rcLen, 0); if (cbRecv < 0) {

4-32

Page 163

nugget

39 Operating the Terminal in a Network

4

CLIENT.CPP Sample Application for a TCP/IP Direct Connect Network (continued) Rcount++; printf("receive failed %d\n", Rcount); ErrorMessage("receive", WSAGetLastError()); bConnectionAlive = FALSE; } // printf the converted string printf("response:%s\n",rz); printf("\n> "); Sleep(1000); } else bConnectionAlive = FALSE; } // release the resources held by the socket error = closesocket(connection); if (error != 0) ErrorMessage("closesocket", WSAGetLastError()); // release the resources held by the socket library error = WSACleanup(); if (error != 0) ErrorMessage("WSACleanup", WSAGetLastError()); return 0; }

UTILS.H Utility (Used by CLIENT.CPP) #include <windows.h> inline void ErrorMessage(LPCTSTR szFn, DWORD dwError = GetLastError()) { TCHAR szTitle[1024]; TCHAR szPrompt[1024]; BOOL bRet = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, dwError, 0, szPrompt, sizeof(szPrompt), 0); if (!bRet) lstrcpy(szPrompt, __TEXT("Unknown Error")); wsprintf(szTitle, __TEXT("%s failed with error code (0x%x)!"), szFn, dwError); int id = MessageBox(HWND_DESKTOP, szPrompt, szTitle, MB_ABORTRETRYIGNORE|MB_SETFOREGROUND); if (id != IDIGNORE) ExitProcess(0); }

4-33

Page 164

TRAKKER Antares 248X Stationary Terminal User’s Manual nugget 39

About Network Connectivity and Protocols The TRAKKER Antares terminals are data collection terminals with network support. The T2480, T2481, T2485, and T2486 communicate with a host computer or other serial device through the terminal’s serial ports. The T2480 and T2481 with an Ethernet card installed communicate with a host directly through the Ethernet network. The T2485 and T2486 also communicate with a host in the 2.4 GHz RF network either through the Model 200 Controller or directly through the access points. The access point acts as a bridge between the Ethernet or token ring network and the wireless 2.4 GHz RF network. In a UDP Plus network, the terminal communicates through the Model 200 Controller to a host on an Ethernet, token ring, twinaxial, coaxial, or SDLC network. In a TCP/IP network, the terminal communicates to the host on an Ethernet or token ring network. The communications protocol stack for the TRAKKER Antares terminal is developed using the Open Systems Interconnection (OSI) seven layer model. The illustration on the next page shows how the 2.4 GHz RF network, the Ethernet network, and the serial ports map into the OSI model. The terminal applications including terminal emulation and screen mapping are on top of the protocol stack. Intermec provides a terminal communications API (application program interface) to interface to the protocol stack. The API provides a common interface to these Intermec value-added protocols: •

Terminal Message Format (TMF) is an Intermec proprietary protocol that is used to route data and network management messages between applications on the terminal and peer tasks on the controller or host.

•

UDP Plus is an Intermec protocol built on top of the User Datagram Protocol (UDP). It maximizes the performance of wireless (RF) and Ethernet networks and provides robust data communications.

•

Trivial File Transfer Protocol (TFTP) allows efficient file exchange between the terminal and the Model 200 Controller or host.

•

Configurable Serial Port (CSP) protocol allows efficient file exchange between the T248X and the host through RS-232 and RS-232/422/485 serial communications. The terminal uses either the XMODEM or YMODEM protocol to transfer files via reader commands.

•

Network management provides network access to the terminal configuration, status, and statistics. Network management uses the Terminal Message Format to receive and send messages.

The remaining layers in the protocol stack are a series of standard protocols that interface with the drivers and hardware needed to support the 2.4 GHz RF network, the Ethernet network, and serial communications.

4-34

Page 165

4

39 Operating the Terminal in a Network nugget

TRAKKER Antares Terminal Protocol Stack and the OSI Model ayers

OSI L ns licatio ares app 248X

R Ant

KE TRAK ation ns additio I and P A s on unicati Comm ssage al Me Termin at (TMF) Form lus

UDP P l File Trivia rotocol P r fe Trans FTP) (T rk Netwo nt e m urable anage Configl port m seria col proto

Applic n ntatio

Prese n

Sessio port

Trans rk

Netwo

UDP TCP ink

P, and

IP, AR

Hz RF 2.4 G ol driver c to pro

Data L

ICMP et Ethern river d l o protoc adio

Hz r 2.4 G d et car

Ethern net

Ether rk Netwo

Serial port driver Serial port al

Physic

0

U.09

248X

Wiredk r Netwo k etwor

RF N

4-35

Page 166

TRAKKER Antares 248X Stationary Terminal User’s Manual nugget 39 The TRAKKER Antares 248X terminals use these protocols: Layer

Protocol

Description

Physical

2.4 GHz radio

Provides spread spectrum radio signal control.

Ethernet card

Provides Ethernet communications.

Serial Port

Provides RS-232 serial communications.

2.4 GHz RF or Ethernet protocol driver

Provides RF or Ethernet media access control. The default hardwired media access control (MAC) protocol used with TCP/IP supports the Ethernet II standard.

Serial port driver

Provides RS-232 (COM1 and COM4) or RS-232/422/485 (COM2) serial communications control that uses CSP and the standard XMODEM or YMODEM protocol for data transfer.

IP, ARP, and ICMP

The Internet Protocol (IP) complies with the standard outlined in RFC 791.

Data Link

Network

The Address Resolution Protocol (ARP) complies with the standard outlined in RFC 826. The Internet Control Message Protocol (ICMP) complies with the standard outlined in RFC 826. Transport

Session and Presentation

UDP

The User Datagram Protocol (UDP) complies with the standard outlined in RFC 768.

TCP

Transmission Control Protocol (TCP) complies with the standard outlined in RFC 793.

UDP Plus

UDP Plus is an Intermec proprietary session layer protocol built on UDP. The UDP Plus session layer provides these services: • • • • • •

Presentation and Application

4-36 guaranteed delivery duplicated message removal link connection and status management network error recovery congestion control device error detection

TFTP

Trivial File Transfer Protocol (TFTP) allows efficient file exchange between the terminal and the Model 200 Controller or host. TFTP complies with the standard outlined in RFC 1350.

TMF

Terminal Message Format is an Intermec proprietary protocol that is used to route data, configuration, and network management messages between applications on the terminal and peer tasks on the controller or host.

Page 167

5 Using Custom Applications and Screen Mapping

Page 168

This page is a scan with no text; see it in the PDF.

Page 169

nugget

39 Using Custom Applications and Screen Mapping

5

This chapter introduces the TRAKKER Antares 248X programmable terminals and explains how to download and run applications on the terminals. You will also find instructions on how to use the screen mapping application.

How to Download and Run Applications Here’s a brief summary of the steps you follow to download applications and files to the programmable TRAKKER Antares terminals. To learn more about the programmable features, start with the next section, “About the TRAKKER Antares Programmable Terminals.” Use a serial port to download applications and files to the T248X 1. Create your applications using the TRAKKER Antares Programmer’s Software Kit (PSK) or EZBuilder. For help, see page 5-6. 2. Convert each application to a binary file using the PSK utility EXE2ABS.EXE. For help, see page 5-8. Or, use the EZBuilder option to convert each application to a binary file. 3. Connect the T248X to the development PC or host computer using a serial port. For help, see Chapter 2, “Installing the Terminal.” 4. Use the FileCopy utility to download applications and files to the T248X. For help, see page 5-9. 5. Use the System Menu in the TRAKKER Antares 2400 Menu System to load and run an application. For help, see page 5-17. Use the Model 200 Controller to download applications and files to the T248X 1. Create your applications using the TRAKKER Antares PSK or EZBuilder. For help, see page 5-6. 2. Convert each application to a binary file using the PSK utility EXE2ABS.EXE. For help, see page 5-8. Or, use the EZBuilder option to convert each application to a binary file. 3. Copy the applications and files to the Model 200 Controller. For help, see page 5-12. 4. Use the Download Server feature on the Model 200 Controller to download applications and files to the T248X. For help, see page 5-14. 5. Use the System Menu in the TRAKKER Antares 2400 Menu System to load and run an application. For help, see page 5-17.

5-3

Page 170

TRAKKER Antares 248X Stationary Terminal User’s Manual nugget 39 Use a host application to download applications and files to the T248X 1. Create your applications using the TRAKKER Antares PSK or EZBuilder. For help, see page 5-6. 2. Convert each application to a binary file using the PSK utility EXE2ABS.EXE. For help, see page 5-8. Or, use the EZBuilder option to convert each application to a binary file. 3. Copy the applications and files to the host. 4. Write an application for the host that can communicate with the T248X directly via an access point or through the Ethernet network. Use the host application to download applications and files to the T248X. For help, see “Transferring Files in a TCP/IP Direct Connect Network” in Chapter 4. Note: The host must be running a TFTP server. 5. Use the System Menu in the TRAKKER Antares 2400 Menu System to load and run an application. For help, see page 5-17. Or, use the host application to send the Run Program command.

About the TRAKKER Antares Programmable Terminals The TRAKKER Antares terminals ship loaded with a terminal emulation application, a screen mapping application, or a sample application. You can develop your own data collection application for the T248X and then download the application to the terminal. You download files to the T2480, T2481, T2485, or T2486 using these methods: T2480 and T2481 Without Ethernet You can download applications and files from a host computer to one terminal that is directly connected through one of the serial ports. T2480 and T2481 With Ethernet You can download applications and files from the Model 200 Controller (UDP Plus protocol) or host (TCP/IP protocol) to one or more terminals. You can also download applications and files to one T2480 or T2481 using a serial port. T2485 and T2486 You can download applications and files from the Model 200 Controller (UDP Plus protocol) or host (TCP/IP protocol) to one or more terminals using the 2.4 GHz RF network. You can also download applications and files to one T2485 or T2486 using a serial port. The next table lists specifications and technical information you need to know to develop applications for the T248X terminals.

5-4