05-02-2017 04:48 PM
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!
05-02-2017 05:22 PM
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.
05-02-2017 06:14 PM
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)
05-03-2017 03:29 AM
That sounds like you want to check signal X AND signal Y. There's a function with that name. 😉
/Y
05-03-2017 12:30 PM
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
05-03-2017 12:53 PM
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