LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Vista USB communication issues

To whom it may concern,
 
     I am currently looking into using Vista to run the applications that I create with LabWindows v.8.0.1.  I use several com functions that are supplied with this version of LabWindows such as reading and writing out a particular com port.  When I power up my embedded module, I can communicate perfectly fine with a particular embedded module of ours via an interface cable that goes from RS-232 on the module side to the CPU's USB port when I am using an OS from MS XP and earlier.  But, when I use Vista, I get all sorts of communication errors and eventually, I end up getting kicked offline EVERY time. 
 
Are the com functions in V.8.0.1 incompatible with Vista somehow? 
 
Do I NEED to upgrade so that the distributions that I complie can be used in Vista flawlessly? 
 
The strange thing is that is the only problem that I am encountering.  I can install everything just fine in Vista, but anything related to the com port will not remain stable.  The drivers that I am using for the interface cable are made to be Vista compatible; Vista recognizes the interface cable that I connect with the CPU.  I am at a loss here, because I cannot develop anything with CVI until I understand what is going on with this issue.  I read something about V.8.1.1, but what does that have to do with anything? 
 
Are the com read and write functions in CVI v.8.1.1 (or higher) any different? 
 
This is the only thing that I can think is causing a problem at this point.  CVI works fine with communications pertaining to our modules and interface devices in XP or earlier OS (obviously Microsoft).  What's the deal with this? 
 
Is there a setting in Vista that I need to configure to make the apps that I creat work? 
 
Please advise. 
 
Thank you,
 
Chrisg101080
0 Kudos
Message 1 of 11
(4,370 Views)

Hi Chris,

What version of NI-VISA are you using? Can you please give me some information regarding the errors you are receiving?

The following link contains information regarding LabWindows and Vista.

NI LabWindowsTM/CVI 8.1.1 for Windows: Compatibility, Bug Fixes, and Upgrade Information

Thank you,

Simran K
National Instruments
Applications Engineer
0 Kudos
Message 2 of 11
(4,341 Views)
I am not sure exactly what version of NI-VISA I am using.  What's making my applications go offline in Vista?  Like I said, when I install my application on a Microsoft OS XP or earlier, I can maintain communication with my embedded module.  I do not have LabWindows on the Vista computer that I was testing, so I cannot determine what the error code is during debugging other than I lose coms.  All I know is one thing.  If I install my program on a computer with Vista, I will not be able to establish steady coms.  Something is different with Vista, and I am trying to ascertain if upgrading my LabWindows/CVI from V.8.0.1 is necessary, because right now, your software is useless in Vista it seems.  We've never had any issues communicating until we installed an NI volume in a Vista environment. 
 
BTW, I don't believe that I have used the NI-VISA before, and I don't intend on doing this if it's not going to help me get communications with Vista.  Tell me something.  What is new behind the scenes with the CVI 8.1.1?  Why should I get it if I don't need it? 
 
If you can't help me out, just let me know. 
 
Thanks
0 Kudos
Message 3 of 11
(4,320 Views)
Chris,

The COM function you used in the RS-232 library is actually part of a driver called NI-Serial. Most likely, you installed it from the driver CD that were included with your CVI CD. Since CVI 8.0.1 came out in late 2006, your serial driver probably doesn't support Vista. Vista wasn't release until early 2007. You can download the latest serial driver, which is Vista compatible, from our Drivers & Support page. You can either install it on the Vista machine directly. Or if you want to deploy to other Vista machine later, then you'd want to rebuild the installer to include the new Serial driver.
Regards,

Song Du
Systems Software
National Instruments R&D
0 Kudos
Message 4 of 11
(4,315 Views)

I think there is some confusion here. There are two ways of accessing serial ports in CVI: by using the built-in RS-232 library, or by using VISA function calls. As far as I am aware, the built-in library does not use VISA but is a thin layer on top of the Windows API calls for serial communications.

Assuming you are using the built-in RS-232 library, is it possible for you to establish that the serial port works correctly in Vista using a different application? Vista doesn't have Hyperterminal as standard but you can get it, or there are other (possibly better or more appropriate) serial comms applications freely available. Also, are you sure that you are setting all the necessary parameters for the serial port? Have you checked the default settings for the port in the Vista Device Manager? Are they different to the XP port settings?

--
Martin
Certified CVI Developer
0 Kudos
Message 5 of 11
(4,296 Views)
1.)  It works like this.  I have an embedded module that I interface with my CPU.  This is done by using an interface cable that converts RS-232 to USB communications.  I have uploaded the Vista drivers for the hardware involved with this interface cable and the problem persists - losing communications.  This cable doesn't have any problems with XP or earlier OS's, so I have to point my finger at Vista.  I check my device manager, and the device is recognized apparently, but it never responds as expected when actively interfacing the module with the LabWindows app. 
 
2.)  As far as I know, when I looked at the properties of the interface cable in the device manager, I saw nothing out of the ordinary.  The parity, baud rate and message format bits look like they are configured properly.  I already investigated this before I wrote the message. 
 
3.)  As I expalined about the device manager items, I had the port configured correctly, but is there some security setting that I can alter?  I was not able to find that out.  Vista is still a bit foreign to me.  Once again as far as I could see, the XP settings reflected the Vista settings. 
 
What's the deal with the NI-VISA?  How do I use this item and integrate it into my source code or project if this helps with Vista communications?  Is it a simple install and away it goes when it builds executables and installation packages?  As far as I have known, I have used only basic com functions like reading and writing (with of course the com port configurations functions) supplied with LabWindows V.8.0.1.  The programmed com routines in my application aren't the problem.  In other OS's, I can read and write out the com port all day without any issues, but currently not in Vista.  I don't see how ComRd and what not actually perform when I debug my program, so I have a grey area there that probably is my problem.  I don't believe that I have to write all of our applications' sources all over again just because Vista comes out.  I will try what the previous message poster put up about updating the NI-Serial drivers and I will reply with the results when I have finished validating.  Thank you for your input. 
 
Chrisg101080
 
0 Kudos
Message 6 of 11
(4,280 Views)
Let me try to clear up a few things. First of all, if you are using CVI's RS-232 library (with the ComRd, ComWrt, etc functions) on a Windows (not Real-Time) machine, then you are not using NI-VISA. Only on Real-Time targets does the RS-232 library use NI-VISA under the hood. Secondly, unless your serial hardware is some NI PCI serial board, you are probably not using the NI-Serial driver. If you're using the built-in serial ports on the computer's motherboard, then you're almost surely using whatever serial driver came installed with Vista.

The implementation of the RS-232 library in 8.0.1 is pretty much the same as it had been for years and years. The main issue is that the library is a (moderately complex) layer on top of the Windows API for doing serial communication. It is possible that there are some differences in the way that Windows responds to these function calls in Vista. Given the sensitive nature of RS-232 communication, depending on how a particular application has been written, this may cause problems. I am not aware of any specific problems with the 8.0.1 RS-232 library on Vista, though as you're probably aware, CVI 8.0.1 is not officially supported on Vista.

If I were in your shoes, I would tighten up my error checking/handling to try to get a more specific understanding of what exactly is going wrong. This may help you figure out if it's some system issue, or your program's intolerance to timing changes, etc. One quick thing to try is opening your com ports with OpenComConfig and passing -1 as the output queue length. The intermediary output queue can often make a program especially sensitive to system changes, because it delays the actual writes until a thread switch.

Mert A.
National Instruments
0 Kudos
Message 7 of 11
(4,264 Views)
Well, I tried installing the latest version of NI-Serial, and to no avail, I am still not getting coms with my application.  I included it in the build along with the latest NI-VISA, and still I get no luck at all.  What's going on?  This forum is the painful.  No one can really understand what I am dealing with at all.  I am the one getting asked the questions here it seems.  Regardless, I am not able to use NI for anything in Vista.  What next?  Why does everything work on XP with my module and interface cable and not in Vista?  I have the drivers installed for Vista that is for the USB IC, and it is recognized in Vista.  I am becoming frustrated when I do this stuff.  Too bad it costs money to actually receive support via telephone conversation.  AGAIN!!!
 
I specifically installed ONLY the software from May 2006 Developer Suite, LabWindows/CVI Full Development System for Windows 2000/XP V.8.0.1.  That is all I have on my CPU, period.  Am I going to be unable to do anything with Vista communicating via the serial port?  We are talking basic communications here; I can't send a single message to my module.  It has to be Vista.  I have never seen this problem on another OS at all. 
 
Once again, do I need to update my LabWindows to V.8.1.1 or whatever to get my application to maintain coms in Vista?  I don't need the NI-Serial, NI-VISA.  I didn't even know what those apps were before I started posting the issues that I have been having, so I don't believe that that is what I should be using.  Do I need to drastically change what I am doing to make this stuff work, such as my LabWindows environment?  I mean, your Com Rd functions really have to change that much for Vista?  My port settings are the same as they are in XP per my device drivers on XP and the test Vista CPU.  What else can I do at this point?  Please help. 
 
Thanks
Chrisg101080
0 Kudos
Message 8 of 11
(4,261 Views)
Good, now that we have that figured out that I'm not using NI-VISA or NI-Serial, that's about the only thing that I've completed or learned at this point. 
 
So, according to Mert, for every single application that I've written using the com port to communicate with my module via the CPU, I have to add more error check conditions?  I don't even have a Vista supported LabWindows/CVI to debug on.  So, I suppose that I need to get the new version of LabWindows to program in Vista now?  I won't get a com error on any other OS, especially XP on my PC that I typically compile my projects with.  What a bummer.  All of a sudden Vista comes out, and all the problems begin.  More over, all the money comes out of the pocket.  I hoped that I can find out definitely if the installer package that V.8.0.1 creates is not fully compatible with a Vista OS.  I mean, the modules that I am talking to are not 'blazing' out com messages to the CPU.  I don't think that Vista is firing out the com messages faster than it should either.  If simple serial communication is that big of an issue, I really don't like Vista.  If I don't resolve this issue, I'm stuck with a whole bunch of SW that's no good to the next revolution of MS operating systems - Vista.  Who'd have thought after all these years.  What a pain in the neck. 
 
Thanks,
 
Chrisg101080
0 Kudos
Message 9 of 11
(4,249 Views)
Chris,

I don't mean to suggest that porting applications to Vista necessarily means adding lots of new error checking code. All I'm suggesting is that if you have an app that does not already handle errors in a robust way, and it keeps failing when run on Vista, it would be a good idea to make sure you're error checking and maybe log some errors to a file or launch some MessagePopups that can tell you what specific problems you're running into. You don't need to have the CVI environment on the Vista machine to do that. It sounds like right now your application is a black box that just "fails".

Also, I would be somewhat wary of the USB/RS-232 interface. I have heard several mentions of USB-to-serial problems on this forum. It might be worth trying to figure out if anyone else has had success with that interface cable on Vista. Just because it is recognized doesn't guarantee that it's going to work exactly as it should.

Mert A.
National Instruments
0 Kudos
Message 10 of 11
(4,239 Views)