Chapter 3 Using the PID Control Toolkit© National Instruments Corporation 3-9 LabWindows/CVI PID Control Toolkit User ManualYou can use the setpoint profiler as follows:1. Call PidSetpointProfileCreate to create a setpoint profile. Use a pair of time andsetpoint value arrays to specify the setpoint profile with the time values in ascendingorder.2. Use PidSetSetpointProfileAttribute to set the setpoint profile attributes.3. Use PidSetpointProfileNextSetpoint to obtain the setpoint from the profile in aloop and provide this setpoint to the controller.4. Once the control loop ends, call PidSetpointProfileDiscard to discard the setpointprofile and release its resources. Also call PidDiscard to discard the PID controller.At any time in the control loop, you can use pidSetpointProfileAttrElapsedTimeto get the elapsed time. You also can check if the profile is complete using thepidSetpointProfileAttrProfileComplete attribute.Using Ramp GeneratorsA ramp generator is a simple component that you can use to generate a ramp output. Typically,you use a ramp generator as follows:1. Call PidRampCreate to create a ramp generator. Specify the SP, initial output, and therate at which the output of the ramp changes.2. Call PidSetRampAttribute to set the ramp generator attributes.3. Use PidRampNextOutput to obtain the output of the ramp in a loop.4. Call PidRampDiscard to discard the ramp generator and release its resources.Converting between Percentage of Full Scale and Engineering UnitsAs described in the previous sections, the default SP, PV, and output ranges for the PIDLibrary functions correspond to a percentage of the full scale. Proportional gain (K c) relatespercentage of full-scale output to percentage of full-scale input. This is the default behaviorof many PID controllers used for process control applications. To implement PID inthis way, you must scale all inputs to percentage of full scale and all controlleroutputs to actual engineering units such as volts for analog output. You can usePidConvertEGUToPercentage to convert any input from real engineering units topercentage of full scale and PidConvertPercentageToEGU to convert the controller outputfrom percentage to real engineering units. PidConvertPercentageToEGU has anadditional input parameter, bCoerce. The default value of bCoerce is TRUE, which indicatesthat the output is coerced to the range.Note The PID Library functions do not use the setpoint range and output rangeinformation to convert values to percentages in the PID algorithm. The controller gainrelates the output in engineering units to the input in engineering units. For example, a gain