11-25-2024 11:27 PM
Hello,
This small part of my project is giving me a hard time. I am sure you champs will figure iit out in a sec.
It's a simple substraction (don't worry about the addition). my problem is to have : total = 501 - y1 - y2 - yn where y is any numerical input.( x is eiher 301 0r 501), I tryed to use **bleep** regis. different ways . It doesn't seem to save the last output.
I appreciate any solution
Thank you,
Labview learner
11-26-2024 12:51 AM
Hi fan,
unfortunately you failed in providing a downconverted version of your VI…
@soccerfan wrote:
my problem is to have : total = 501 - y1 - y2 - yn where y is any numerical input.( x is eiher 301 0r 501)
I would use a CompoundArithmetic to add/sub those 4 items…
How do you define the "n" in "yn"?
@soccerfan wrote:
I tryed to use **bleep** regis. different ways . It doesn't seem to save the last output.
What are "bleep regis."?
When you talk about shift registers: how do you use them in "different ways"? They will ALWAYS store the last written value!
11-26-2024 01:28 AM
Thank you for your quick response.
"bleep" is supposed to be "shift" as shift register
Yn as y1-y2-y3....yn
as far as vi i did attach it. i don't know other ways
11-26-2024 01:33 AM
Hi fan,
@soccerfan wrote:
as far as vi i did attach it.
I already wrote about providing a downconverted version of your VI… (I prefer LV2019.)
@soccerfan wrote:
Yn as y1-y2-y3....yn
That still don't answers how you define the n…
Is "n" the last element of an array?
Do you want to subtract all elements of an array from "501"?
What exactly do you want to achieve?
11-26-2024 07:09 AM - edited 11-26-2024 07:10 AM
@GerdW wrote:
Is "n" the last element of an array?Do you want to subtract all elements of an array from "501"?
What exactly do you want to achieve?
Here are a couple of interpretations. Maybe one of these will meet the OP's needs.
11-26-2024 01:27 PM
@GerdW wrote:
What are "bleep regis."?
That's what you get from the automatic forum censors if you write "shift register", but omit the "f". 😄
11-26-2024 04:03 PM
I am afraid you did not understand my problem. "y " is not a array, it's a user input. the saved output is substracted from 501 untill the total is 0,
ex: 501-100-24-50.......(100, 24, 50 ..are user input)
Your suggestion doesn't save the total untill the next user input
Cheers
11-26-2024 04:59 PM
Can you save for version 2020 ?
11-26-2024 07:25 PM
Aha! See if I (now) understand what you want to do:
Here, the key element is the second step, where you wait until the user inputs a number. Have you learned about the Event Structure? This is something that can wait until you "fill in" a Front Panel Numeric control, letting the data flow continue when you hit "return". If this is in a While Loop with a Shift Register that holds the "sum" (or "difference", if you want) that results from subtracting the entered number from the "total" held in the Shift Register. Since this is all in a While Loop, after doing the subtraction/addition, you can compare the result to 0 and test for it equal to 0, which you wire to the Stop indicator.
Of course, I mgiht be guessing entirely wrong about what you are trying to do. Maybe you should spend a few more weeks learning the fundamentals about LabVIEW ...
Bob Schor
11-26-2024 09:32 PM
Thanks for your answer. You almost got it. I cosidere myself an intermadiate labview learner, i still have a long way to go. However ii know a fiew hings about events stucture and that is what i used in this problem