05-02-2013 04:55 AM
Hi
I am trying to use VISA to fetch data from a USB port. The data is put into a queue which is decoded in another thread. The pic below shows how my vi looks like.
The problem is that after around 15mins of execution the windows got blue screen. The error message has to do with usbser.sys.
I was at first suspicious of the USB virtual COM port's driver. However after I eliminate the queue part of this vi the blue screen problem is gone. The modified vi is like this:
It seems that this queue is actually causing the pc blue screen problem.
I have tried it with several different pcs and got the same result. I am using windows OS. 64bit and 32 bit have the same problem.
The blue screen message is here:
Has anyone encountered the same problem or had some clue of this issue?
Thanks in advance!
05-02-2013 05:05 AM
You're only reading 16... Are you sure the buffer doesn't run full?
You might want to consider changing your driver. Connect the bytes at serial port output to the input of read data so you read everything...
Just try it and see what it does, this will help you on your way
05-02-2013 05:49 AM
I agree with Bjorn, the problem is still likely to be with your USB read implementation.
Consider the possibility that your system is not reading from the USB buffer sufficiently quickly. What value is in Bytes at Port? Is this value increasing rapidly (faster than you are reading?)
Removing the Enqueue function perhaps also indicates that the queue write is taking time and preventing the while loop from spinning fast enough which could occur if the queue has a maximum element count (maybe you define the named queue elsewhere with a count limit and are failing to remove the queued elements quickly enough to prevent it from filling up?). You have no timeout wired to the enqueue function which means it will wait as long as it takes, stopping the loop. You might be better with a short (10ms) timeout, followed by a check to make sure it doesn't timeout.
Also consider using shift registers on your while loop borders to ensure the VISA ref is maintained, the queue ref is maintained and the errors are maintained (although these aren't likely to be the source of your problem, it's always good practice to maintain your error data for handling).