← All exercises

VFD Speed Ref

medium

Clamps an operator percent setpoint to 0-100 and scales it for a VFD configured to accept a 0-32767 raw speed reference.

What it teaches

Composition: clamp, then scale. The percent arrives from an HMI and can be outside 0-100, while this drive interface is configured for 0-32767 raw counts. Pin the input to its valid range first, then scale it to the configured DINT reference.

Inputs and outputs

TagTypeDefaultDescription
In_PercentREAL50Operator percent speed reference from HMI
Out_SpeedRefDINTRaw speed reference for a VFD configured for 0-32767

Required behavior