In my automated test processes, I have several places where I need to increase an instrument's voltage with a little step, do a measurement, then increase it again. Because it's used multiple times I've turned into a little module. This blog is born out of need. My "write to Excel" blocks were taking way too much real estate of my Labview main flow. |
What is this Step Increment Generator?
It's a small calculation block that allows you to increment a setting of an instrument a given number of times, with a given step size.
It starts from a given start value.
When it reaches that maximum, it starts counting all over from the start value.
It's Counter input is typically a loop counter.
When it reaches the upper limit, it sets a Finished flag. You can use that value in your downstream flow to stop looping.
Example
In the example below, I use this block two times.
One time in the lower section (outer loop) to make a power supply loop between 8 V and 14V. Without exit. This one keeps looping forever.
The other timer in the top section (inner loop) makes a DC load loop between 0 A and 7.8 A. With exit. Once the upper limit is reached the loop breaks and returns to the outer loop.
Here's the block diagram of the outer and inner loop of that process. The two Increment Generators are highlighted.
You can see that in the outer block the Finished flag isn't used. This loop keeps running until an operator presses the Stop button.
In the inner loop, the Finished flag is used to end the loop's execution and exit back to the surrounding block.
Why?
Step increments within a given range are often used to measure the behaviour of a component or circuit.
You step to the next measurement point and collect the data.
This is a way to fully automate measurements on a device and log the measurements to a file.
The example above is part of an efficiency logger for a dc to dc converter.
Here's output data, and a graph based on such measurements.
But what's the point? Why make a module for such a small piece of logic as a step increment generator?
In my case, two reasons:
- it's reusable and used multiple times in a single diagram. As an extra, the block's icon uses less space on the main diagram than the separate blocks - leaving more real estate for the flow.
- I always get this wrong at the border conditions (yes: every time). Having it correct and debugged and tested saves me peace of mind.
The Increment Generator for LabVIEW is attached to this blog post.
Top Comments