Okay, I'm whipped...
Here's my goal - I want to generate a random L.E.D. signal to one of 5 stations. I want to then wait for a corresponding input from that station to go high (proximity sensor), confirm it, and start all over again. I have a number generator,0 to 4, which seems to work fine I've converted that to a subVI. This is where I hit the wall: The MAX reads the 9421 card on a channel when I change state, but I can't do anything with that signal in my program. MAX can generate a high to the 9472, but I cannot get my program to output a high to the randomly generated station to start the process over again. Here's what I have so far
I know I have to wait for the station selected to the high at that station to continue to loop. I've seen the example called "Read-Write-Single_Dig-Lines," but I'm way too green to understand it. "There must be an easier way!"
Can anyone help?
I will KUDO in a heartbeat!!!
Solved! Go to Solution.
Right now you are only showing in your screenshot a DAQ assistant reading a card, but you aren't doing anything with the data. You aren't showing where you are outputting a signal.
What you need to do is output the signal. Then you need to enter a while loop where you continually read the card and the loop only ends with a match. Then the outer while loop can continue.
You need to use Index Array to break apart the different channels for the thick green wire coming out of your DAQ assistant. Make sure your DAQ assistant is set for N channels 1 sample.
Now how do I extract the one high case of the five and equals it to the number generated? ( I'll worry about the output later )
I'm fairly new to VIs, and very new to cRIO.
Thanks again for the help.
Post your VI so I can see how the DAQ assistant is set up so I can see how to break apart and make the comparison.
I think your VI does this already. You are just failing to use your comparison. You have the boolean wire sent do a shift register for no reason.
I modified your VI a bit to replace yourrandom number subVI and to simulate the DAQ input.
(PS. I would have saved a modified version of your VI rather than posting a snippet. But for some reason, saving your VI fails because it is looking for some non-existent help file.)
This really looks much cleaner. Thank You.
With the register, I'm trying to accomplish "wait 'til the two numbers match before continuing."