12-19-2012 07:14 AM
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
Solved! Go to Solution.
12-19-2012 08:04 AM
12-19-2012 08:36 AM
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.
12-20-2012 06:32 AM
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.
12-20-2012 09:02 AM
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
12-21-2012 06:36 AM
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.
12-09-2013 03:36 AM
It looks like you can use "Not a Number/Path/Refnum" on a "VISA Session" reference to check if the port is already open.
12-10-2013 12:10 PM
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 ?