Example Code

Program String and Values in Ring and Menu Controls

Code and Documents

Attachment

Overview

I was attempting to use a text ring control to set the current ranges for an Keithley SMU.  The lowest current range is 100nA.  I attempted to drop down a ring control and then under "edit Items" set the current ranges and feed the values of control to SubVI used to program the instrument.  I found that when trying to set the value to 100e-9 the value would always get coereced to 1e-6.  I further determined that 1e-6 was the smallest value I could put in the values column.

Description

I submitted a support request to NI and worked with them to come up with a workaround to this bug (Corrective Action Request CAR #42950) and they showed me how to directly program the items of the ring control rather then using the normal "right click -> edit Items" method.  Basically the attached VI creates a text ring control that can be copied and pasted into another VI directly with the proper values less than 1e-6.  The interesting part is that after this new control is created it is possible to use the "right click->edit items" method to program values <1e-6.

Steps to Implement or Execute Code

  1. Please see attached VI for how to create the custom control

Requirements

Software: LabVIEW 2013 or greater

Hardware: Not Applicable

Additional Images or Video

Picture 1 and 2 are a before and after image of the bug and the fix

RingControl_Snapshot_Bug.JPGRingControl_Snapshot_Fix.JPG

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors