LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

adding remainder to shift register

Hi,
i have a start value, end value and increment value. If my increment value is not a multiple of the difference of the start and end value, i will have a remainder. My application will only run N times, where N is the whole number of the decimal value. As a result, the last value will only be a multiple of my increment, not my exact end value. What should i do to include the remainder too?
0 Kudos
Message 1 of 3
(2,466 Views)
If you want evenly spaced values, you need to specify start value, end value, number of steps and then the increment value is calculated. Or start value, increment value, number of steps and then the end value is calculated. If you want to keep start, end , and increment, you would recalculate the increment and use the new value instead. If you're willing to accept unevenly spaced values, add an additional step at the end where the last increment value is the difference between the end value and the current setting.
0 Kudos
Message 2 of 3
(2,466 Views)
Hi Adeline !
You could simply test the value R of the remainder and add 1 to the loop number Q when the remainder is not zero. Use the "Quotient and Remainder" function in the Numeric sub-palette, to calculate Q and R.
Does that help or am I missing something ?
Chilly Charly    (aka CC)
0 Kudos
Message 3 of 3
(2,466 Views)