LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean flags passed to Call Library

I have a DLL library function that takes a "flags" value, which is the boolean OR of a bunch of bit flags. What is the best practice for a front panel for the set of flags, and the block diagram for combining them into an unsigned 32-bit flag value?

Of course, I can put a bunch of boolean switches on the front panel, and use a bunch of select objects to convert them to their unsigned values. But this brute-force solution does not scale well.

Any ideas?

(I'm new to Labview, and have spent a grand total of 25 hours working with it, so forgive my terminology. I'm an old C programmer, so I may talk in C. Please forgive that, too!)

Thanks.
John.
0 Kudos
Message 1 of 3
(3,012 Views)
A "set" of booleans is nicely displayed by an "array" of boolean LEDs. The array also allows for easy scaling. As for your block diagram, If you're not passing in the full array, but the elements themselves, you could use a For Loop with auto-indexing, wiring in your flag values to an Initialize Array vi, and each loop will add your next flag to the final array (LEDs). To easily convert your final array to a numeric, wire the array to the Boolean Array to Number vi.
Good Luck with it, Doug
0 Kudos
Message 2 of 3
(3,012 Views)
Thanks, Doug! An array of boolean LEDs is exactly the kind of thing I'd never think of, due to my limited experience with LabView. You could NEVER do this with Windows!

john.
0 Kudos
Message 3 of 3
(3,012 Views)