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.
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.
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…
can anybody change my vi accordingly...
Thank you in advance..
(continuous 30 iterations to be saved)
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!
why is your counter an orange DBL?
when I gave a constant to shift register it automatically took orange, but it's working fine.
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".