Recent

Author Topic: Application for WinCE  (Read 27226 times)

Lacak2

  • Guest
Application for WinCE
« on: February 07, 2009, 04:39:52 pm »
Hi *,
I would like to ask question about using compiling application with Lazarus for WinCE 5.0.

I use Lazarus on my desktop computer with Vista and I need make small database application for mobile barcode reader Motorola MC9090-G (CPU Intel PXA270) with Windows CE 5.0.

Can I done this job with Lazarus ?
If yes , how to do it ?
(when I set Project/Compiler options/TargetOS=WinCE or LCL widgetset=wince ... compiling ends with error : "The system.ppu was not found in FPC directories. ...")

TIA
-Laco.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: Application for WinCE
« Reply #1 on: February 07, 2009, 06:17:42 pm »

Sternas Stefanos

  • Full Member
  • ***
  • Posts: 170
  • Ex Pilot, M.Sc, Ph.D
    • http://www.pilotlogic.com
Re: Application for WinCE
« Reply #2 on: February 07, 2009, 06:19:23 pm »
I use CodeTyphon
http://www.pilotlogic.com/

1) build Lazarus
2) build Lazarus Arm-WinCe cross-element
CodeTyphon Architect and Programmer

Lacak2

  • Guest
Re: Application for WinCE
« Reply #3 on: February 09, 2009, 07:51:56 am »
http://wiki.freepascal.org/Windows_CE_Interface
Thank you for reply, but I am not sure if it matters, but my device contains Intel XScale family processor (PXA270), not ARM processor ?
And above mentioned article speaks about cross compiling for ARM processors (ppcrossarm.exe) ... ?
I use Lazarus 0.9.26
TIA
-Laco.

arnoldb

  • Jr. Member
  • **
  • Posts: 97
Re: Application for WinCE
« Reply #4 on: February 09, 2009, 12:36:52 pm »
Hi - The PXA is an ARM CPU.  I develop for both a MC9000G  and an HP IPaq H5555 - both have PXA255 CPUs.

What I'd suggest:

Get the latest Lazarus and cross-arm installation binaries. I'm using:
Lazarus-0.9.25-fpc-2.2.2rc1-20080704-win32.exe
and Lazarus-0.9.25-fpc-2.2.2rc1-20080704-cross-arm-wince-win32.exe

These work fine to cross-compile for either i386 Windows 32 bit or for ARM windows CE.
If you do not install the cross-arm package, it will not work.

Lacak2

  • Guest
Re: Application for WinCE
« Reply #5 on: February 09, 2009, 02:26:01 pm »
Thank you very much, realy it seems to work, after I have downloaded and installed Lazarus-0.9.26-fpc-2.2.2-cross-arm-wince-win32.exe .

Now I am able to compile and run small app /with label and button/ on MC9090 device ... I will test more ...

arnoldb

  • Jr. Member
  • **
  • Posts: 97
Re: Application for WinCE
« Reply #6 on: February 09, 2009, 03:22:55 pm »
Pleasure  :)

You might want to have a look at http://wiki.lazarus.freepascal.org/WinCE_Programming_Tips

The WinCE part is still under development and you will most likely find a bug or two, but I find it usable on the whole.

Lacak2

  • Guest
Re: Application for WinCE
« Reply #7 on: February 11, 2009, 10:15:48 am »
Now I would like to ask:
Do you have some experience with programing database app. for WinCE? What approach do you recommend ?

I need build app, which is able to connect to MS SQL Server and read and write some data to it ?
/it is app for barcode reader which reads barcode of package,container,box and writes it in DB/

Now I am able to compile GUI app for WinCE, but I cannot find data-component for accessing SQL Server. As far as I known there is no ODBC support for WinCE.

TIA
-Laco.

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: Application for WinCE
« Reply #8 on: February 11, 2009, 10:45:47 am »
http://wiki.freepascal.org/Windows_CE_Interface
If anybody can edit/modify this page, I would recommend better describe this point :

http://wiki.lazarus.freepascal.org/Windows_CE_Interface#Using_the_stable_add-on_installer

Download and install the add-on installer for the same Lazarus version you just downloaded. It's on the same Source Forge Download page.

When I go to to sourceforgre download page, I can not find "add-on installer" finding by name.
Now I known, that it is "Lazarus-0.9.26-fpc-2.2.2-cross-arm-wince-win32.exe" ...
So it would be more descriptive write instead of "add-on installer" for example "cross-arm-wince add-on installer".

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Application for WinCE
« Reply #9 on: February 11, 2009, 03:25:56 pm »
If anybody can edit/modify this page

Anybody can create an account on the wiki, login and edit/modify this page.

Lacak2

  • Guest
Re: Application for WinCE
« Reply #10 on: February 12, 2009, 08:33:44 am »
If anybody can edit/modify this page

Anybody can create an account on the wiki, login and edit/modify this page.
Ok, I made small modification (to point first time users)... may be somebody should review it ;-)

arnoldb

  • Jr. Member
  • **
  • Posts: 97
Re: Application for WinCE
« Reply #11 on: February 12, 2009, 09:54:17 am »
Now I would like to ask:
Do you have some experience with programing database app. for WinCE? What approach do you recommend ?

I need build app, which is able to connect to MS SQL Server and read and write some data to it ?
/it is app for barcode reader which reads barcode of package,container,box and writes it in DB/

Now I am able to compile GUI app for WinCE, but I cannot find data-component for accessing SQL Server. As far as I known there is no ODBC support for WinCE.

TIA
-Laco.

I have not found/tested a data access component for WinCE to MS SQL...  For now, for my own applications I use a TMemDataset for internal operations on mobile, and I wrote my own Sockets interface to a server-side application that passes data between SQL & mobile... Unfortunately, I cannot share source code on that as it is proprietary to the company I work for.

What I can share, is the units I wrote to use the MC9000's barcode scanner - drop me a PM with your email address if you are interested in that.

Lacak2

  • Guest
Re: Application for WinCE
« Reply #12 on: February 12, 2009, 02:17:16 pm »
Thank you very much for your assistance.
For now I have only general question about architecture :
1. Is socket API similar to Win32 socket API ? (socket, connect, send, recv) or is there something special on WinCE ?
OR Do you use some "internet components" for Lazarus ?
2. Server side app is web-based interface (something like PHP script) ? data transfer is formated in xml or other ?

Sorry for so much questions, but I am looking for optimal solution, how to handle my task
(my other thoughts are about JVM for Windows CE or .NET Compact framework ... so use Java for programing or use Borland Delphi for .NET)

TIA
-Laco.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: Application for WinCE
« Reply #13 on: February 12, 2009, 02:30:15 pm »
Ok, I made small modification (to point first time users)... may be somebody should review it ;-)
Done. Thanks.

arnoldb

  • Jr. Member
  • **
  • Posts: 97
Re: Application for WinCE
« Reply #14 on: February 12, 2009, 03:23:51 pm »
@Lacak2

1. I use the LNet components version 0.6.2 which works well on WinCE - using a TLTCPComponent.

2. My Server side application is also a program (currently Delphi) that listens for mobile clients to connect on TCP ports.  Once they connect, the server program then runs queries against the SQL server, and the data is passed back to the mobile clients as a data stream with the necessary field names & types.  My server application is actually a control program that dynamically assigns tasks to people working in a warehouse, so it is not purely used to transfer SQL data.  Data is currently sent as text comma delimited strings - Once the entire project is nearly done, I'll compress and encrypt the data before transmission over IP.  LNet can cater for the encryption as well.

It sort of works like this:
A user scans a tag containing his login information using an MC9000
The MC9000 connects to the server application & verifies the user's credentials.
Then the server application queries SQL to see when last that specific MC9000 had connected.
If database structures on the server had changed, the server sends the MC9000 a notification that it must clear it's own tables, otherwise it tells the MC9000 to expect only a subset of changed data since last logon.
The data is sent something like this:
Server -> MC9000: EXPECT DATA TABLE BINS WITH 20 RECORDS
MC9000 -> Server: OK - SEND DATA
Server -> MC9000: FIELD DEFINITION "BinID" Integer
Server -> MC9000: FIELD DEFINITION "BinName" STRING 30
Server -> MC9000: FIELD DEFINITION "BinContents" STRING 30
etc... (the MC9000 then uses this to create the table)
Server -> MC9000: DATA START
MC9000 Then saves the table definitions & opens the dataset.
Server -> MC9000: 1,"Bin A1","empty",...
Server -> MC9000: 2,"Bin A2","Product A",...
...
Server -> MC9000: 200,"Bin J20","Product ZZ"
The MC9000 loads each record into the table as it is received.
If all went well , the MC9000 -> server: "OK" otherwise "RESEND" / "ABORT" etc.
Then the rest of the application continues depending on tasks that were assigned to the operator from the control program, with continuous communication between the server, the MC9000, and some other PC-Based applications.

One function on my server listens for "SQL Requests" from the MC9000s e.g. the MC9000 can send the following to the server:
REQUEST SQL "UPDATE bins SET Product='Product Z' WHERE Bins.BinID=2"
The server the strips the "REQUEST SQL " part from the data received from the MC9000 and executes the actual sql code against the sql database, and then returns the result to the MC9000.
This request can then also be broadcast in the background to the other mobile units to keep their data in sync dynamically.

 

TinyPortal © 2005-2018