Within my program I need to turn one of three lights on in no particular sequence (random selection). I tried to use the "random function" but it doesn't do the job (maybe the way I'm using it. I just need to have one of the three lights light during the sequence of the program. Help please!
Let's assume that your three lights are a 1D boolean array. The random function outputs a number between 0 and 1, so we'll take the result, multiply by 3 and round to -infinity so you get 0,1 or 2. Use "Replace Array Subset" - wire this number into the index and T into the value.
Hi As Spaceman suggests, best choice is to post your code. There are lots of ways to turn on one out of three lights in a random way. If that is your only requirement, one way is as attached. ( just a quick example)
Cheers Alipio
--------------------------------------------------------- "Qod natura non dat, Salmantica non praestat" ---------------------------------------------------------
Sorry to be a bother, but in the program I sent earlier I was also wondering where I can configure the "physical channel" to be single ended instead of differential. Whenever I run it it appears( looking at the "analog input data) that it thinks it's a differential input.
One more:-) After I run the program how do I clear the status of the light back to zero so they all turn off before the next start?
All your assistance and help is greatly appreciated.
On the DAQmx Create Channel vi, there is a input named "Input Terminal Configuration." Right click on this input, and choose Create Constant. Than choose the needed configuration.