07-12-2009 09:52 AM
07-12-2009 10:55 AM
Hi Flibberty...,
you can use the "equal?" function to compare your arrays. Both arrays should have the same length, otherwise the result array has the length of the smallest.
Mike
07-12-2009 10:58 AM
Hi Mike,
I used the 'equal' function in the event structure but it isn't working.. and could u elaborate more on array size please? I'm utilizing ports P0.0 - P0.7 on both DAQs. thanks
07-12-2009 11:05 AM
Let's start with the digital output 🙂
What is this code all about?
Do you want only one of the 8 led's to lit randomly or are multiple led's also ok?
The two possible codes are in attached file SNAG-003.jpg
Connect the output of the "Scale by power of 2" function or the "Multiply" output directly to the Write DAQmx vi
I don't understand the purpose of the "Boolean Value" and "Replace subset array" thing, so I skipped it 🙂
07-12-2009 11:07 AM
I'm utilizing ports P0.0 - P0.7 on both DAQs.
No you don't 🙂
The DAQmx read is a 32 bit, not 8 🙂
07-12-2009 11:28 AM
Hi Alain,
I want only 1 LED to light up at each time.. and how do I compare a 32 bit input/output? thanks
07-12-2009 11:50 AM
Only 1 led, so you should use the "Scale by power of 2" function.
You should also wire something to the 'Timeout" terminal of the event structure.
Maybe 300 and skip the "Wait until next ms Multiple" function.
Now the Time out event will never be run since the default is -1 meaning no time out.
Compare 32 bit? Just like any other compare with the "Equal?" function.
But I don't get the purpose of your code
The code lit one led ok but then what is supposed to happen?
A user hits the corresponding button or what?
What is the purpose the the "Boolean value" control?
07-12-2009 12:09 PM
07-12-2009 10:52 PM
07-12-2009 10:54 PM