LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Usage of user data in property node

Solved!
Go to solution

Dear all,

 

I am trying to understand the usage of a property node in a LabView driver for a Keithley 27xx. It's actually used in many of the supplied vi's, I uploaded a timing vi as an example.

In the example one can configure the timing. I want to change the number of power line cycles (NPLC) for voltage and temperature measurements. The code that should be written is something like

:VOLT:NPLC 1

:TEMP:NPLC 1

The property node specifies which element of the string list to take, but where does that number come from? In my tests it was always "0", so I got :VOLT:NPLC 1 as a command.

I have read the help files on property nodes and the user data but I don't understand how it works in this vi and how I can manipulate the output.

Can someone please give me a hint?

 

Thanks!

Philipp

 

0 Kudos
Message 1 of 5
(3,098 Views)

User Data is a rather nasty property.  I avoid using it.  Since it is "Per Session" it can be very difficult to debug.  Worse, it tends to lose its value when all vi's using the session go idle since it's not stored in the VISA Session Cache (That nice feature the automatically re-opens previous VISA Sessions if they have been opened before or creates a new session without a VISA Open call)  Since the darned property value is "By Session" it is expected behavior for the value to "Poof away" like that leaving you with a 0 default when you expect something else.  Where did you get the driver? is it latest? It most likely needs mod to work right for you (querying the Measurement type would be better).  


"Should be" isn't "Is" -Jay
Message 2 of 5
(3,075 Views)

Thanks for the quick reply Jeff!

The driver is latest, I downloaded it from ni.com some days ago. The same driver is also available from tek.com.

I still didn't understand how the user data is changed and how I can get different values, but I understand that a "per session" property can cause difficulties. I might just send the commands directly and don't worry about the driver vis. I thought it might be more convenient with the pre-configured vis, but maybe it's not.

0 Kudos
Message 3 of 5
(3,032 Views)
Solution
Accepted by topic author pwendel

User data value is lost whenever all VIs using the session go idle (not running) 

 

the driver vi's expect that some caller stays running.  I would simply modify the driver by opening Tree.vi and doing a text search for "User Data on the BDs of the members and seeing what data is stored there.  Then replace the readss of user data with an instrument query to find the device state. If you zip the driver and attach it Ican help you with the changes.


"Should be" isn't "Is" -Jay
Message 4 of 5
(3,024 Views)

Hey Jeff,

your hint to search for "user data" in the driver tree made me understand how it's used! Another vi is needed to set the user data and the timing vi just recalls it..

I made a small test and now I can write and read the information, the commands LabView sends to the device are

VISA Write ("GPIB0::16::INSTR", ":TEMP:NPLC 1.000000 ,...")
VISA Write ("GPIB0::16::INSTR", ":VOLT:NPLC 1.000000.")
as I want.
Thanks a lot for the offer of modifying the drivers for me, that's very kind!

I think I will either use a traditional GPIB write or try the drivers as they are delivered. For my application I think it's just extra work to do any modifications with little benefits.

Greetings from Germany!

Philipp

Message 5 of 5
(3,017 Views)