By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

Trouble with outputting data via MSCOMM

P: 1

I'm encountering a "Blue Screen of Death" when I try to send data to a bluetooth sensor via a serial port, using the MSCOMM ActiveX object. I was wondering if anyone has any ideas how to fix the problem.

As some background, I am trying to use VB to communicate with a Wi-Tilt bluetooth accelerometer, a sensor which sends data over a COM serial port. I have no problem talking to the device in Hyperterminal; it streams data into HyperT very nicely.

However, when I set up a small program in VB using the MSCOMM object, my system fails everytime I send a "1" to the serial port (which is the command to get the sensor to spit out data). I'm actually using the NETCOMM object, but it functions identically to the MSCOMM object. Plus I've tried about 5 other ActiveX objects, and I still get the Blue Screen everytime I send some data. So I don't think it's a problem inherently with MSCOMM-like objects, but probably my bluetooth driver. Has anyone encountered a similar issue, and found a remedy?

The message on the Blue Screen refers to IRQL_NOT_LESS_OR_EQUAL, which I understand is a common message for driver failures.

Here is the code I've been attempting to use:
Sub try_to_connect()

NETComm1.CommPort = 8

If NETComm1.PortOpen = True Then
NETComm1.PortOpen = False
End If

With NETComm1
.Break = False
.DTREnable = False
.EOFEnable = False
.Handshaking = comNone
.InBufferSize = 1024
.InputLen = max_packetsize
.InputMode = comInputModeText
.NullDiscard = False
.OutBufferSize = 1024
.ParityReplace = Chr(0)
.RThreshold = 1
.SThreshold = 0
.Settings = "57600,N,8,1" 'default settings
End With

If NETComm1.PortOpen = False Then
NETComm1.PortOpen = True
End If

NETComm1.Output = "1"

End sub
I've tried sending the "1" as a byte, a string, a variant, and have tried sending Chr(49) ... it doesn't make any difference, I still get the blue screen. I'm using an embedded Broadcom bluetooth chip on a Lenovo X60, Windows XP.

Thanks very much for anyone who has any ideas how to solve this problem!

Jan 21 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.