01-29-2020 12:37 AM
Hello everyone
I want to save 30 iterations according to my requirement. I have attached my vi for more clarity. when I click save, it was not saving 30 iteration data. please help me.
01-29-2020 12:56 AM
You cannot 'reset' the "I" terminal in a loop. You can create a counter in your loop that can count up or down depending on the logic you want.
If you want to save every 30 iterations of a loop, use the "Quotient and Remainder' function, input the loop interation counter "I" the divisor is 30..then the Quotient will increment = 1,2,3 etc only then the loop iteration is a divisor of 30 without a remainder.
Try it out...it's a useful function.
Regards
01-29-2020 12:58 AM
Hi Rajesh,
@Rajesh10 wrote:
Hello everyone
I want to save 30 iterations according to my requirement. … when I click save, it was not saving 30 iteration data.
When you want to save data for 30 iterations then why do you compare with loop iteration counter directly?
Either create your own counter using a shift register - or store current loop iteration count in a shift register and compare with this one.
Or use a FOR loop set to iterate 30 times and start that FOR loop with a click on your "Save" button…
01-29-2020 02:38 AM
Hi JackHamilton
I think it will give every 30th iteration value.
01-29-2020 02:44 AM
can anybody change my vi accordingly...
Thank you in advance..
(continuous 30 iterations to be saved)
01-29-2020 02:57 AM - edited 01-29-2020 02:59 AM
Hi Rajesh,
a possible solution could look like this:
This is very basic LabVIEW programming: learn about shift register usage! (The "Save" button is changed to latched behaviour…)
I intentionally posted just an image of code to let you recreate this stuff and think about the code in the other case of the case structure. When you want someone else writing code for you then you should hire a programmer!
01-29-2020 07:45 AM
Thank you.
Problem solved
01-29-2020 07:47 AM
01-29-2020 10:09 PM
when I gave a constant to shift register it automatically took orange, but it's working fine.
01-29-2020 11:30 PM
Did you drop a floating point constant from the palette? You should have dropped an integer constant.
But right click on the constant and change the representation to an integer. U8 would be fine since you'll always be less than 255 and never negative.
Counting operations should always be using integers. Your double probably is okay, but whenever you start doing comparisons or math on doubles, you'll find that a number you though was an integer falls isn't exactly that integer and the comparison will fail.
Look up "floating point comparison".