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?)
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
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.