Need Help 1-Wire on XPE

  • Thread starter Thread starter DavidW
  • Start date Start date
D

DavidW

Hi,

I have problem to reading from 1-Wire DS1991 that connected to COM2:

My problem is:

I have my shell application that after 1 second window timer delay, launch
my UtilApp.

In my Utillapp I use

1. Call to TMExtendedStartSession - and it is OK

2. Call TMSetup and here I got an error. (The port not ready.

When I run the UtilApp again (double click on UtilApp.exe), the application
read the DS1991 correctly.



I thing that the problem is that my UtilApp run before the system make the
COM2: ready.

I would like to know how I can control that the COM2 is ready before the
UtilApp is started to run.



Thanks,

David.
 
DavidW said:
I thing that the problem is that my UtilApp run before the system
make the COM2: ready.

I would like to know how I can control that the COM2 is ready before
the UtilApp is started to run.

This surprises me as I find that real COM ports are ready very early.

Or is this a USB COM port? that would definitely make a difference.

Anyway, I suggest that from your shell app you attempt to open COM2 in
a loop until it succeeds and then run the main app.

Delphi code, but you should get the idea. :-)

for Loop := 1 to 20
begin
if SuccessOpenPort(Com2) then Break;
Sleep(500);
if Loop = 20 then ShowMessage('Unable to open COM2');
end;
 
DavidW said:
This is a real COM, The boud is PCM-9375 from Advantch.

Is it possible to do what I suggested and poll the port from your shell
program until it's available?

At least you could do that as a test that it really is the cause of
your problem.
 
Back
Top