LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

digital I/O with cRIO 9472 and 9421 cards

Solved!
Go to solution

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 Capture1.PNGI'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 farCapture2.PNG

 

I know I have to wait for the station selected to Capture3.PNGthe 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

0 Kudos
Message 1 of 14
(2,885 Views)

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.

0 Kudos
Message 2 of 14
(2,883 Views)

YEs, I am having trouble isolating the 5 digital signals to determine which is the high.

0 Kudos
Message 3 of 14
(2,874 Views)

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.

0 Kudos
Message 4 of 14
(2,866 Views)

That was a problem: Forgetting myh loop, I had sampling on "continuous."

0 Kudos
Message 5 of 14
(2,862 Views)

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.

0 Kudos
Message 6 of 14
(2,846 Views)

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.

0 Kudos
Message 7 of 14
(2,840 Views)

Here's my VI so far...

0 Kudos
Message 8 of 14
(2,838 Views)

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.)

 

0 Kudos
Message 9 of 14
(2,828 Views)

This really looks much cleaner. Thank You.

With the register, I'm trying to accomplish "wait 'til the two numbers match before continuing."

0 Kudos
Message 10 of 14
(2,821 Views)