LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

*.h header file

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

0 Kudos
Message 1 of 5
(3,026 Views)

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

0 Kudos
Message 2 of 5
(3,021 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 5
(3,006 Views)

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.

0 Kudos
Message 4 of 5
(2,988 Views)

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

Message 5 of 5
(2,964 Views)