From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

OpenComConfig -1 queue size?

Solved!
Go to solution

I'm having issues with a USB comport adaptor on a Windows 7 PC. The program hangs sometimes when reading, writing, or closing the port.

 

My application is in CVI Version 8.1.0. This occurs running as executable and in the environment. When the crash occurs in the environment it says a nondebuggable thread has caused a fault at address 68647163, the address is always the same. The CVI environment and program cannot be closed, the only way to exit is to turn off the PC;s power.

 

This only happened on Windows 7 PC, on XP with the same adaptor it works fine.

 

I've read a couple posts which suggest using OpenComConfig with a value of -1 for the input and output queue size to eliminate problems. Here is one thread with this suggestion:

http://forums.ni.com/t5/LabWindows-CVI/Serial-communications-with-Windows-7/td-p/1253850/highlight/t...

 

When I do this, I get an error from OpenComConfig: -114 Requested input queue size must be 0 or greater.

 

How is it possible to specify -1 as the queue size? Is this not available in 8.1? 

 

0 Kudos
Message 1 of 3
(3,412 Views)
Solution
Accepted by topic author kmagas

If you carefully read the help for the command, setting queue size to -1 is permitted only for the output queue, in order to skip one level in the operating system and write directly to the port. In put queue size must always be declared as a nonnegative number.

Regarding your error the reason could lie at the driver level: have you installed the most recent release of the usb-to-serial adapter for your OS? I ma using several of those adapters both on XP and iwn7 with succesful results, but I need to use different drovers depending on the OS I install the device onto.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,404 Views)

Thanks for the quick answer. I was setting both queue sizes to -1. Setting only the output q size to -1 seems to have solved our problems.

0 Kudos
Message 3 of 3
(3,359 Views)