01-31-2008 08:36 AM
01-31-2008 08:59 AM
The USR keeps its value as long as the VI is in memory, even if the entire hierarchy stops running, so if you ran your code once and then ran it again without unloading the VI, it will return T even on the first call.
I decided this worked yesterday but today it doesn't. (Any explanation on that anyone?)
02-02-2008 09:54 PM
Here is the path to a vi that I use to check to see if any ports are open you can then use the refnum you need from the array if the port is open. It is also useful if you need to make sure all ports are closed, just run the array into a for loop with a VISA Close.
CLA, Certified Trainer
02-03-2008 12:11 AM - edited 02-03-2008 12:12 AM
02-03-2008 08:18 AM
The only problem I have with the "detect first time" method is that it is very easy to leave a COM port in an unknown state especially if you have improperly terminated a program and have not exited the LabVIEW system you get a "hung" port. LabVIEW has the port reserved as open but the program no longer has the session. I am attaching a program that should provide the functionality Rodnebb is looking for. I am also attaching another quick vi that I have found very useful and that one is for resetting all open COM ports.
02-06-2008 02:07 AM
02-06-2008 09:24 AM