jack9 Posted July 11, 2008 Report Share Posted July 11, 2008 Hi to all, I'm newbie with Labview 8.5, I'm viewing some example to connect serial port with VISA blocks. I see that these examples use a VISA Resource Name control to define the resource (example selecting COM1) but after they don't use Visa Open block to open a VISA session with the device, but they use directly the sequence "VISA write - VISA read - VISA Close" blocks. Why don't they use VISA open session to open a session with device? I read in help that VISA Resource Name contains some informations on resource and it maintains VISA session also, instead VISA session is a unique identifier, I think that when I create new Visa Resource name Control, Labview automatically open a session with this resource, so it isn't necessary to use VISA Open block to create the session, isn't it? best regards Quote Link to comment
jpdrolet Posted July 11, 2008 Report Share Posted July 11, 2008 The VISA session is opened implicitly when using other VISA nodes so no you don't have to use VISA Open. I've found some use to VISA Open when I needed to lock the session for an "atomic" sequence of commands to avoid other parts of the code to talk to the device at the same time. Then each part of the code using the resource had to open its own VISA session, and get an exclusive lock on the resource before communicating with the device. Quote Link to comment
jack9 Posted July 12, 2008 Author Report Share Posted July 12, 2008 Ok, thanks I try to use VISA Open with lock property: I have two sequence "Open - Read - Close" and I wish that they access to serial port in mutual exclusive mode. I set each VISA Open block with Duplicate_session= True and access_mode=exclusive_lock, I create a resource name constant that it is the input for two VISA Open block. I note that if the Close block of a sequence is executed, all sessions are closed and other sequences can't read from serial bus because the session of second sequence is closed by Close block of first sequence. My question is: Close block closes only session of resource name that use as input or closes also other duplicate sessions? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.