Loop

From SweepMe! Wiki
Jump to navigation Jump to 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 RAM 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.

Most important is to define the maximum number of points that should be kept in the data manager of SweepMe! using the field "Maximum points". Further one can change the way how data is discarded. Data can thinned out linearly or quadratically. Linear reduction means that data is thinnet out over the entire measurement time. Quadratic reduction means that data points are discarded with a quadratic weight regarding the time distance between two neighboring points such that more recent points remain. As a consequence, points that are more back in time are more likely to be discarded. Additionally, one can define a percentage of the latest measurement points that are always kept. These points are not thinned out until they do not belong any more the defined percentage of last points. This way one can keep points that have been recently measured completely. Keeping 100% of the latest points means that always the oldest measurement point is discarded.

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.