Loop

From SweepMe! Wiki
Jump to: navigation, search

Loop allows you to do repetitions during your measurement and thus behaves like a for-lopp. It further can be used to create while-loop by using the nonstop-mode

Properties

  • The first index of Loop starts with 1.
  • Enter an positive integer number to define the repetitions
  • Use '0' to use the nonstop mode leading to a neverending iteration

Nonstop mode

  • Entering '0' as repetitions enables the nonstop mode
  • The nonstop mode can be stopped at any time using the button 'Stop'
  • Furthermore, the nonstop mode can be stopped by using Condition
  • If your measurement run basically forever with no planned end, please consider to use the reduction mode

Reduction mode

If a measurement creates a large number of measurement points, a memory error could occur because the internal memory is full. Furthermore plotting a large number of points can slow down the program and can lead to freezing the program. To prevent this, Loop comes with a reduction mode that can be enabled to set a maximum number of points that are stored by SweepMe! before measurement points are discarded. Data that is saved by MakeFile to a file is not affected.

There are different ways to reduce data. In any case, one has to define the maximum number of points that should be kept. The way how data is discarded can be changed. Data can thinned out linearly or quadratically. Linear reduction means that data those points are discarded that are closest to adjacent points with respect to time. Quadratic reduction means that data points are discarded with a quadaratic weight regarding the time distance between two neighboring points. As a consequence, points that are more back in time are more likely to be discarded. Further, one can define a percentage of the last points that are always kept. Keeping 100% of the latest points means that always the point is discarded that has been measured first.

Applications

  • Log sensor data over time and use Loop to create an permanent repetition of the measurement.
  • Combine Loop with Delay to get measurement points that are evenly spaced in time.
  • Repeat the measurement of certain value to average later or to check whether the measurement value is stable.