"Device unavailable" error from MSComm 
Author Message
 "Device unavailable" error from MSComm

Quote:

>I am trying to use the MSComm VBX in VB Pro 3.
>I am trying to open COM2 using:-
>comm1.commport=2
>comm1.portopen=true
>I did have this working but after the program aborted with an error
>and did not close the com port, every time I try and run the code I
>get a "device unavailable error". This happens for all COM ports. I
>have made sure that there are no other programs using the COM ports.
>My terminal terminal program can use the ports OK, so I can not
>understand the error. I have also tried rebooting but nothing helps.
>Any suggestions/solutions grately apprehiated.
>TIA
>  /*/       Robert Stonehouse
> /*/_       St Ives(Cambs)  UK

>  /*/      
>_/?/_      
>\RjS/      
> \*/        

Check to make sure that the Communications Icon is on the Form - Has
it been "Deteted" by accident?

Have you set the settings?

Perhaps it it is there, write a quick little programme to open and
then close the port cleanly. Have a little delay incase buffers are
doing their own thing. (Can't think that they are but you never know!)

Does the equipment that you are communicating with require a "shut
down comms link" instruction??

(I am writting a Comms programme that requires such a close code so
the the equipment returns to "Local" control rather than "Remote" via
the computer. If I exit without the close code the external kit locks
up!)

Try this as a "cleansing" programme

Comm1.commPort = 2
Comm1.Settings = "9600,8,N,2" (or whatever)
Comm1.PortOpen = true

' ==== Clear buffer ======
        ' If it is a modem with Hayes instruction set,
        ' Add here: Comm1.Output = "AT" + Chr$(13)
Comm1.InputLen = 0

'====== delay whilst things happen (Maybe?) ====
For J=1 to 1000
        For P = 1 to 10000: Next P
Next J
InString$ = Comm1.Input
(Optional: Text1.Text = Instring$)

' = Issue closedown instructions to external equipment  ====
Comm1.Output = " (issue any shutdown code  reqd) "
'==== delay whilst close instructions being sent ====
'==== You must not close port until sent! =========
For J=1 to 1000
        For P = 1 to 10000: Next P
Next J

'=========Close port & Exit ===========
Comm1PortOpen = False

End
====================
I'm sure that many of th guru's will give you a better reply, but you
never know!!

All the best wishes

Donald Gray
Free Agent V1.0
Eudora Lite V1.5.4b11 (16 bit version)

Please do not short the output or severe damage will be caused to the fuse.
         (On a Sony power supply leaflet!)



Sun, 30 Aug 1998 03:00:00 GMT  
 "Device unavailable" error from MSComm


Quote:
>I am trying to use the MSComm VBX in VB Pro 3.
>I am trying to open COM2 using:-

>comm1.commport=2
>comm1.portopen=true

>I did have this working but after the program aborted with an
error
>and did not close the com port, every time I try and run the
code I
>get a "device unavailable error". This happens for all COM
ports. I
>have made sure that there are no other programs using the COM
ports.
>My terminal terminal program can use the ports OK, so I can not
>understand the error. I have also tried rebooting but nothing
helps.

>Any suggestions/solutions grately apprehiated.
>TIA
>  /*/       Robert Stonehouse
> /*/_       St Ives(Cambs)  UK

>  /*/      
>_/?/_      
>\RjS/      
> \*/        

Often, modems hang so bad that only glacial reboots will solve.
Power off, Power on.
If you have this message, someone is using your port! Could it be
trumpet?? Could it be a left over 'open port' from the last 'on
error resume next'?

GLUK

TERRY



Mon, 31 Aug 1998 03:00:00 GMT  
 "Device unavailable" error from MSComm

Quote:


> > >I am trying to use the MSComm VBX in VB Pro 3.
> > >I am trying to open COM2 using:-

> > >comm1.commport=2
> > >comm1.portopen=true

Actually, the commport property is changeable at run time.  I just finished an application using
VB 3.0 Pro and MSComm and needed to switch between com1 and com2 during development and was able
to do so by modifying the code.

Dave Polan



Mon, 07 Sep 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help on "RPC Server unavailable" error

2. Error: "The RPC Server is Unavailable"

3. Error: "The RPC Server is Unavailable"

4. Using MSCOMM.VBX get device unavailable

5. mscomm error 8005 "Port Already Open"

6. Windows Script 5.5 downloads "currently unavailable"

7. Enumerating "CAPTURE" Devices

8. Enumerating "CAPTURE" Devices

9. Handling Err68 "Device Not Available"

10. Runtime error 68: Device unavailable

11. Device unavailable error on compressed drive

12. Device Unavailable Error

 

 
Powered by phpBB® Forum Software