What is a VISA reference? I assume it points to a memory location containing relevant information about the particular VISA resource. How large is this memory space?
It's not strictly a pointer, but you can think of it like that. It's a few bytes big, probably tens of bytes. If you really need an exact value, I can look it up for you, but I'd want to know why. The "relevant information" contains things like the name of the resource, the C viSession value, etc.
I'm not sure what you're getting at with this line of questioning. Is it just a memory/performance issue?
It is only a performance issue, though not just speed. The exact size of the memory is not important. The question behind the question is that I have noticed a considerably higher failure rate if I open and close the reference every time I use a particular instrument. If I have a "Get Waveform" that opens and closes the ref on each call sooner rather than later I get failures, some as LV errors, but more often as system hangs. This was the original motivation for this project.
I'm pretty sure it's not allocated until used.
I'm pretty sure it's left allocated, to make it easier to detect stale references.
This should make repeated open/close calls pretty efficient... or is there a lot more work in open than just memory allocation? Can you say more about what happens in a call to Open?
This might be a case where you want to open up different sessions to the same device, and use the VISA Lock and Unlock functions to protect them from each other.
I don't see a need for more than one ref/device. But I can imagine two one-icon VIs trying to operate on the same instrument at the same time and interleaving their read/write operations. I am imagining a semaphore with the name of the VISA ref.
BTW, I didn't mean for this to become an exclusive conversation, but for some reason my Cc's to info-labview have started bouncing :(
George
