03-05-2009 07:10 AM
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
03-05-2009 07:26 AM
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.
03-05-2009 09:36 AM - edited 03-05-2009 09:36 AM
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.
03-08-2009 03:01 AM
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
03-08-2009 05:57 PM
03-09-2009 01:16 AM
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
03-09-2009 10:55 AM
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
03-09-2009 11:22 AM
03-09-2009 02:26 PM
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
03-09-2009 03:06 PM