09-26-2016 04:58 PM
Hello all,
I need to do a sort of calibration for a load cell device. I want to subtract the "resting" or intial value of the load cell from the current value that it is reading continuously. I think there should be a way to use shift registers for this, but remember that I am only concerned with the VERY FIRST iteration value.
Please let me know if you have any suggestions as to how I can achieve this goal. I have attached a vi for reference. It uses hardware so you will not be able to run it, but you may be able to get a better understanding of my question by looking.
Thank you very much,
Paige
Solved! Go to Solution.
09-26-2016 05:23 PM
I can't open your VI, but there is a first call node under synchronization in the menu that returns true the first time something has been called in the VI.
If you'll be running a while loop more than once, set a shift register instantiated to a true case, then once inside reassign a false to it.
There may be better ways to go about it, but these are what I've done so far for first time exceptions.
09-26-2016 05:41 PM
09-26-2016 11:36 PM
Try to follow LabVIEW Coding Standards
Use Proper Design Pattern (State Machine Architecture in this particular case)
Avoid unnecessary usage of Sequence Structure.
Kindly Provide which is your Initial or resting Value and the Current Value based on your code.
09-27-2016 08:31 AM
Hey ,PL have look at attached snippest image for use of shift reg.
Let me know if you are not getting this
09-27-2016 08:39 AM - edited 09-27-2016 08:39 AM
@piZviZ wrote:Hey ,PL have look at attached snippest image for use of shift reg.
Let me know if you are not getting this
That's not a good example. I believe your logic is backwards, and nowhere do you store the calibration value. You are only storing a "counter" which actually stops counting.
Here is the way you store a calibration value on the first call of the loop.
09-27-2016 10:18 AM - edited 09-27-2016 10:19 AM
That was basically my suggestion. Sometimes you even want an option to manually recalibrate the system later, e.g. as follows (switches are latch action).
09-27-2016 12:30 PM
Callibration logic can be developed in case structure (as shown in my post-true case).You are logically corrected but architecture wise this solution is not flexible.
My answer to this question reflect only logic for 1st iteration not for calibration .
09-27-2016 12:32 PM - edited 09-27-2016 12:33 PM
@piZviZ wrote:Callibration logic can be developed in case structure (as shown in my post-true case).You are logically corrected but architecture wise this solution is not flexible.
My answer to this question reflect only logic for 1st iteration not for calibration .
Please quote relevant parts so we know what you are replying to. What solution is not "flexible" and what does that term even mean in this context? In what way is your solution more flexible?
09-28-2016 11:59 AM
Hello,
My problem is that I am reading from an array, so I need to use a for loop. I want the first value of the array to be subtracted from every other value as it comes in. This is the portion of the code I have so far, but I am still a little confused.
Can I create a local variable for the first element or something in the true case? This seems simple, but I am having quite the time!
Thank you all very much for your help!