Jump to content

Visa Resource Name and VISA session


jack9

Recommended Posts

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

Link to comment

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.

Link to comment

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?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.