11-14-2014 02:56 AM
I am currently working on a remote control of a laser using VISA and the actor framework. My Actor (basically an object) holds a VISA address and upon startup the termination character in a "Configure.vi" (see attachement). The object is then passed on and the first query always works but all subsequent ones fail, reason beeing that the termination character is reset from 13 to 10.
Also in the attachements is how I currently send my commands to the VISA device. I just write the command, read some data back (it shouldn't really read 256 bytes but that is why I use the termination character) and close the VISA session. So does one of these steps reset the termination character setting of the VISA device? Note that I do not store the VISA address back so I would expect it to be a copy of the one stored in my object. So even if something would change its settings, that should not affect the origial one. But I am clearly missing something here.
11-14-2014 06:12 AM
11-14-2014 06:47 AM
Closing the reference resets the settings. You should only open the session once at the beginning of your program and only close it at the end. This is a good practice for all references.
11-14-2014 06:54 AM
Thank you for the clearification. I thought it would be cleaner to close the session after each request. Learning every day!
11-14-2014 03:24 PM