Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GetComConnectionState returns unknown system error

This one is a bit goofy. We have been running with NI PCI-8431/8  485 cards for some time now.  Occasionally we would get intermittent port failures that we could not explain, but they were rare enough that it didn't concern me much. Today 08/24/2006 I downloaded and installed the lastest serial driver from NI. Version 1.8 and now I had to turn off the function call GetComConnectionState(port) because it returns a "Unknown System Error".  The port appears to be working correctly. At least it is talking with UUTs.
 
Starts at port 3 and goes to port 10
9600 baud
8 bit
1 stop
No Parity
485 Modbus Ascii.
 
Why would NI library calls not recognize NI hardware? And why only now with the Latest and Greatest Driver? Anyone have a clue?
 
Running System2000.
Labwindows/CVI Version 8.01
Version 1.8 Serial Driver
If I have forgotten any particulars, please excuse. This one has bugged me until VERY late in the evening. It's not often that I remove error checking to get around a problem.
 
Leon Black
ABB/TOTALFLOW
0 Kudos
Message 1 of 4
(3,934 Views)
Hi Leon,

The GetComConnectionState function call is only supported on a subset of our RS232 hardware, and is not supported at all on our RS485 hardware.  This function actually checks to make sure that valid RS232 voltages can be found on the RS232 input pins to verify that a physical connection is actually present.

 To see a list of supported hardware interfaces, see the following location in the Serial Hardware and Software Help, which can be found under NI-Serial on the Start Menu:

Serial Hardware and Software Help>>Using Your Serial Hardware>>Advanced Features

The column entitled RS-232 Transceiver State lists those interfaces which support this operation.

I find it interesting that this function was working (or at least appeared to work) with a previous version of NI-Serial with RS-485 hardware.  Which version of NI-Serial did you have installed previously? 

As a result of your inquiry, I am reviewing the documentation which is provided for this function, and will notify the proper people that more clarification is needed on the scope of the GetComConnectionState function.

Thanks,

Jason S.
GPIB & Serial
National Instruments
Message 2 of 4
(3,922 Views)

Thanks Jason,

Actually it is still working on systems I have not upgraded to version 1.8. We have 8 calibration stations currently working under labwindows/CVI. 2(Two) have been upgraded to NI-Serial version 1.8 and the rest are still at 1.7. The ones at 1.7 do not give the system error response. The thing I should probably try is to NOT configure the ports at all and see if I get any kind of different response.  The problem could be, I have been working under a false sense of security.

This is not giving me headaches. I removed the function call and let the systems roll on. It was very late at night when I came across this after working too many hours in a row.

 

Thanks again for the Help Jason

 

Leon Black

0 Kudos
Message 3 of 4
(3,903 Views)
Hi Leon,

I rolled one of my test machines back to NI-Serial 1.7, and installed a PCI-8431/8 like those you are using.  I still receive the -1 error on version 1.7.

I can tell you without a doubt that the GetComConnectionState does not support RS-485 hardware, but I am still curious as to what is happening on your machine that makes it appear to work.  What return value to you receive with version 1.7 of the driver indicating that a valid connection is present?

Either way, the behavior that you are seeing with version 1.8 is the expected behavior with your hardware, and the call should be removed from your application.

Jason S.
GPIB & Serial
National Instruments
0 Kudos
Message 4 of 4
(3,875 Views)