Jump to content
News about the LabVIEW Wiki! Read more... ×
Sign in to follow this  
OptimisticDan

COM Ports always busy and I can't free them (8.6)

Recommended Posts

I have only been using Labview for about a year, so there maybe some simple setting I changed that I am un-aware of. However this problem has me stumped. I have several large programs that send commands and received data using the COM port, and these have been working in the past. However, in December a static discharge on our equipment damaged my PC's COM port on the motherboard. For about a month, I was using a USB-Serial adapter with mixed results but last week the USB-Serial started failing constantly. I finally got around to replacing my motherboard and getting a true COM port back thinking that would solve the problem, but the COM port still fails. Windows and MAX both see the port, however if I attempt to configure the port using VISA, I always get "Is Port Connected? = False" This is element 10 in the property node of the VISA device.

Our company has an independed software packaged to talk to our products using the same COM port and it works fine now that my motherboard has been replaced. Therefore I pretty sure All is well with Windows and the COM port hardware.

I've been using 8.6 for several months, but I still have 8.5.1 installed from a prior update. I loaded an older serial port VI into 8.5.1 and it works just find. When I load the same VI into 8.6, it fails.

I have used Close VISA.vi and Close Serial Driver.vi but they have no affect. It just seems that to my 8.6 installation of Labview, the COM ports are there, but not accessable. In MAX, I get the following error when I try to Validate the port; "Could not open a VISA session to "ASRL1::INSTR". VISA error code 0xBFFF0072. The resource is valid, but VISA cannot currently access it.

Thanks for your help.

Share this post


Link to post
Share on other sites

I was having an issue like this as well. Try Renaming the port from COM1 to say COM4 in the Device Manager and see if that helps.

I have not figured out what was/is trying to access the port.

Share this post


Link to post
Share on other sites

QUOTE (OptimisticDan @ Feb 11 2009, 10:12 AM)

I have only been using Labview for about a year, so there maybe some simple setting I changed that I am un-aware of. However this problem has me stumped. I have several large programs that send commands and received data using the COM port, and these have been working in the past. However, in December a static discharge on our equipment damaged my PC's COM port on the motherboard. For about a month, I was using a USB-Serial adapter with mixed results but last week the USB-Serial started failing constantly. I finally got around to replacing my motherboard and getting a true COM port back thinking that would solve the problem, but the COM port still fails. Windows and MAX both see the port, however if I attempt to configure the port using VISA, I always get "Is Port Connected? = False" This is element 10 in the property node of the VISA device.

Our company has an independed software packaged to talk to our products using the same COM port and it works fine now that my motherboard has been replaced. Therefore I pretty sure All is well with Windows and the COM port hardware.

I've been using 8.6 for several months, but I still have 8.5.1 installed from a prior update. I loaded an older serial port VI into 8.5.1 and it works just find. When I load the same VI into 8.6, it fails.

I have used Close VISA.vi and Close Serial Driver.vi but they have no affect. It just seems that to my 8.6 installation of Labview, the COM ports are there, but not accessable. In MAX, I get the following error when I try to Validate the port; "Could not open a VISA session to "ASRL1::INSTR". VISA error code 0xBFFF0072. The resource is valid, but VISA cannot currently access it.

Thanks for your help.

Works in 8.5 but not 8.6, that just does not make sense. Try doing a repair on your LV 8.6 install (use the install disks, that is one of the options) to see if that helps.

Ben

Share this post


Link to post
Share on other sites

Well I would check that

C:\Documents and Settings\All Users\National Instruments\NIvisa\Nivisa.conf exists (slightly different path on Vista) and has contents that look reasonable. Mostly that just helps you map ASRL1::INSTR to the more normal COM1. If it's totally missing I think bad things will happen and you won't necessarily get an error (this burned me a couple years ago, but maybe they've fixed it).

Have you tried NI tech support? It's good to ask on LAVA, but in general this is the kind of question they will handle better and faster.

Good luck.

Jason

Share this post


Link to post
Share on other sites

QUOTE (OptimisticDan @ Feb 11 2009, 11:55 AM)

Regarding the reply from ndunham, I just looked for the file mentioned (C:\Documents and Settings\All Users\National Instruments\NIvisa\Nivisa.conf), and it is not there. I searched the All Users folder &

I once had a problem where the "NIvisa" folder was not there and MAX was too dumb to either create it automatically or throw an error. Can you find any National Instruments folder anywhere in your Documents and Settings folder? (I may have made an error converting from my Vista path to the normal XP one). If you do have the NI folder with lots of other stuff but no NIvisa folder, then create the folder, run MAX, and try again with LabVIEW.

Share this post


Link to post
Share on other sites

QUOTE (jdunham @ Feb 11 2009, 02:22 PM)

I once had a problem where the "NIvisa" folder was not there and MAX was too dumb to either create it automatically or throw an error. Can you find any National Instruments folder anywhere in your Documents and Settings folder? (I may have made an error converting from my Vista path to the normal XP one). If you do have the NI folder with lots of other stuff but no NIvisa folder, then create the folder, run MAX, and try again with LabVIEW.

I have a folder,

C:\Documents and Settings\All Users\Documents\National Instruments\NI-VISA

but inside it there is only

C:\Documents and Settings\All Users\Documents\National Instruments\NI-VISA\Examples

Below 'Examples' are several sub & sub-sub folders, none of which contain the file NIVISA.conf. ???

Share this post


Link to post
Share on other sites

QUOTE (OptimisticDan @ Feb 11 2009, 01:04 PM)

I have a folder,

C:\Documents and Settings\All Users\Documents\National Instruments\NI-VISA

but inside it there is only

C:\Documents and Settings\All Users\Documents\National Instruments\NI-VISA\Examples

Below 'Examples' are several sub & sub-sub folders, none of which contain the file NIVISA.conf. ???

The "...\documents\" folders are probably not going to contain settings. I found an XP computer and checked, and my file is at

C:\Documents and Settings\All Users\Application Data\National Instruments\NIvisa\visaconf.ini.

(I probably missed "Application Data", and it's likely that XP tries to do you a favor by skipping that in your searching)

If you don't have that folder, then create it and run MAX, check your ports (maybe rename one), and then run LabVIEW.

If that doesn't help, and you already reinstalled VISA, then you'll have to keep working with NI Tech support.

Once you figure it out, everything should go smoothly after that. Anything you can do in HyperTerminal, you should be able to do in LabVIEW.

Good Luck!

Share this post


Link to post
Share on other sites

Its also worth knowing that C:\Documents and Settings\All Users\Application Data is a hidden folder so you will need to either have Windows set up to show hidden folders, or navigate straight there using Start->Run... or by typing the path into an Explorer address bar (I'm not sure if the explorer address bar is visible by default or not either)

Shaun

Share this post


Link to post
Share on other sites

This doesn't really fit with your statement that it works in 8.5 and not in 8.6, but just for a sanity check, I would try to open the port with Hyperterminal. If you can't open it there, it could be that the other program that is using the port is not releasing it properly.

Share this post


Link to post
Share on other sites

QUOTE (Shaun Hayward @ Feb 11 2009, 05:04 PM)

Its also worth knowing that C:\Documents and Settings\All Users\Application Data is a hidden folder so you will need to either have Windows set up to show hidden folders, or navigate straight there using Start->Run... or by typing the path into an Explorer address bar (I'm not sure if the explorer address bar is visible by default or not either)

Shaun

OK everyone, I found a work around for my own VI's which I will describe, but I still believe there is a problem with VISA caused I believe by the use of a Prologic USB-Serial poorly written driver.

My error always showed up in my serial port initialization vi, which only contained a single property node of the VISA reference passed to it (where I set baud, flow etc.). In the past, this property node also included "Port Connected?" output which we drove to an LED. Since I inherited this code, I don't know why it was being monitored since we never make a decision off of it's status. However that is also the variable that begin failing and the reason for this post. So I simply removed the LED and the output from the property node to solve my own issue. Now this sub vi works & all my programs work using this new version.

What I don't like is the fact that some time during my use of the USB-Serial device, NI-VISA got messed up into forcing the Port Connectted variable to False @ all times. If I needed to see this port status I would still not have a solution. I've left this possible error with NI Support, but I do want to thank you all for your help. By the way, Shaun & Jdunham I found the VIconf.ini file with your help. I backed it up, left the folder & let MAX re-create the ini. then both 8.5 & 8.6 Laview locked up when ever I did anything with VISA, so I diverted back to my original VIconf.ini.

Thanks everyone

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.