07-08-2016 11:42 AM
Thank you so much Bob and Gregory!
I did fix my code to work how i want. I think I understood the nature of what's happening.
I guess the logic should be AND("current signal", NOT("previous signal")) in terms of MS excel logic function.
This logic will give me,
Current | Previous | Output |
TRUE | TRUE | FALSE |
TRUE | FALSE | TRUE |
FALSE | TRUE | FALSE |
FALSE | FALSE | FALSE |
So when I ran the VI continuously (and before and after I switched "experiment on" to ON),
the previous code that I had would provide input signal to the case structure something like,
FFFTTTTTTTTTTT....
so the "random number" was generating number continuosly according to the number of Ts there.
But if I set the above logic based on the sequence of current and previous signal, the same input,
FFFTTTTTTTTTTT....
would only trigger when F becomes T.
Makes perfect sense.
But I do wanna know how to do this with WHILE loop now. Guess it's more about technical understanding now.
SoI tried with the while loop as it is attached in the VI with the understanding that I have.
But I'm not getting the right results here. What am I missing now?
07-08-2016 11:51 AM - edited 07-08-2016 11:53 AM
Hi geek,
when you want a VI to iterate for several times you should use a loop…
Why did nobody suggest the BooleanCrossing function before?
SoI tried with the while loop as it is attached in the VI with the understanding that I have. But I'm not getting the right results here. What am I missing now?
Basically you missed to THINK DATAFLOW!
When you want to read the current state of a button inside a loop you should actually read the button inside the loop!
07-08-2016 12:10 PM
But I do wanna know how to do this with WHILE loop now. Guess it's more about technical understanding now.
SoI tried with the while loop as it is attached in the VI with the understanding that I have.
But I'm not getting the right results here. What am I missing now?
Bob and I both uploaded examples using while loops, were you able to take a look at those?
07-08-2016 12:46 PM
GerdW,
Because Geek is a beginner, doesn't understand Data Flow, doesn't know how to use Shift Registers, doesn't know about using Do Once or Feedback for "local memory", we were attempting to teach him (or her) these concepts so that he/she could write their own Boolean Crossing function (or understand the one that comes with LabVIEW).
There's still a way to go ...
Bob Schor