Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Don Higgins
  Where is Don Higgins?
 Peoria
 Illinois - United States
 Don Higgins
 To: Richard Clarke
  Where is Richard Clarke?
 Crowcombe
 United Kingdom
 Richard Clarke
 Tags
Subject: RE: mscomm error control
Thread ID: 155297 Message ID: 155316 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Errors & Debugging
Date: Saturday, December 29, 2007 8:38:57 PM         
   


>
>
> Don,
>
> The generic error trapping in the error method on the form should give you: -
>
> 1. If you try and open port that is not available, i.e. it doesn't physically exist on the pc, you should get error number 8008.
>
> 2. If you try and open a port that exists but is in use you will get error number 8005.
>
> The only way i know to see if a device is attached to the comm port, switched on and working is to send a command that the device will send back a response to. Send the command and if it doesn't respond then it ain't there.
>
>
> Regards
>
>
>
> Richard Clarke




Here is what I have the the error event on the form.
Lparameters nError, cMethod, nLine


Do Case
	Case nError = 8002
		Messagebox("Port Number Invalid",0,"Error")

	Case nError = 8000
		Messagebox("Not Valid while Port Open",0,"Error")

	Case nError = 8018
		Messagebox("Port Must Be Open First",0,"Error")

Endcase



It never gets to this section. This error trapping is disregarded and the usual VFP Error clicks in.


Don Higgins






ENTIRE THREAD

mscomm error control Posted by Don Higgins @ 12/29/2007 9:20:59 AM
RE: mscomm error control Posted by Richard Clarke @ 12/29/2007 7:04:48 PM
RE: mscomm error control Posted by Don Higgins @ 12/29/2007 8:38:57 PM
RE: mscomm error control Posted by Richard Clarke @ 12/29/2007 9:01:39 PM
RE: mscomm error control Posted by Don Higgins @ 12/29/2007 10:09:47 PM
RE: mscomm error control Posted by Richard Clarke @ 12/31/2007 3:13:47 PM