PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV (versiones precedentes) → About to Scrap WinDev mobile - Serial coms
About to Scrap WinDev mobile - Serial coms
Iniciado por Richard SMITH ( RCAu, 18,oct. 2010 13:57 - 2 respuestas
Miembro registrado
3 mensajes
Publicado el 18,octubre 2010 - 13:57
Hi,

Can anyone help. I am abut to ditch windev mobile as it would appear to be totally useless for serial coms.

I have wasted 2 days just trying to open a serial port and get a loop back test program to work. Now I look into it further and my copy of windev 14 says i should use sEvent to manage events, however when I look sEvent up in the help file it tells me windev mobile does not support sEvent.

Does anyone have a simple serial coms application I can look at in windev mobile 14? Or am I correct that it says it supports serial comms and event but in reality it does not.

Otherwise I will have no choice but to abandon it.

Regards

Richard
Publicado el 18,octubre 2010 - 17:22
Hi Richard

First, you should tell us if you are using windev mobile for windows
mobile or android and for which verson of the system, as those
parameters may change our answers.

Second, regarding serial ports and mobile, it is possible to use them
(by example, all GPS readers are connected on serial ports and
information is read via the serial port all the time)

I do not remember if there is a GPS example available in windev mobile,
but if you don't find one, search for GPS in the US and FRENCH windev
mobile forum for examples of working code for serial port

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 18/10/2010 07:07, Richard SMITH ( RCAu) wrote:
Hi,

Can anyone help. I am abut to ditch windev mobile as it would appear to be totally useless for serial coms.

I have wasted 2 days just trying to open a serial port and get a loop back test program to work. Now I look into it further and my copy of windev 14 says i should use sEvent to manage events, however when I look sEvent up in the help file it tells me windev mobile does not support sEvent.

Does anyone have a simple serial coms application I can look at in windev mobile 14? Or am I correct that it says it supports serial comms and event but in reality it does not.

Otherwise I will have no choice but to abandon it.

Regards

Richard
Miembro registrado
3 mensajes
Publicado el 20,octubre 2010 - 10:52
Hi, Thanks for the quick answer.

I am using Windev Mobile 14

I have made some progress. I hooked up a serial port from the PDA to my PC and wrote some analysis code. I have found the following which was not clear in the help file.

1. By default windev transmits unicode (2 byte chrs) not single bytes. It also expects unicode in return. This means that a loopback test works but will not work with my serial devices which does not undestand unicode. Use of the unicodetoansii and ansiitounicode functions helped.

2. The following does not work:

Port = sOpen(2, 4096, 4096,5000,True)
sParameter(Port, 9600, 0, 8, 0, False, False, False)

Number = sInEntryQueue(Port)
IF Number > 0 THEN
rx = sRead(Port, Number)
END

Despite the help file sugesting this works the value returned by the sOpen command is not the port number. Its a value relating to the sucess of the open command. In the above code to access COM2 you need to set port=2 before any sParameter or sOpen command.

The open command returns 1 when sucessful. This means the code did work with COM1 (my test port to the PC) but not COM2 (my serial rfid reader).

2 days to get my RFID card go BEEP!!

Regards

Richard