LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Taylor.Kendall

#define for Rings or Enums

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined. 

Offten I will get handed a PDF of something like this 

 

 

#define PMC_STATUS_5V_ABOVE_POWERON           0x0001

#define PMC_STATUS_5V_ABOVE_BROWNOUT          0x0002

#define PMC_STATUS_12V_ABOVE_POWERON            0x0004

#define PMC_STATUS_12V_ABOVE_BROWNOUT          0x0008

#define PMC_STATUS_U31_PG                 0x0010

#define PMC_STATUS_U30_PG             0x0020

#define PMC_STATUS_3P3_PG                               0x0040

#define PMC_STATUS_USB_RESUME                                0x0080

#define PMC_STATUS_U31_DCDC1_PG  0x0100

#define PMC_STATUS_U31_DCDC2_PG  0x0200

#define PMC_STATUS_U31_LDO3_PG  0x0400

 

 

I want a simple way to impor this into labview and doe bitampping besides this 

 

Untitled.png

which seems like a very messy solution to a thing that is very easy to do in every other language. 

 

3 Comments
RavensFan
Knight of NI

What makes it "very easy to do in every other language"?  If every other language is also text based, then it is pretty easy to do to just copy and paste.  But LabVIEW is not text based, so some work needs to be done.  You basically need a utility to do this work for you.  And that is exactly what you have shown?

 

So how do you expect to do it in LabVIEW any easier besides reading the text and parsing it to come up with a list of items and values?

Intaris
Proven Zealot

Why don't you store the flags as a cluster of booleans with "reserved" entries entered where a HEX value is not currently defined.  That way you can simply do a "Cluster to Array" followed by a "Boolean array to number" to get your final value.  The reverse can also be done to get the individual flag status back.

 

Your solution seems to be insanely complicated to achieve this.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.