LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want my true case to do nothing

Solved!
Go to solution

I want my case structure TRUE case to do nothing. It adds unnecessary 0s to my output arrays if the input to the case structure is True.

If the condition input to the case structure is False, it appends two elements to two respective arrays (x intersection and y intersection). I only want to append to the output arrays if the condition input is False, however I tried different methods like build array and shift register but it doesn't work.

 

I attached my VI for more clarification. (I know the wires are messed up, but I just need to fix this problem)

I'd really appreciate the help,

Best,

Karl.

0 Kudos
Message 1 of 8
(1,170 Views)

I can't open your VI because it's in LV2024; which I (and most others on this board) don't have.  Back save it to 2019 or earlier.

But even if I could open it, I wouldn't help you (because " the wires are messed up").

When asking for free help, don't expect people to wade through a mess that you've made; clean it up first.

 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 8
(1,161 Views)

Just like Paul, I cannot view your code either (I'm on LV 2016). But, if I take a wild guess, I would guess you're doing something similar to the left-hand side, and you want to do something similar to the right-hand side.

 

Screenshot 2024-02-20 165501.png

Message 3 of 8
(1,153 Views)

Paul, you're right, I apologize. I saved it for the 2016 version and also cleaned the wires, connections should be now clear.

 

Thanks again,

Karl.

 

Screenshot 2024-02-21 145918.png

0 Kudos
Message 4 of 8
(1,097 Views)
Solution
Accepted by topic author kes06@mail.aub.edu

Hi karl,

 

use conditional loop tunnels to append to the arrays conditionally!

No need for this case structure...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 8
(1,086 Views)

Hey, it worked perfectly! Thank you so much!

I guess I need to spend a lot more time on Labview...

 

Best,

Karl.

0 Kudos
Message 6 of 8
(1,069 Views)

kes06@mail.aub.edu wrote:

Hey, it worked perfectly! Thank you so much!

I guess I need to spend a lot more time on Labview...

 

Best,

Karl.


All you need is to think things through a little more literally.  Literally, your requirement is "add the result only if there is a result".  Taken literally, that would mean the Build Array belongs inside the case structure because you only want to build the array if there is something to build with.  This is a tough thing to do, and often you need outside help to help you see it.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(1,050 Views)

Hi Karl,

 


kes06@mail.aub.edu wrote:

I guess I need to spend a lot more time on Labview...


Yes!

 

This is what your VI may look like:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 8
(1,042 Views)