LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem in "Is port connected"

Hi Ppl,

I am using state machine arctitecture to build my application.

in the Initialization phase, i configure my hardware using VISA.

and my applicaition starts recieving data from the H/W. 

i want to put some kind of check to see whether or not the device is still connected. 

i used "Is port connected" property in serial settings, and found that it always returns FALSE, even though my device is connected and sending data.

 

my basic problem is to get a method to check whether the H/W is On/Off ??

how can i achieve this ??

 

Thanks,

Ritesh

Message 1 of 12
(7,301 Views)

With serial ports (rs232) are avaliable or not.  To know if a device is connected it usuallt involves a querry or at least a write to the device.  I use a queued state machine for my serial devices which usually have an open, reset, close, read commands, write commands and querry commands.  If any read, write or querry fails an error handler catches this, the device is reset and the connand is retried upto n times.  This has worked well for me.  Serial is sometimes tough because the open and configure port does not tell you if a device is connected until a command to the device fails.  Many devices have a *idn? or some other passive querry to test that a device is actually on and connected.  This is how I handle your situation, but there are many other methods to acomplish the task.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 12
(7,299 Views)

The "Is Connected" property does not work in the "general world". From the Help:

 

 

Another option is to use the serial port line states, if your hardware makes use of them. For example, you could monitor the DTR line. 

Message Edited by smercurio_fc on 03-05-2009 09:36 AM
Message 3 of 12
(7,270 Views)

Hi falkpl,

 i got that.

i tried implementing your solution.

 many a times when i Configure my Hardware with VISA, i get an error, "hardware is valid, but VISA  currently cannot process it" .

it might be if the H/W wasn't closed properly.

so i close try to Close that rsource and Configure it again. and when i close it, it doesn't close it and gives me an error.

i didn't get why on closing the H/W, it's giving error.

N whats the remedy to the problem ?

 

Thanks,

Ritesh

0 Kudos
Message 4 of 12
(7,235 Views)
Many times, the reason you get that error is because another program (i.e. Hyperterminal) is using the port.
0 Kudos
Message 5 of 12
(7,218 Views)

Hi Dennis,

Is there any way to forcefully Close the Port as i want my hardware to have the highest priority for using the port.

 

Thanks,

Ritesh

0 Kudos
Message 6 of 12
(7,205 Views)

Hi Dennis,

i am seeing that there's no other program which is opened while i am trying to configure my hardware and am still getting the same problem.

why is that happening now ??

 

Ritesh

0 Kudos
Message 7 of 12
(7,184 Views)
We are talking about error code -1073807246, correct? Besides the obvious programs that you might manually start, check the services that are running. Sometimes with serial ports, you could have a modem program running in the background.
0 Kudos
Message 8 of 12
(7,177 Views)

Hi Dennis,

i dont have any other program running on it except LabVIEW..

N i dont have any modem program running too .. no bluetooth .. nothing ..

N still m facing the problem .. 😞

 

Isn't there any way to forcefuly Close the Port from LabVIEW and reconfigure it ??

 

 

 

Ritesh

0 Kudos
Message 9 of 12
(7,162 Views)
The only time I have seen that error is when a progam other than LabVIEW has got the port open and it does no good to close it in LabVIEW because LabVIEW has not been able to open the port in the first place. See if you can open the com port in Hyperterminal. If there is another process that has gotten hold of the port, you'll get an error message in Hyperterminal as well. That won't isolate the problem but it will help confirm if another program might be active.
0 Kudos
Message 10 of 12
(7,157 Views)