LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

No error with VISA CONFIG SER. PORT when no cable connected

I'm using LV8.5 and VISA CONFIGURE SERIAL PORT.VI, with an error indicator connected, and I expect to see an error displayed when I have NO SERIAL CABLE connected to my pc. Shouldn't this condx generate an error? If not, what can I do to display an error when no cable is connected?
0 Kudos
Message 1 of 13
(2,866 Views)

Since you are wiring all of your errors through your VI you will not get a pop up unless you add one to your code see below.

 

Dialog.png

Tim
GHSP
0 Kudos
Message 2 of 13
(2,864 Views)
Aeastet, that's not the problem I'm having. You show an error indicator after the VISA READ.vi. I need to see an error before I get that far into my program. I put my error indicator directly after the VISA CONFIGURE.vi, and I thought configure couldn't configure if there's no serial cable connected to anything to talk to.
0 Kudos
Message 3 of 13
(2,862 Views)
You will definitely get an error If you have a loop around it.
0 Kudos
Message 4 of 13
(2,860 Views)
SO move the error indicator where ever you need to see the error. This was simply an example to show you how to get the error pop up.
Tim
GHSP
0 Kudos
Message 5 of 13
(2,857 Views)
Are you not seeing an error at all? If so the com port may be getting configured properly even if no device is present. You may need to send a command and wait for a responce to be able to get the error that you are looking for. I am assuming that you want to know if your device is connected.
Tim
GHSP
0 Kudos
Message 6 of 13
(2,855 Views)
Correct, I am not seeing an error at all. My error out indicator is displayed all the time, but no error is indicated. It appears you're correct in that "configuring" won't generate an error when no device is connected. (so then what is it configuring?)Yes, I can definitely get an error AFTER I try to read, but that's too late. I guess I'll have to live with that.
0 Kudos
Message 7 of 13
(2,851 Views)
Can you post a screen shot of your vi?
0 Kudos
Message 8 of 13
(2,848 Views)
You can make it so that the program looks for an error after the read. If it does it notifies you and then you can connect the device and have the system automatically reinitilize the system. We do this all of the time for when someone might disconnect the cable so that we can recover from the fault.
Tim
GHSP
0 Kudos
Message 9 of 13
(2,847 Views)

wb2nvy wrote:
I'm using LV8.5 and VISA CONFIGURE SERIAL PORT.VI, with an error indicator connected, and I expect to see an error displayed when I have NO SERIAL CABLE connected to my pc. Shouldn't this condx generate an error? If not, what can I do to display an error when no cable is connected?

 

Are you saying that you wan the configure serial port VI to throw an error if you don't have a cable connected to the serial port?

 

It can't.  How would the serial port know whether a cable is connected or not?  The VI configures the port which is the actual hardware implementation inside your PC.  It doesn't know what is happening beyond then connector on your PC.

 

You do have some alternatives though.  If the device you are going to communicate with puts any voltage on any of the hardware handshaking lines, you could check the status of the hardware handshaking lines and see if they are enabled or not.  If they are not, you can throw your own error saying the cable or the device is not connected.  Or if the device doesn't do that, you could make your own communication cable that does a loop back on the hardware handshaking lines.  If the line is not enabled, then the cable must not be connected.  Of course in that case it won't tell you whether the other end of the cable is connected to anything.

0 Kudos
Message 10 of 13
(2,843 Views)