Rockwell Automation 2727-MRSDK User Manual

MobileView Terminals Software Development Kit
2727-MRSDK1
User Manual

Important User Information

Solid state equipment has operational characteristics differing from those of electromechanical equipment. Safety Guidelines for the Application, Installation and Maintenance of Solid State Controls (Publication SGI-1.1 av ailable from your local Rockwell Automation sales office or online at http://www.ab.com/manuals/gi) describes some important differences between solid state equipment and hard-wired electromechanical devices. Because of this difference, and also because of the wide variety of uses for solid state equipment, all persons responsible for applying this equipment must satisfy themselves that each intended application of this equipment is acceptable.
In no event will Rockwell Automation, Inc. be responsible or liable for indirect or consequential damages resulting from the use or application of this equipment.
The examples and diagrams in this manual are included solely for illustrative purposes. Because of the many variables and requirements associated with any particular installation, Rockwell Automation, Inc. cannot assume responsibility or liability for actual use based on the examples and diagrams.
No patent liability is assumed by Rockwell Automation, Inc. with respect to use of information, circuits, equipment, or software described in this manual.
Reproduction of the contents of this manual, in whole or in part, without written permission of Rockwell Automation, Inc. is prohibited.
Throughout this manual we use notes to make you aware of safety considerations.
WARNING
IMPORTANT
ATTENTION
SHOCK HAZARD
BURN HAZARD
Identifies information about practices or circumstances that can cause an explosion in a hazardous environment, which may lead to personal injury or death, property damage, or economic loss.
Identifies information that is critical for successful application and understanding of the product.
Identifies information about practices or circumstances that can lead to personal injury or death, property damage, or economic loss. Attentions help you:
identify a hazard
avoid a hazard
recognize the consequence
Labels may be located on or inside the drive to alert people that dangerous voltage may be present.
Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.

Table of Contents

Preface
Introduction to the MobileView SDK
Developing CE Drivers and Applications
MobileView Terminals SDK
Using this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . Preface-3
Who Should Use This Manual . . . . . . . . . . . . . . . . . . Preface-3
Purpose of this Manual . . . . . . . . . . . . . . . . . . . . . . . Preface-3
Contents of this Manual. . . . . . . . . . . . . . . . . . . . . . . Preface-3
Manual Conventions . . . . . . . . . . . . . . . . . . . . . . . . . Preface-4
Allen-Bradley Support . . . . . . . . . . . . . . . . . . . . . . . . Preface-4
Local Product Support . . . . . . . . . . . . . . . . . . . . . . . . Preface-4
Technical Product Assistance . . . . . . . . . . . . . . . . . . . Preface-4
Chapter 1
Hardware Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Software Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Chapter 2
General Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Setting Up the Development System . . . . . . . . . . . . . . . . . 2-3
Chapter 3
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
SDK (Software Development Kit) for MobileView Terminals
Chapter 4
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Common Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Start and Close Functions . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Configuration Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Functions for Reading the Configuration . . . . . . . . . . . . . . 4-5
Peripheral Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
Other Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
Functions for Subscribing Events . . . . . . . . . . . . . . . . . . . . 4-18
Index
1 Publication 2727-UM004B-EN-P - February 2004
Table of Contents 2
Publication 2727-UM004B-EN-P - February 2004

Preface

Using this Manual

Who Should Use This Manual

Purpose of this Manual

Read this preface to familiarize yourself with the rest of the manual. The preface covers the following topics:
who should use this manual
the purpose of the manual
contents of the manual
conventions used in this manual
Allen-Bradley support
Use this manual if you are responsible for developing application software to run on the MobileView Terminal.
This manual is a user guide for the Software Development Kit for the MobileView Terminal. It gives an overview of the system and provides detailed information about the contents of the software development kit.

Contents of this Manual

Chapter Title Contents
Preface Describes the purpose, background,
and scope of this manual. Also specifies the intended audience.
1 Introduction to the
MobileView SDK
2 Developing CE Drivers and
Applications
3 MobileView Terminals SDK Provides an overview of the
4 SDK (Software Development
Kit) for MobileView Terminals
Provides an overview of the MobileView Terminals and describes the hardware and operating system software.
Provides general guidelines for programmers. Provides detailed procedures for setting up the development system and installing the MobileView SDK.
MobileView SDK.
Provides detailed descriptions of the MobileView functions.
1 Publication 2727-UM004B-EN-P - February 2004
Preface 2

Manual Conventions

Allen-Bradley Support

Local Product Support

The following conventions are used throughout this manual:
Bulleted lists such as this one provide information, not
procedural steps.
Numbered lists provide sequential steps or hierarchical
information.
Allen-Bradley offers support services worldwide, with over 75 Sales/Support Offices, 512 authorized Distributors and 260 authorized Systems Integrators located throughout the United States alone, plus Allen-Bradley representatives in every major country in the world.
Contact your local Allen-Bradley representative for:
sales and order support
product technical training
warranty support
support service agreements

Technical Product Assistance

If you need to contact Allen-Bradley for technical assistance, please review the information in the System Troubleshooting chapter first. Then call your local Allen-Bradley representative or contact Allen-Bradley technical support at (440) 646-5800.
For additional product information and a description of the technical services available, visit the Rockwell Automation/Allen-Bradley Internet site at http://www.ab.com.
Publication 2727-UM004B-EN-P - February 2004

Hardware Architecture

TouchScreen
Analog resistive
Buzzer
Override Potentiometer
Electronic Handwheel
4-wire
Analog I/O UCB 1200
Main PCB
Keyboard Electronic

Introduction to the MobileView SDK

MobileView PC2
GPIO Serial por t 3
Serialport 2
PCMCIASlot 1x Type I-III
MobileView PC1
PCMCIA Buffer + Power Management
Address & Data
Buffer
StrongARM 1110 206 MHz
Serial port 1
I²C
Ethernet Controller SMSC 91C96
Serial Port
DEBUG
CommunicationPCB
e.g: RS422/RS485
CPLD
GPIO GPIO
32MB or 64MB
MT750 & G750
Block Diagram
backlight inverter
FLASH
SDRAM 16MB
or 64MB
Electronic Enabeling device
Chapter
Color DSTN Display
VGA
640x480 pixels
Enabeling device left
Enab elingdev i c erigh t
Emergency Push Button
1
Keypad rightside
Main Cable
PCB Connector
MobileView SUB
IrD A
Push Buttons & KeySwitches
Keypad left side
CPU
The system processor is an Intel StrongARM SA-1110 Microprocessor, a device optimized for meeting portable and embedded application requirements. The SA-1110 incorporates a 32-bit StrongARM RISC processor capable of running at up to 206 MHz. The SA-1110 has a large instruction and data cache, memory-management unit (MMU), and read/write buffers.
The SA-1110 memory bus interfaces to many device types including synchronous DRAM (SDRAM), and SRAM-like variable latency I/O
1 Publication 2727-UM004B-EN-P - February 2004
1-2 Introduction to the MobileView SDK
devices with a shared data ready signal. In addition, the SA-1110 provides system support logic, multiple serial communication channels, a color/gray scale LCD controller, PCMCIA support, and general-purpose I/O ports.
Memory Devices
Flash Device
There is a flash part (32 MB to 64 MB) that emulates a disk device. The flash is partitioned to several logical storage areas. One partition provides non-volatile storage for Windows CE operating system image. Another partition is used to store the backup of the registry. One partition is used for the boot code. The last partition supports a FAT 16 (DOS compatible) file system, in which programs and data can be stored.
DRAM
The MT/G750 models have two possible memory configurations: 16 MB DRAM/32 MB Flash and 64 MB DRAM/64 MB Flash.
The Operating System uses part of the RAM for a RAMDISK and the other part for normal system memory. The RAMDISK portion is known as the Object Store and provides specialized storage for the Windows CE Registry and Windows CE system databases. The Windows CE Control Panel System Properties tool has a slider control that allows a user to determine how the RAM is allocated between RAMDISK Storage and system memory. The slider control is factory set for a 50/50 split. Application programs can control RAM allocation with the Windows CE system call SetSystemMemoryDivision (see Microsoft’s documentation of the CE API for details).
Interfaces
Real Time Clock
Publication 2727-UM004B-EN-P - February 2004
The SA-1110 uses on-chip oscillators and PLLs for clock generation. The real-time clock and trim logic run off the 32.768 kHz crystal and provide accuracy of 5 seconds/month. The real-time clock is not battery backed and will reset when power is cycled.
Introduction to the MobileView SDK 1-3
Keypad
The MobileView terminals have a numeric keypad and cursor control keys. This includes 12 function keys.
Extended software support for the bezel keypad is provided with the Windows CE operating system in the form of a keypad handler DLL. The keypad handler intercepts and operates on codes produced by the keypad driver before passing them to the application with current focus.
Touch Screen
An integral, resistive analog touch screen with a serial controller provides mouse-like operator input. The touch screen is factory installed and associated with an integral display.
On-Board Ethernet
An on-board Ethernet controller provides 10BaseT, half-duplex communication support. The data communication for these interfaces takes place via the RJ45 Ethernet connector S4 in the cable entrance area.
The following interface parameters are defined and cannot be changed:
10 Mbaud
TCP/IP protocol
The on-board Ethernet interface is configured under Windows CE as follows:
Start - Settings - Control Panel - Network - Network Configurations
PCMCIA Slots
A PCMCIA slot connector supports 1 Type II PC Card. The PC Cards can be memory or I/O devices.

Software Architecture

Windows CE OS
The MobileView is provided with Windows CE Version 4.x with the latest service packs.
The system software includes the following components:
Publication 2727-UM004B-EN-P - February 2004
1-4 Introduction to the MobileView SDK
Hardware Initialization and Boot Loader, situated in the flash
Windows CE Kernel with adaptations (Hardware Adaptation
Layer customized for the MobileView hardware, Built-in ISRs), situated in the boot image stored in the operating system partition of the Flash Storage
Windows CE Default Registry, which is part of the boot image.
(A persistent registry, containing information relative to specific configurations, is maintained in the file system and merged with the default registry at boot.)
Windows CE Modules and Device Drivers (File system
support,...), implemented as part of the boot image or as files (dlls, exes, etc.) stored in the FAT16 partition of the Flash Storage
GUI Desktop Shell, implemented
Control Panel and System Configuration/View Tools
Boot Sequence
The boot code in the Flash Storage gets control of the microprocessor at power-on, initializes the hardware, performs power-on self-tests (POST), and moves the compressed Windows CE operating system image from the boot partition of the Flash Storage persistent storage device into DRAM. Several seconds are required for the decompression and copy operation. Finally, the boot loader jumps to the start address of the Windows CE image and control passes to the Windows CE operating system. Windows CE then loads drivers, including the driver for the Flash Storage FAT16 file system (on the “Flash Storage Space” partition), restores the registry, establishes the video modes, and finally loads the start-up applications into memory and runs them.
Load of Compressed Operating System
The boot code reads the compressed operating system image from the Flash Storage operating system partition, decompresses it and loads it into memory. (It loads the executable operating system code into program memory and a default system registry into the RAMDISK section of memory.) Control then passes to the operating system image in memory.
Publication 2727-UM004B-EN-P - February 2004
“Cold Boot”
The operating system begins a “cold boot” by loading the driver for the FAT file system on the Flash Storage.
Introduction to the MobileView SDK 1-5
The operating system then attempts to find the primary persistent registry file. If this file is not present, it attempts to find the backup persistent registry file. If no persistent registry file is found, system boot continues with the default registry already in memory.
If a persistent registry file is found, the system merges the default operating system registry and the saved persistent registry; saved persistent registry takes precedence.
“Warm Boot”
After the registry merge, a “warm boot” is begun. Control passes to the operating system kernel, which can now use the registry image to initialize various subsystems. The file system drivers, the graphical subsystem drivers, serial, network, and other device drivers are loaded and initialized.
The Windows CE Registry
The Windows CE Registry contains application and system configuration data. The Control Panel provides the user interfaces for managing the system settings that are configurable by the user. Applications access the Registry via the Win32 API.
The default Registry resides in the operating system image in the flash device. During runtime, the Registry is loaded into and resides in RAM in the Object Store (RAMDISK).
When the system is powered-on, the registry is restored from Flash Memory to DRAM during a “cold boot”.
The registry is only saved by manual operations. The user can execute the "\windows\regflush.exe" program or call the FlushRegistry() command from an application.
The operating system boot process is responsible for merging the default operating system Registry keys with the keys from the persistent Registry. If the same keys exist, preference is given to the persistent registry file. A few default keys are exceptions to this rule and are bypassed during the merge; e.g. the O/S version number is acquired from the O/S image.
The process of merging default and persistent registry information allows operating system upgrades to add new registry keys and values and have these be used in addition to any saved registry state. Since the saved registry information has precedence, users’ saved registry
Publication 2727-UM004B-EN-P - February 2004
1-6 Introduction to the MobileView SDK
keys for control panel applets and other operating system items will be maintained even in the case of operating system upgrades.
On the other hand, the priority given to persistent registry information over default operating system registry information makes it possible for applications or users to cause problems with operating system startup by changing the wrong registry keys. When manipulating the CE Registry applications, users should exercise the same degree of caution that would be required in the case of a Windows 9x or NT device.
IMPORTANT
Since some applications and drivers only read the Registry at start-up, some registry changes made by applications will have no effect until the terminal is re-started.
Policies for When Registry Flushing Occurs
Control panel applets supplied with the operating system have been customized to automatically flush the registry upon exiting the applet. This allows users to change typical control panel settings such as network, device name, screen saver, etc. and have these be flushed without having to manually issue a registry flush to save these. Since the flush occurs on applet exit as an optimization, users just need to remember to close the applet after making changes for the automatic flush to occur. Due to the inner workings of the applets, it is not feasible to only flush on applet close if a value was changed, so a flush occurs on applet close even if no registry values were actually altered.
Other applications such as Internet Explorer, remote networking, and any third-party packaged applications are not customizable in this fashion and hence changes they make to the registry will not be persistent until some other application flushes the registry. To address this, two features of the operating system are present.
Publication 2727-UM004B-EN-P - February 2004
First, an executable regflush.exe supplied with the system may be manually executed by a user at any time to flush the registry to persistent storage; this application simply calls RegistryFlush(). Second, upon a controlled shutdown requested by an application through the power/shutdown driver results in an automatic flush of the registry after applications have signaled that their cleanup is complete and before the hardware is actually shutdown or reset.
During an uncontrolled shutdown (i.e. hard-power down), the system does not have enough time to flush the registry to persistent storage.
Introduction to the MobileView SDK 1-7
Therefore, the registry must have been flushed by one of the means described above or else changes to the registry since the last flush will be lost. It is recommended that the controlled shutdown procedure be used for shutdown even if other registry flushing by applications is in place.
Local File Systems
The Windows CE operating system provides support for two separate local file systems. A DOS compatible FAT16 file system is implemented in a Flash Storage partition; accordingly, its files are persistent. A RAM file system (RAMDISK or Object Store) is implemented in that part of the system DRAM reserved for it. The files in the RAM file system are not persistent.
The FAT16 and RAM file systems can be viewed and manipulated by the Windows Explorer utility. Within the Windows Explorer, these systems appear as parts of one larger system. That is, they appear as directories under “My Computer”. The FAT16 file system appears as “\Flash Storage”, while the RAM file system includes several directories, including the most important, the “\Windows” directory, where system binaries are stored.
Table 1.1 RAM File System
Directory Description
\Temp Not used
\My Documents Not used
\Program Files Contains links (shortcuts) to certain system
executables
\Program Files \Communications Contains links (shortcuts) to certain system
executables
\Windows Contains system executables (*.exe), dynamic
link libraries (*.dll), fonts (*.ttf), etc. making up the Windows CE operating system
\Windows\Programs Contains links (shortcuts) to certain executables
in \Windows
\Windows\Programs\ Communication
\Windows\Desktop Contains links (shortcuts) that define the
\Windows\Favorites Not used
Contains links (shortcuts) to certain executables in \Windows
contents of the Windows Desktop
Publication 2727-UM004B-EN-P - February 2004
1-8 Introduction to the MobileView SDK
Table 1.1 RAM File System
Directory Description
\Windows\Fonts Not used
\Windows\Recent Not used
\Windows\Startup Contains links (shortcuts) to certain executables
in \Windows
The FAT16 (persistent) file system, “\Flash Storage”, is organized as follows:
Table 1.2 FAT16 File System
Directory Description
\Flash Storage Contains backups of the system registry and
the system exceptions log. Applications should be stored here or in subdirectories created here.
\Flash Storage\Temp
\Flash Storage\Windows\Desktop Contains links to certain system executables
\Flash Storage\Windows\ Programs Contains links to certain system executables
Input Device Handlers
Touch Screen
The display is equipped with a high resolution resistive touch screen. The Windows CE operating system incorporates a driver for the touch screen.
A user interface is provided to enable touch screen configuration and calibration. Touch screen calibration values are stored in the registry.
Keyboards
Support is present in the operating system for the bezel keypad.
Publication 2727-UM004B-EN-P - February 2004
Introduction to the MobileView SDK 1-9
PCMCIA
New or upgraded components of application programs and the operating system can be copied from the PCMCIA memory card to Storage Card memory to replace and upgrade the existing components.
In the Windows Explorer, the PCMCIA Memory Card will show up as an icon named “\Storage Card”.
Application Run Time Environment
Path
The notion of a path to executable files is much the same as with any other Windows or DOS system. However, unlike other systems, which refer to an environment variable for path settings, Windows CE utilizes a registry entry. Thus, the path can be set only by editing the value of the registry key \HKLM\Loader\SystemPath. Note the use of spaces to separate items in the path list, as in the following example:
“\Storage Card\bin\ \Storage Card\ \ Storage Card\bin\ \Storage Card\ ...”
Launching Applications At Start-Up
The Windows CE Registry entries at key HKLM\init determine the programs that are started during system initialization, and the order in which they are started. The Windows CE Platform Builder development tool (not part of the Embedded Visual C 4.x) is used to establish these Registry entries.
Table 1.3 MobileView Terminals Launch Order
Sequence Program or File Description
Launch10 shell.exe Start the shell
Launch20 device.exe Load and start the device drivers
Launch30 gwes.exe Start graphics and events subsystems
Depend30 14 00 When device.exe signals complete
Launch50 explorer.exe Start Windows Explorer
Publication 2727-UM004B-EN-P - February 2004
Loading...
+ 35 hidden pages