LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number to boolean array

Hello,

 

I would like the the binary number in the "resulting string" to control the case structure in a sequence. So, the number 9 should give "true", "false", "false", "true", to the case structure in a timed sequence. I cant seem to connect the boolean array to the case structure without getting errors.

 

Any help would be appreciated!

0 Kudos
Message 1 of 6
(3,416 Views)

No, you cant connect an array to a case structure. What you should to is to use "boolean array to a number" and use the resulting number in the case selector. As such, it'd be the '9' case.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 6
(3,405 Views)

A case structure takes scalars, not arrays.

 

Move the number to boolen array to the outer loop and auto-index the boolean array on the inner loop boundary.

0 Kudos
Message 3 of 6
(3,398 Views)

Hey there.

 

Yes, that is almost working. A new problem has emerged, the sequence that is transferred to the case structure does not match the output string. I doesn't send 1001. 

 

 

0 Kudos
Message 4 of 6
(3,376 Views)

I don't see any strings  as you describe. can you clarify what you mean?

Why is there so much duplicate code?

0 Kudos
Message 5 of 6
(3,347 Views)

Hi Rydman,

 

Do you care to explain what you want your program to do? Because as I see it you want to generate two different output arrays in a predetermined way. Then this would be my suggestion.

 

Put the Create channel and timing and SampClk.Rate outside of the while loop, as long as you dont want this to change between the generations. But still having it like now you will not really know where the code is when you change the values of front panel controls.

 

Within the loop I would use the Write, start, task done and stop task. I would stop the loop on an error and have your selection of cases just control the generation part.

 

The clear task and simple error handler I would have outside the loop to show errors and clear task when you stop the program.

 

As you have an array of output waveforms can't you just fill this array up with many waveforms?

 

Best regards
JM, LabVIEW CLA
0 Kudos
Message 6 of 6
(3,290 Views)