www.instrument.com  -  Thursday, November 20, 2008
Printer-friendly version of the page "Developer's Site"  
(URL: http://www.edasce.com/lanpoint-plus-tools.html)


LANpoint PLUS & LANpoint TIME Developer's Site

Welcome to the LANpoint PLUS & LANpoint TIME Developers Site!

Don't be fooled by the LANpoint PLUS/TIME terminal's small size and 2-line LCD display.  With its WindowsCE.NET operating system, it's like having a Ferrari engine packed in a Volkswagen body.

The LANpoint PLUS - or LANpoint TIME - with its 2-line LCD display and its compact case, is a carryover of our earlier model CTM300 series terminals, which had point-to-point, RS-232 or RS-422 communication capabilities. This evolved into our TM8500 series terminals that had multi-drop and RS-422 network capabilities, and finally our first generation Ethernet based data collection terminals called the LANpoint which ran with a DOS operating system.  All used this very sucessful case design. The LANpoint PLUS & LANpoint TIME are the newest of our compact, small footprint, data collection terminals, running WindowsCE.NET.

 


Getting Started

The LANpoint PLUS/TIME presents a unique programming target. When unpacked and powered on, the unit will display a Version Number and IP address on the LCD display.

 

 

At this point you might get stumped.  Pressing on the keys does nothing.  You find it has no graphics display connector, and also no mouse.  No obvious physical interface to the programmer!


Getting Connected to the Network

The LANpoint PLUS/TIME programming environment is purely network-based.  It needs to be accessed over the network, and programmed over the network.  The LCD display is not the unit's 'graphical' display.  The LCD display is just a text I/O device internally connected to the hardware. The LCD display will only show what you program it to display.  The Version Number and IP address displayed when the unit boots is just a program that is pre-loaded into a 'startup' folder and gets executed when the unit first boots.

Usually the first thing program developers try once they get a unit powered on is to type on the keyboard to see data displayed on the LCD display.  They note that nothing they type is displayed on the LCD display.  They discover that the LCD display is not a Windows Operating System Display and typing on the keyboard does nothing. 

It's a bit of a shocker for a Windows Programmer to discover that the LCD display is not the Windows Operating System Display. The LCD display is just an added peripheral device attached to the overall hardware on the terminal.  Any data placed on the LCD display must be placed there by an application program.

The developer then looks to see where one can plug in a Video monitor, only to discover that the LANpoint PLUS/TIME has no Video Monitor connector!

So, no video monitor, no mouse, and pressing on the keyboard has no obvious effect the terminal at all.  What's a programmer to do? How do you get the terminal to do anything?

 


Configuring the LANpoint PLUS/TIME for program development.

There actually is a program that can be started from the LANpoint PLUS/TIME terminal keyboard called the SETUP program.  This setup program will allow you to set up all the basics for program development and network access.  By pressing the '2nd' key and releasing it, then pressing the F8 key, the SETUP program will be triggered to run and you will see the following displayed on the LCD display.

 

The LANpoint PLUS (or LANpoint TIME) Quickstart Guide contains all of the commands for what is described below for setting up the terminal for network access and programming development.

 

What is needed to get a LANpoint PLUS/TIME configured for program development and Network Access?

1. Configure for either DHCP or No DHCP.

     A. If no DHCP, configure the IP, subnet, and Gateway Address.

2. Configure Remote Graphic Screen Display.

3. Configure for Embedded Tools 4.0 Remote Application Access and Download.

4. For those programming with Visual Studio 2003 , in either VB.NET or C#, there are some setup procedures using the Remote Graphic Screen Display for something call the 'Smart Device Authentication Utility'.

 

Configure for either DHCP or No DHCP.

To enable DHCP enter:

Setup>NP1

 

To disable DHCP enter:

Setup>NP0

 

Configure the IP, subnet, and Gateway Address.

If DHCP is disabled, you need to manually enter a IP, Subnet, and Gateway address.

 

To set IP address enter:

Setup>NIxxx.xxx.xxx.xxx

 

To set subnet mask enter:

Setup>NSxxx.xxx.xxx.xxx

 

To set Gateway address enter:

Setup>NGxxx.xxx.xxx.xxx

 

*Note...Factory Default is DHCP enabled. If changed you need to reboot for the changes to take effect.

 


Configuring the Remote Graphic Screen Display.

Yes, the LANpoint PLUS/TIME does have a Graphics Display, but it can only be viewed over the network on a PC.  On the PC side, you need to first start the "Remote Display Control for WindowsCE" program called CERHOST.EXE.  It can be downloaded from our download site.  On the LANpoint PLUS/TIME, you need to setup the IP address of the PC that will be running the CERHOST.EXE program.  Once the host IP address is entered you then issue a command in SETUP to start the Remote Display Client program on the LANpoint PLUS/TIME terminal.

 

To define the IP address of the PC running the  "Remote Display Control for WindowsCE" program enter:

Setup>rdhostxxx.xxx.xxx.xxx

 

To start the Remote Display Client program on the LANpoint PLUS/TIME terminal enter:

Setup>rdstart

 

Once entered you will get a display on your PC similiar to the one shown below.

 

 

Exiting the setup program on the LANpoint PLUS/TIME, you see the following on the Remote Display:

 

What you see is the Desktop of the WindowsCE.NET operating system on the LANpoint PLUS/TIME. You can now use the mouse on your PC to click into sub-folders and perform other graphics based functions on the LANpoint PLUS/TIME.

 


Other Network Access Capabilities.

The LANpoint PLUS/TIME has a Telnet Server and a web-based Remote Manager. The Telnet server starts up when the unit boots.  The Remote Manager is an Intelligent Instrumentation creation and provides a Browser based method to access the terminal over the network.  The Remote Manager has file tranfer and process access capabilities along with the ability to reboot the unit.

Starting the LANpoint PLUS/TIME Remote Manager.

Starting the LANpoint PLUS/TIME Remote Manager is first acomplished by starting this program using the SETUP program. Once running you can use the Remote Manager to create a startup link in the terminal 'Startup' folder, so the Remote Manager executes when the unit gets rebooted.

To start the Remote Manager from the 'Setup' program enter the following command on the terminal:

Setup>wdce

On the browser of your PC, you can enter the IP address of the LANpoint PLUS/TIME in the URL address box, and see the following screen.



Display for the LANpoint PLUS & LANpoint TIME Remote Manager

Program Development for the LANpoint PLUS & LANpoint TIME

Three programming languages are available for program development for the LANpoint PLUS/TIME.  They are:

 

Microsoft eMbedded Visual C++ 4.0

Lets start with the classic 'Hello world' application, but in this case we will get 'Hello world' displayed on the LCD display of the LANpoint PLUS/TIME.

But before we develop the application, there are a few other items to setup on the LANpoint PLUS/TIME and within the Configuration Manager of Microsoft Embedded Visual C++ 4.0.

Prepare the LANpoint PLUS for Microsoft eMbedded Visual C++ 4.0

The LANpoint PLUS/TIME needs to know the IP address of the PC that is running Embedded Visual C++. When the terminal boots up, a program 'debuglauncher.exe' gets executed and reads the contents of a file called 'debugworkstations.txt'.  The contents of this file is the IP address of the PC that is running Embedded Visual C++ 4.0.

To define the IP address of the PC running eMbedded Visual C++ 4.0 enter:

Setup>dbgxxx.xxx.xxx.xxx:yyyy

Where 'xxx.xxx.xxx.xxx' is the IP address of the PC running eMbedded Visual C++ 4.0 and 'yyyy' is a port value number that you will use in the configuration manager of eMbedded Visual C++ 4.0. Port 4500 is recommended.

Setup>dbg172.16.0.145:4500

 

Prepare PC for Microsoft eMbedded Visual C++ 4.0

In order to use Microsoft eMbedded Visual C++ 4.0 for LANpoint PLUS/TIME program development, you must first install Microsoft eMbedded Visual C++ 4.0 on your PC, then install the LANpoint PLUS SDK into Microsoft eMbedded Visual C++ 4.0.

Even if you are not going to use Microsoft eMbedded Visual C++ 4.0, you should still install the LANpoint PLUS SDK since is contains definition files that might be used in Visual Studio 2003, VB.NET or C#.

Once you have installed Microsoft eMbedded Visual C++ 4.0 and the LANpoint PLUS SDK, execute Microsoft eMbedded Tools C++ 4.0, and configure the Platform Manager.

1. Select Tools/Configure PlatForm Manager.

2. Select the LANpoint PLUS Device.

3. Set Transport to - TCP/IP Transport for Windows CE.

4. Set startup Server to - Manual Server.

5. Configure Transport to - Fixed Port...suggest 4500.

6. For Host IP - Use Fixed Address.

7. Test Connection.


lp25_Configuration_Manager_Setup.ZIP

Zipped .BMP shows details of Platform Configuration for the LANpoint PLUS (or LANpoint TIME) and eMbedded Visual C++ 4.0

190 kB


LANpoint PLUS and LANpoint TIME "Hello World" Sample Application.

Developing a LANpoint PLUS/TIME application program is not any different than developing any Windows based application except that you have no graphical display on the LANpoint PLUS/TIME. That's not to say you don't have graphics available, just that no graphics will display on the LANpoint PLUS/TIME LCD display.

Creating the 'Hello World' application in Embedded Visual C++ requires you to follow the basic layout in creating the eVC++ project application.

 

1. Select File/New and define a path, name, and processor types for your project

2. Select the kind of application to create...A typical 'Hello World' Application.

3. Under Project/Settings...Define the download directory on the LANpoint PLUS/TIME.  The '\flash\tests' folder is recommended.

4. Perform a ReBuild/All to compile and download the application to the LANpoint PLUS/TIME.


lp25_Hello_World_setup.ZIP

Zipped .BMP that shows details of creating, compiling, and downloading a LANpoint PLUS or LANpoint TIME application project.

179 kB


LANpoint PLUS or LANpoint TIME "Hello World" Sample Application (cont.)

At this point you may be tempted to run the application, but will find no way to do that.  Typing on the LANpoint PLUS/TIME keyboard yields no results.

You might also be tempted ro run the application using the 'Setup' program on the terminal with the following command:

Setup> run \flash\tests\lp25_hello_world.exe

Or you could run the program from the embedded Visual C++ using the "execute command"...CTRL+F5.

But neither will indicate on the LANpoint PLUS/TIME that the program is executing.  It really is, you just can't tell looking at the LCD display on the LANpoint PLUS/TIME.  This is a graphics based program and the LCD is not the graphical display screen.

Use the Remote Graphic Screen Display to verify that the program is executing.



Hello world program generated by Embedded Visual C++ displays on the Remote Graphical Display.


LANpoint PLUS & LANpoint TIME Hello World Sample Application (cont.)

Getting text displayed on the LANpoint PLUS or LANpoint TIME terminal works out to be pretty simple. Intelligent Instrumentation has developed a set of API calls that act on the LCD display.  Using the "Hello World" application, all you need add is a header file called DisplayAPI.h, add the library file called DisplayAPI.lib to the Object/library modules list in the Project settings Link list, and make a call to print the words "Hello World" in the appropriate routine in the souce code of the application.

The following is a code snippet to do this:

#include "stdafx.h"
#include "lp25_Hello_World.h"
#include <commctrl.h>

#include "DisplayAPI.h" 

#define MAX_LOADSTRING 100
.

.

.

case WM_PAINT:
   RECT rt;
   hdc = BeginPaint(hWnd, &ps);
   GetClientRect(hWnd, &rt);
    clrscr();    // Clears the LCD Display.
    printxy( 0, 1, "Hello World"); //Writes to LCD.
   LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
   DrawText(hdc, szHello, _tcslen(szHello), &rt, 
   DT_SINGLELINE | DT_VCENTER | DT_CENTER);
   EndPaint(hWnd, &ps);
break;



Hello World program now writes to the LCD display of the LANpoint PLUS/TIME terminal.


LANpoint PLUS & LANpoint TIME Hello World Sample Application (cont.)

That's all there is to it - but for a complete application, we need to add some more!

We have added two lines of new code and we need to add a bit more!

How do you exit this program?  With a graphics screen and mouse you could select "File" and exit, or just click on the 'x' in the upper right hand corner of the display.  But you have access to neither of these from the LANpoint PLUS/TIME.

In a real world application you may not want to be end the program, so it may not really matter, but in this sample we DO want to be able to exit.

In this sample, the program will be made to exit when you press the 'F8' or the '0' key.

Windows applications are driven by events.  You click on a button with your mouse or tab to an Edit box to type in data.  These are events. Pressing the keys on the keyboard are also events.  The pressing of a key generates a Windows message, and that message gets sent to the application that is currently in focus. The program processes that message and it goes on to do something.

In our case we are going to trap key presses.  If we detect that a key has been pressed, we check to see what key was pressed, and if it was the F8 key or the "0" key, we will print a "Program end" message on the LCD display and exit the program.

Not a hard thing to do with new code that will collect keyboard data:

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
 HDC hdc;
 int wmId, wmEvent;
 PAINTSTRUCT ps;
 TCHAR szHello[MAX_LOADSTRING];

 switch (message)
 {
// This area reacts when a key is pressed.
  case WM_KEYDOWN:
   switch (wParam)
   {
    case VK_F8:
     DestroyWindow(hWnd);
    break;
   }
   case WM_CHAR:
    if ( ((char)wParam == 48) ) // 48 = '0'.
    {
    DestroyWindow(hWnd);
    }
   break;
  break;
  case WM_COMMAND:
.

.

  case WM_DESTROY:
   CommandBar_Destroy(hwndCB);
   clrscr();
   printxy( 0, 0, "************ LANpoint Plus *************" );
   printxy( 0, 1, "Program end." );
   PostQuitMessage(0);
   break;



Message on LCD display of LANpoint PLUS or LANpoint TIME when F8 key is pressed, ending the application.


lp25_Hello_World.ZIP

Project sample, lp25_Hello_World, for the LANpoint PLUS & LANpoint TIME.

164 kB


LANpoint PLUS & LANpoint TIME Digital I/O Sample Application.

The LANpoint PLUS and LANpoint TIME have 8 (eight) digital input and 8 (eight) digital output lines.

A set of API calls can control or monitor these digital I/O lines.

The following zipped project file demonstrates this type of control.

 



Display on LANpoint PLUS/TIME when running Digital I/O sample application.


lp25_digital.ZIP

Project sample, lp25_digital, for the LANpoint PLUS/TIME.

222 kB


LANpoint PLUS & LANpoint TIME Display Sample Application.

This LANpoint PLUS/TIME sample program does two things, it waits for keyboard input, and displays the time on the LCD display. Once the 'Enter ' key is pressed, the data entered is again displayed.  Pressing F8 exits the program.

 



Display on LANpoint PLUS/TIME when running the LCD Display Sample application.


lp25_lcd_display.ZIP

Project sample, lp25_lcd_display, for the LANpoint PLUS/TIME.

165 kB


LANpoint PLUS & LANpoint TIME Setup Sample Application.

This sample application is a variation of the Setup program that is installed on the LANpoint PLUS and the LANpoint TIME.  The difference is that it incorporates new functions to aid in setting up a LANpoint TIME terminal.

LANpoint TIME terminals have an option to have only a numeric keypad, which makes using the setup program, as installed, not very useful.

It has all the same features as the original Setup program and the purpose is to make all the routines used to perform the various commands in the Setup program available to programmers.

You may have wondered how the IP address command (NI) function actually changes the IP address for the termimal. Setting an IP address on the terminal requires writing to the registry.  This program will show exactly how that is done.  The Setup program can execute programs by just typing in the name of the application, like 'RDSTART', which starts the terminals side of the Remote Graphic Display.  This program will show you exactly how that is done.

In other words, the Setup program performs a lot of functions you might find useful in your application.


lp25_setup.ZIP

438 kB


Programming the LANpoint PLUS or LANpoint TIME with Visual Studio 2003

The LANpoint PLUS & LANpoint TIME support applications developed with Visual Studio 2003 in C# or VB.NET.

The things to keep in mind are the same as for programming in eVC++.  You are developing a program in a graphics based programming environment, but writing the application for a device that has no graphics.

Any data that is displayed on the LCD display will get displayed by calling the appropriate API provided in our SDK.  Any data received is from the keyboard, which is a 'KeyPressed' type of event.

What is very much different is the method of program transfer.  On the PC side and within Visual Studio 2003, the tools are used to setup a communication link between the LANpoint PLUS/TIME and your PC.  This is called the "Smart Device Authentication Utility".  On the LANpoint PLUS/TIME side there is a client application called "SDAuthUtilDevice.exe".

The "SDAuthUtilDevice.exe" application must be started via the Remote Graphics Display on the LANpoint PLUS/TIME.

On the PC side running Visual Studio 2003, it involves selecting the "Smart Device Authorization Utility", entering the IP address of the LANpoint PLUS/TIME and Pressing the "Set up Device" button.  Once a sucessful connection is made, you can then "Close" the Utility program. You must then go to "Options' and Configure the "Device Tools/Device" and configure the Transport to "Use specific IP address" of the LANpoint PLUS/TIME.

Once complete you should also get into the Project Properties and specificy the location of where the application will reside on the LANpoint PLUS/TIME.

 


Setting up Visual Studio 2003 and the LANpoint PLUS/TIME for network application transfer.

Setting up Visual Studio 2003 and the LANpoint PLUS/TIME for network application transfer.



LANpoint PLUS & LANpoint TIME VB.NET Display Sample using Visual Studio 2003

This sample program is nearly identical to the eCV++ sample program lp25_lcd_display.exe.

The program performs the same function in that it waits for keyboard input and displays the time on the LCD display. Once the 'Enter ' key is pressed, the data entered is again displayed.  Pressing F8 exits the program.


lp25_vb_lcd_Display.ZIP

VB.NET, project sample, lp25_vb_lcd_display, for the LANpoint PLUS/TIME.

604 kB



Copyright 1996-2008 Intelligent Instrumentation Inc.