03-05-2022 10:54 AM - edited 03-05-2022 11:17 AM
I would like to store a Voltage Value within a while loop (Shift register), where the Boolean operator should be TRUE in the current iteration and FALSE in the next iteration. Im using a Select-Function. How can I implement this?
Solved! Go to Solution.
03-05-2022 11:22 AM
Hi Rashid,
@RashidHamid wrote:
where the Boolean operator should be TRUE in the current iteration and FALSE in the next iteration.
Use a shift register and a NOT to achieve your requirement...
03-05-2022 11:39 AM
Unless you only have two iteration, your description is not clear at all.
@RashidHamid wrote:
How can I set a TRUE value from the n iteration to FALSE in the n+1 iteration within a while loop?
What is "n" and what should happen if the value is FALSE at "n"? What should the value be for iteration "n-1", n+2 or "n+3" etc. (It would help to use conventional names (such as "i" and "N" for loops) to avoid confusion.
If you want it to be true in the first iteration and false afterwards, you could use a [i=0?] on the iteration terminal.
@RashidHamid wrote:
Im using a Select-Function. How can I implement this?
That does not really narrow it down. Please show us your code and explain exactly what it should do.
03-05-2022 11:42 AM
When I click a button, it outputs a TRUE value. Afterwards the voltage should be stored in a shift register. Unfortunately I do not get further.
03-05-2022 11:54 AM
@RashidHamid wrote:
When I click a button, it outputs a TRUE value. Afterwards the voltage should be stored in a shift register. Unfortunately I do not get further.
A truncated image is not useful. We can't even see the button! Please attach your VI! (Do save for previous if you are using LabVIEW 2021).
What should be in the shift register before the button is pressed?
What is the mechanical action of the button?
(I would avoid the term "current" when talking about "voltage". Could be misinterpreted)
03-05-2022 12:19 PM - edited 03-05-2022 12:35 PM
The Shift register should be empty (0).
03-05-2022 12:28 PM - edited 03-05-2022 12:34 PM
(A "=true" just returns the other input unchanged, for example)
03-05-2022 12:55 PM
OK, so your logic is apparently not what you want. Maybe you can give us a full description of the requirements.
What should the input to the select node be:
03-05-2022 01:18 PM
Here are two possible ways to get a TRUE only whenever a boolean input just changed from FALSE to TRUE. Is that what you want?