LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to see if two digital inputs for a for loop?

Hi!

 

I am trying to tell if either of my digital inputs go low and if one goes low I would like the for loop to be false. I have attached my code below. I have tried many things and I cannot figure it out. 

 

Thank you!

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

You don't have a FOR loop, just a While loop.

 

And you have it wired to a stop button to stop the loop, nothing related to the outputs at all.

 

You shouldn't be converting to and from dynamic data if you want to convert a 1D array into a 2D array.  If you must do this, use the "Build Array" from the Array palette.

 

Your case statement does something on 1 failure and something else on 0 or 2 or more failures.  I'm guessing you want one thing to happen on 0 failures and another to happen on 1 or more.  To do this, change to the "1" case and right-click to make it the default case.

0 Kudos
Message 2 of 6
(3,121 Views)

Sorry I meant if loop! The way you suggested, changing the cases, how would I do that for two inputs? So if one goes low it would go to 0 (default)

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

That sounds like you want to check signal X AND signal Y. There's a function with that name. 😉

/Y

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

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

Hello mkapler1

 

I also was thinking to wire the Boolean Array from the DAQAssistant Express VI to a For Loop and you will have an Auto Indexed Tunnel. In that way you can compare each Boolean value with false(low) then activate what you need using a case structure. Probably there are many other solutions I just was trying to share with something that is easy to implement.

 

Regards

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

Your DAQ input tasks are not going to run without error.  You simply need a single task with two channels and use the old single sample multiple channel read (1D Array of Boolean)

 

You can "AND" the array elements.  you could OR them you could index the values and compare them or even us boolean array to number and wire that to any case structure


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 6
(3,042 Views)