• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5521
  • Last Modified:

Run-Time Error '8021' with MSComm

Hi all,
   I currently am using two MSComm object to read from two serial ports. One is connected to a barcode reader and the other to a weigh scale.

After running for some time i recieve an

Run-Time Error '8021'
Internal error retrieving device control block for the port.

I am not sure why i am getting it and can't seem to find any way to solve the problem. Has anyone run into this problem before? I will be happy to post sections of the source code if necessary.

Thanks Much.
0
jbutterfieldAtDiamond
Asked:
jbutterfieldAtDiamond
  • 4
  • 2
1 Solution
 
edwardiiiCommented:
Hi, jbutterfieldAtDiamond.

Hopefully an Expert with experience will post a better answer, but possibly the direction at this URL is the way to go:
     http://www.mp3car.com/vbulletin/showpost.php?p=138304&postcount=82

E.g. set up an error trap to reset the comm port to your devices?  
0
 
jbutterfieldAtDiamondAuthor Commented:
Hi Edwardiii,
Thanks for the idea but this really isn't an option for me becuase each time i close and reset, because of this error, i miss a box. This is an automated system and any missed packages can spell disaster. Of course i have error trapped the condition already but i would like to find a solution to this one.. i am def. stumped.

I should mention that i the client pc is a Windows XP SP 2 with a SIIG PCI two port serial card and two NIC cards installed. One NIC is onboard, the other is a PCI card. The comptuer also has an onboard serial port we are not using.

Justin.
0
 
edwardiiiCommented:
Ok.  One last thought--if you preface your routine with "On Error Resume Next", does the MSComm force a re-acquisition of the control block, with no loss of data?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jbutterfieldAtDiamondAuthor Commented:
Once the error occurs the program locks up... so i can't image a resume next would work... but i will give it a shot.

If you have any other ideas that would be great. I would rather fix the problem rather than bypass it like this.. ya know.
0
 
edwardiiiCommented:
Understood:)  I just wanted to present the Resume Next because I've run into various coding through time that throws an error and Resume Next enables processing to continue with no loss of data.  
0
 
edwardiiiCommented:
Found some info here (http://www.tech-archive.net/Archive/VB/microsoft.public.vb.winapi.networks/2004-08/0035.html)
that seems to indicate the problem you're having may be a result of the client PCs having two NICs (presuming they're both
in use).  Possible solutions offered can be found under "WORKAROUND" on the page.  If two NICs are in use, would it be possible to disconnect one while scanning packages?

     
0
 
Shiju SasidharanCommented:
can u please  post the code and mark the position where u get the error ?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now