Jump to content

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


OptimisticDan

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.

Link to comment

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

Link to comment

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

Link to comment

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.

Link to comment

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. ???

Link to comment

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!

Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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