01-08-2012 04:17 PM
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!!!
Thanks
Solved! Go to Solution.
01-08-2012 04:33 PM
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.
01-09-2012 09:11 AM
YEs, I am having trouble isolating the 5 digital signals to determine which is the high.
01-09-2012 10:14 AM - edited 01-09-2012 10:15 AM
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.
01-09-2012 10:26 AM
That was a problem: Forgetting myh loop, I had sampling on "continuous."
01-09-2012 12:49 PM
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.
01-09-2012 02:15 PM
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.
01-09-2012 02:32 PM
Here's my VI so far...
01-09-2012 09:27 PM - edited 01-09-2012 09:29 PM
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.)
01-10-2012 09:54 AM
This really looks much cleaner. Thank You.
With the register, I'm trying to accomplish "wait 'til the two numbers match before continuing."