Showing results for 
Search instead for 
Did you mean: 

Stupid Question: export enum to csv?

Go to solution

I will be putting together a rather large statemachine, the state will be annunciated on an HMI via ModbusTCP.

That HMI has a tool 'Message Display' that looks up a text string to display from an integer value.

I would like to avoid having to keep this display in sync manually with a large enum typdef that I will be constantly editing, so I was poking around in labview, with another, smaller, enum typedef hoping there was some means of getting the item list (as seen when you edit items) into excel, for cut-n-pasting into the HMI's tool.


Don't see it. Anything built in?



I suppose I could write something to run on my development machine....anyone done this already - perhaps?


From an item list to a csv or text or xls file??




0 Kudos
Message 1 of 4

Create a Strings[] Property node from your enum and then use an Array to Spreadsheet String to get your CSV.

Message 2 of 4
Accepted by topic author S1ack

Or use "" found in vi.lib\utility\VariantDataType.  Wire in an enum, get out an array strings containing the enumeration names.  Has the advantage that it doesn't require access to the front panel and works on RT.  I once wrote a little VI that used this to automatically generate a C header file containing enumeration values to keep the C and LabVIEW code in synch.

Message 3 of 4

nathand - thanks that worked a treat.

still a manual operation for me (still must paste output into HMI dev tool) but no typos can be inserted accidentally.


0 Kudos
Message 4 of 4