06-29-2022 08:27 AM
Hi all,
I'm trying get this bit in Labview:
If x % 2 == 0 then
boolean_var = true
else
boolean_var = false
(x is counting up by 1 after a certain operation has taken place)
My attempt at doing this can be seen in the file attached. It's part of a far bigger code, that's why I only attached a snippet of it. I'm not sure if quotient and remainder is the right function for it.
Thanks in advance!
Solved! Go to Solution.
06-29-2022 08:34 AM
It is the correct operator. However, you simply cannot connect it directly to the case selector. The case selector must be a Boolean, an integer or a string. If you take the output of the Q&R you can either do a comparison for less then 1 (in your case the remainder will always be 0 or 1) or cast the output to an integer and wire that directly to the case selector.
06-29-2022 08:52 AM - edited 06-29-2022 08:53 AM
Hi jolli,
@jolli12 wrote:
My attempt at doing this can be seen in the file attached. It's part of a far bigger code, that's why I only attached a snippet of it. I'm not sure if quotient and remainder is the right function for it.
Why are there orange wires? Why are there 3 locals in your image?
And why is there a case structure?
See this:
You can use Q&T, but there are simpler methods…