03-22-2018 10:15 AM
My one main experience with TestStand involved putting together a class-based HAL when I was also pretty new to LVOOP. So I was a bit of a noob at the time, plus my memory of it isn't clear and thorough. With all that as caveat, I'll try to comment.
I too struggled with the need to instantiate an instrument, open its communication connection just once, and then be able to use that instrument object (and it's initialized comm reference) repeatedly. I wound up making a little Action Engine lookup table for the instantiated objects with their comm references. I called it my instrument registry. I think I had to do another thing like launch a background LabVIEW process that first made an initialization call to the registry, and then just ran idly to prevent garbage collection on the comm references while I was executing sequences.
When retrieving a "live" instrument object from the registry, the terminal must have been of parent type already. I don't recall needing to cast it before calling the dynamic dispatch HAL functions.
It's possible all the "registry" mucking about I did wasn't necessary but it was the solution I managed to find which preserved open comm connections.
-Kevin P