LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Populate a Ring or Enum Control from File (not at runtime).

I'm trying to populate a ring control (type def) but I've not found any way to do it.  I have an extremely long list that I would like to put into a ring control and I want to do this such that it is 'hard coded' in the ring control.  A delimited file (anything but a space) is what I would imagine should be easily imported into a ring or enum.

 

Does any one know how to do this or some other method for a long list of items?

 

0 Kudos
Message 1 of 6
(3,805 Views)

Hi Nathan,

 

read the file, convert it to an (1D string) array using SpreadsheetStringToArray and write that array into an property node "strings[]" of your ring...

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,802 Views)

Your suggestion is done at run-time, as far as I can tell.  I do not want to require the file during run-time.  After importing I'm wanting to save the type def and then be able to edit the items in the Properties dialog.

 

I'm ultimately trying to create a library for a sensor that has a lot of register adresses that will not change on the device.  The register addresses are the items that I want to put in my typedef.  If the above is not possible, is there any other alternative?

0 Kudos
Message 3 of 6
(3,770 Views)

Is this any better?

https://decibel.ni.com/content/docs/DOC-22702

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 4 of 6
(3,761 Views)

Am i missing something here???? Why couldnt you just import the file to the Enum and then create a type def from the one that is populated????




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 6
(3,752 Views)

Creating a type def from the ring in Gerd's code does work.  Thanks both of you.  Here is what I ended up doing:

 

TabbedTxtFile_to_Ring.png

0 Kudos
Message 6 of 6
(3,733 Views)