Solved

"Blue Screen Of Death" Hardware or Software?

Posted on 2008-10-18
3
502 Views
Last Modified: 2010-04-21
Hope I don't get to verbose, but I want to be clear:
I'm writing an app in VB.Net, and declaring/using separate threads that monitor a serial port for both input or output. It works fine - until I get the "Blue Screen Of Death" with the message  "IRQ_NOT_LESS_OR_EQUAL". Of course, I suspected a thread problem - so I took the code for the thread (a simple loop) and wrote it into a standalone test app. After a while, the test app crashes also (with no separate threads).

The thread code is a simple 'Do" loop. It calls MySerialPort.Receive, which is synchronous, so it wait's till it gets a character. It appends the character to a string in a buffer array. When a <cr> is read in, the completed string is used as a parameter in an Event call (I have rem'd out the RaiseEvent in the test code, just to make sure that it wasn't part of the problem.) The code can run non-stop for 10-60 minutes, then the BSOD occurs.

The HeartBeatTimerFlag get's set with every line that is read in. There is a 500 mS timer that will trigger a start signal to the equipment this is controlling if no lines appear for .5 seconds.

Also, the serial port isn't a regular com port - it's a Keyspan USB serial port at COM3, no handshaking, 115200 baud.

I have attached the entire loop for you to see - can someone tell me why the BSOD is occuring? THANKS!!


Private Sub GetData()
        Do
            Application.DoEvents()
            If MySerialPort.BytesToRead <> 0 Then
                Dim returnData As String = Chr(MySerialPort.ReadByte)  
                B = InStr(returnData, vbCr)
                If B <> 0 Then
                    'got a cr, line is done
                    ReceiveApplicationQueue(ReceiveApplicationQueuePointer) = ReceiveApplicationQueue(ReceiveApplicationQueuePointer) & Strings.Left(returnData, B)
                    HeartBeatTimerFlag = True
                    Debug.WriteLine(ReceiveApplicationQueue(ReceiveApplicationQueuePointer))
                    'RaiseEvent GotApplicationString(ReceiveApplicationQueue(ReceiveApplicationQueuePointer))
                    ReceiveApplicationQueue(ReceiveApplicationQueuePointer) = ""
                    ReceiveApplicationQueuePointer = (ReceiveApplicationQueuePointer + 1) Mod 500
                    ReceiveApplicationQueue(ReceiveApplicationQueuePointer) = Strings.Right(returnData, Len(returnData) - B)
                    returnData = ""
                Else
                    ReceiveApplicationQueue(ReceiveApplicationQueuePointer) = ReceiveApplicationQueue(ReceiveApplicationQueuePointer) & returnData
                End If
            End If
        Loop
 
    End Sub

Open in new window

0
Comment
Question by:LongDave
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:LongDave
ID: 22750797
I forgot to add that the "Application.DoEvents" was not in this loop in the threaded version. I just added it into the standalone so that I wouldn't lock up anything. Incidentally, this is using VB.NET in VS 2005. Thanks!
0
 
LVL 18

Accepted Solution

by:
Priest04 earned 500 total points
ID: 22752205
Well, the error can be both hardware and software, so its hard to say it. Could be the driver is not good. What you could do to eliminate hardware is to try it on different PC. If no BSOD, then its a software problem.

Maybe you should try setting a lower speed, like 9600, for testing purposes.
0
 

Author Closing Comment

by:LongDave
ID: 31507503
It wasn't the software - apparently the old driver for the USB-Serial converter did not work too well with XP-SP3. When the software is plugged into a computer with a 'real' com port, it worked fine.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question