08-29-2008 01:45 PM
Hello - I'm a VB.net guy trying like hell to get the hang of labview and I am stumped 😞
I have an boolean array which represents 7 led indicators. My piece of equipment (which is older than I am) gives a status byte and I am only interested in bits 0-2. The possible values are (000, 001, 010, 011, 100, 101, 110) or ( 0-6 depending on how you want to look at it) each one of these needs to be mapped to an led. So if the status is "5" I only want the 5th led to go true.
In vb.net I would just quickly type up 7 cases and be done. In labview I'm confused on if that would be the correct approach. It just seems tedious to have to make a seperate array buried in a select case structure 7 times. I must be missing something.
-Chris
08-29-2008 02:19 PM - edited 08-29-2008 02:19 PM
Seven cases? whoah VB is overachieving:
I left the labels of the functions on, so you can easily find them.
Ton
08-29-2008 02:23 PM - edited 08-29-2008 02:24 PM
Sorry I reread your post and it seems like you want to highlight the led# of the actual value, instead of the bit representation:
Here goes try 2:
Ton
08-29-2008 02:45 PM
THANKS!
Works perfect; I had a feeling I needed to use the replace array function but just couldn't get it to work. Of course it now seems so obvious. Thanks again.
08-29-2008 03:50 PM - edited 08-29-2008 03:50 PM
Here is an alternate solution:
If you want the output array to be only 6 elements then just use a Split 1D Array function.
08-29-2008 04:06 PM
smercurio_fc wrote:If you want the output array to be only 6 elements then just use a
Split 1D Arrayarray subset function.
08-29-2008 04:15 PM
altenbach wrote:
smercurio_fc wrote:If you want the output array to be only 6 elements then just use a
Split 1D Arrayarray subset function.
Oh yeah, forgot about that thread.
I don't have 8.6 but it would be interesting to run those benchmarks under 8.6 to see if there was any change and to update that thread.