02-25-2013 10:21 AM
Hi,
Is there a way to convert a h header file to Labview?
I would like to read the #define and the enum.
as an example:
enum CONFIG
{
CFG_PERIOD=0,
CFG_DATE_MSB,
CFG_DATE_LSB,
...
CFG_RATE,
}
#define A_PORT PortF
#define A_TX_PIN 6
#define A_RX_PIN 7
Thank you,
Julien
02-25-2013 10:39 AM
I found one converter for enum but it's 'manual' http://forums.ni.com/t5/LabVIEW/creating-enum-from-list/m-p/126383?query.id=0 and solve only the enum problem
02-25-2013 01:28 PM
I'm not aware of any but you can use VI scripting which should allow you to create the ENUM programmatically. You will need to do some string parsing yourself. If the ENUMs are not 0 based or are not consecutive you can use a ring to represent the values. Unfortunately updating a typedef of a ring does not update the values of any constants or controls linked to it.
02-25-2013 03:02 PM
Note that you can script a VI containing an array of strings indexed by a ring to get the #defines. Populate the ring with the names, the string array with the values. Call it anywhere you need the #define values.
02-26-2013 07:44 AM
I add the c enum to Labview enum from the link. I updated it to 2012 and added name of the enum.
Thank you for answers