Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Session ID of VISA control

Solved!
Go to solution

Hi,

 

1. I was wondering if it was possible to get the Session ID for serial port via property node of the VISA control but I'm unable to find it but if I put the probe on the wire the Session ID is right there (see serial_session_id.png). Anyone knows a good work around?

 

2. When I browse through the property items of the VISA control I noticed that General Settings appear twice. This is confusing and I'm not sure if this is a bug or not (see instr_property.png)

 

I'm using LV 2012 with NI-VISA 5.2

 

Download All
0 Kudos
Message 1 of 8
(6,882 Views)

Where do you need the session ID for?

Just use the wire or the visa resource or even a local for the wire.

greetings from the Netherlands
0 Kudos
Message 2 of 8
(6,879 Views)

If the port has a Session ID != 0 then I know that this port is already opened. I do not use exclusive lock on the port, so I figure looking at the Session ID is the easyest way to determine that the port is alocated or not. On the other hand it is just annoying that I can't reach Session ID through property node while it shows on probe.

 

 

0 Kudos
Message 3 of 8
(6,877 Views)
Solution
Accepted by topic author 3DVision

Hi,


You can achieve that by using The Reffnum to session VI.

 

Please find attached an example.

 

Best regards,

Ion R.

 

Don't forget to mark the solutions. Kudos are welcome.

 

Message 4 of 8
(6,844 Views)

Tnx ion.rosca,

 

this is exactly what I was looking for but could not find it on the VISA palette anywhere. I wonder why this is not implemented (yet) in to property node?

 

Cheers

0 Kudos
Message 5 of 8
(6,831 Views)

I don't think that is a property that you will need in LabVIEW. Normally you are not interested in session ID because you can pass the reference to all of the VIs in order to program.

However, the session ID will be needed when you want to pass the reference to other environments, that's why it is a special function that will return it.

 

Best regards,

Ion R.

0 Kudos
Message 6 of 8
(6,818 Views)

It looks like you can use "Not a Number/Path/Refnum" on a "VISA Session" reference to check if the port is already open.

0 Kudos
Message 7 of 8
(6,537 Views)

Hi

I tried to find help on this Refnum to Session ID in LV2013.

 

It simply did not return any help, except in the helpwindow from LabVIEW but not where it can be found on the palette or how we should use it.

 

Can it be included in the help or is this one of the undocumented functions ?

greetings from the Netherlands
0 Kudos
Message 8 of 8
(6,507 Views)