CAN for Pocket PC

Version 1.0.1

� 2003-2004 National Instruments Corporation, All Rights Reserved.

Thank you for using National Instruments products for CAN.

Information in this file is organized in the following sections:

Overview

CAN for Pocket PC provides software libraries to develop PocketPC applications for National Instruments PCMCIA-CAN cards.

CAN for Pocket PC supports all National Instruments PCMCIA-CAN cards, including Series 1 cards, and the recently released Series 2 cards. To use these cards with your Pocket PC device, you need a PC Card Expansion Pack. Contact the manufacturer of your Pocket PC device for information about purchasing a PC Card Expansion Pack.

The functions provided in CAN for Pocket PC enable your application to transmit and receive any CAN frame. This includes the ability to transmit CAN frames periodically.

The functions in CAN for Pocket PC are a subset of the Frame API functions in the NI-CAN product for Windows. The shared functions of NI-CAN and CAN for Pocket PC enable you to develop an application for Pocket PC, yet debug that application on your Windows system. For example, if you insert the PCMCIA-CAN card into a Windows notebook, you can debug your application on the notebook prior to final debugging on the Pocket PC.

The functions in CAN for Pocket PC are documented in the Frame API chapters of the NI-CAN Hardware and Software Manual. This manual is provided in Adobe Acrobat format in:

Start � Programs � National Instruments � NI-CAN

For a listing of Frame API functions that are not supported in the CAN for Pocket PC kit, refer to the Limitations section.

The CAN for Pocket PC software supports up to two PCMCIA-CAN cards in the Pocket PC. When you use a single card, you access the first CAN port (Port 1 on the connector) as interface CAN0 in the functions, and the second port (Port 2) as CAN1. When you use a second PCMCIA-CAN card in the Pocket PC, you access the CAN ports as CAN4 and CAN5.

Installation

Perform the following steps:

  1. Install your Pocket PC development environment.

For LabVIEW development, you must install LabVIEW 7.1, and the LabVIEW PDA module. LabVIEW 7.0 is not supported.

For C/C++, you must install eMbedded Visual Tools version 3.0 or 4.0. Visual Studio .NET is not supported. Refer to www.microsoft.com for information regarding eMbedded Visual Tools.

  1. Install NI-CAN version 2.2 or higher.

You must install NI-CAN on your Windows system prior to installing the CAN for Pocket PC product. The NI-CAN installer is available on www.ni.com for download.

  1. Install CAN for Pocket PC on your Windows system.

This step installs files for Pocket PC development onto your Windows system.

  1. Install CAN driver files onto your Pocket PC.

CAN driver files are required in order for your Pocket PC to communicate with the PCMCIA-CAN hardware. Launch Pocket PC Driver Installation from:

Start � Programs � National Instruments � CAN for Pocket PC

LabVIEW PDA Development

The examples for LabVIEW are listed in the NI Example Finder under:

��������������� Toolkits and Modules � PDA � Hardware Input and Output � CAN

The CAN functions for Pocket PC are located in the NI Measurements palette when you switch your target to Pocket PC.

To access a function�s reference from within LabVIEW, press <Ctrl-H> to open the help window, click on the CAN function, and then follow the link.

CAN for Pocket PC provides a pair of functions that differ from the NI-CAN Frame API functions: ncReadNetMult for PDA, and ncReadObjMult for PDA. These VIs are the same as the NI-CAN functions (ncReadNetMult and ncReadObjMult), but their implementation is optimized for improved performance on LabVIEW PDA. When you develop your LabVIEW VI, use the PDA VIs from the LabVIEW PDA palette. These PDA VIs are also compatible to NI-CAN, so you can use them on your Windows system as well as the Pocket PC.

The Pocket PC 2003 Emulation target of LabVIEW PDA is not supported for CAN. Since the CAN functions provided for Pocket PC are a subset of the Frame API functions provided for NI-CAN on Windows, CAN applications for Pocket PC can be prototyped on your Windows system with a plug-in CAN card. See the Limitations section to get a listing of the Frame API functions not supported on Pocket PC.

The error codes returned from CAN functions are the same for NI-CAN and CAN for Pocket PC. In order to view a description of an error code on your Windows system, open the Explain Error dialog from the LabVIEW Help menu, and enter the code from the Pocket PC into the code field.

eMbedded Visual Tools (C++) Development

Libraries, header files, and examples for eMbedded Visual Tools development are installed to:

��������������� \Program Files\ National Instruments\CAN for Pocket PC\MS Visual C eMbedded\

eMbedded Visual Tools version 3.0 and 4.0 are supported. You can build applications for Pocket PC 2002 and Pocket PC 2003. To build an embedded C CAN application for Pocket PC, edit your Project Settings to add nicanppc.lib to the list of libraries, and the location of nican.h to the list of include folders.

Two separates folders are provided for 3.0 and 4.0 examples. Within the folder for each example, you can open the Visual C Project (VCP) file directly in order to build the example. The Project Settings of each VCP file are initialized to reference nicanppc.lib and nican.h.

The error codes returned from CAN functions are the same for NI-CAN and CAN for Pocket PC. The ncStatusToString function is not supported in CAN for Pocket PC, but NI-CAN provides a utility that describes error codes. In order to view a description of an error code on your Windows system, launch a command prompt (MS-DOS), and change to the following directory:

\Program Files\National Instruments\NI-CAN\Utilities\

Type the following on the command prompt:

����������� explain <code>

The <code> is the error code from the Pocket PC. You can enter the code as decimal, or as hexadecimal by preceding the code with �0x� (such as �0xBFF62001�).

New Features as Compared to 1.0

In addition to Pocket PC 2002 and Pocket PC 2003 targets, version 1.0.1 of the CAN for Pocket PC software does support the Diagnostic Instruments Di-400 Instrumentation & Computing Platform.

Limitations

The following features are not provided in CAN for Pocket PC.

  1. Emulation for LabVIEW PDA: The Pocket PC 2003 Emulation target of LabVIEW PDA is not supported for CAN. The CAN functions are provided for the Pocket PC 2003 Device target only.
  2. Automatic power-off: If CAN functions are running when your PDA powers off, the application may crash. Turn off automatic power-off features in the Pocket PC, and close test applications prior to powering down the Pocket PC.
  3. Visual Studio .NET: The .NET languages (C# and Visual Basic .NET) are not supported.
  4. CANdb files and other NI-CAN Channel API features: The Frame API functions easily enable logging applications. If you need to provide access to channels (signals) from the Pocket PC user-interface, you can write conversion code in your application.
  5. Frame API functions: The following Frame API functions are not supported:

LabVIEW

������� ncGetHardwareInfo.vi

������� ncCreateOccur.vi

������� ncReset.vi

C++

������� ncGetHardwareInfo

������� ncCreateNotification

������� ncReset

������� ncStatusToString