FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Serial-comm question
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Serial-comm question
Posted: Sat Sep 17, 2011 10:51 AM

Can i check, if the handle from a comm-port are at the actual time ok? I the case, the user shut off the environment with the serial connection the app hangs.

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Serial-comm question
Posted: Sat Sep 17, 2011 11:21 AM
Not sure if this will help but in my app I do the following to see if data is still hitting the serial port:
Keep in mind that with my app the serial device sends data every second so I always expect to see something on the port unless the device is turned off or disconnected.


Code (fw): Select all Collapse
      if ReadComm( nComm , @cDataRead) <> 0
          //data on serial port
      else
         //no data on serial port
      endif
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Serial-comm question
Posted: Mon Sep 19, 2011 07:26 AM

No, i have the problem with a usb-serial converter. If the converter is unplugged from the user, the app hangs.

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion