LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a ring control be populated using a separate text file when VI loads (not running)?

I would like to know if there is a way to populate a ring or enum control list using values maintained in a text file (or other format) outside of a VI.  I have to be able to call this VI from TestStand or LabVIEW, and would like to be able to use the drop down interface to pick from the list of selections.  As a result, the ring or enum list would need to be updated before the VI runs.  I want to avoid just using a string to prevent typo's from creating errors.  There would be several different VI's getting the list values from this text file.  Is this possible, or am I way off base?  Or does anyone have any other ideas or suggestions?
 
Thanks everyone,
 
q.
0 Kudos
Message 1 of 5
(3,401 Views)
Ring controls are very easy. Enum strings cannot be easily changed, if at all, at run time. For a ring, get a property node with the Strings[] property. The datatype of this is an array of strings. Write to it to set the strings. Read the array and use the numeric value of the ring as the index to an index array function to get the currently selected string.

Lynn
0 Kudos
Message 2 of 5
(3,398 Views)
Also remember you don't have to populate the strings before the VI starts running - just before the front panel opens. This is why I always like to open a VI's front panel programatically rather than depending upon the setting in the VI properties dialog.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 5
(3,380 Views)


johnsold wrote:
Read the array and use the numeric value of the ring as the index to an index array function to get the currently selected string.

You can also use the Ring Text.txt property to directly get the currently selected string... Smiley Wink
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 4 of 5
(3,372 Views)

Thanks for the replies.  I had a chance to play with ring controls and updating the string array dynamically.

However, as I mentioned in my first post, one of the reasons I want to use dynamically updated lists is to have a readable drop down list in TestStand when you configure a step (i.e. Specify Module).  This would help serve as a part of a hardware abstraction layer, and for maintainability purposes we don't want to split the hardware map among a number of VI's.

Unfortunately, TestStand doesn't seem to recognize the string list from a ring control.  And as mentioned above, there are issues with updating Enums.  Is it possible to accomplish a way of dynamically populating this list in such a way that TestStand will recognize it?  Is there another control that would work better (e.g. list boxes, combo boxes, etc.)?

Thanks for your help,

q

0 Kudos
Message 5 of 5
(3,330 Views)