Rockwell Automation Publication 2080-QS004C-EN-E - October 2023 49
Chapter 10
Learn About User-defined Functions and User-defined Function Blocks
A user-defined function (UDF) acts like a subroutine in RSLogix 500® and Studio 5000 Logix Designer® applications. A UDF requires less
memory but it supports only one instance and allows only one output parameter. A user-defined function block (UDFB) acts like an Add-On
Instruction (AOI) in the Studio 5000 Logix Designer application. A UDFB supports multiple instances and allows multiple output parameters,
but it takes up more memory.
This chapter describes how to create a UDF to convert Raw data from channel 0 of the 2080-IF2 analog input module to actual engineering
units. The Raw value ranges from 0.0...65535.0 and the engineering units range from 0...100 °C. UDF is suitable for this type of simple
calculation since each call to the UDF is independent and only needs one set of local variables.
Create a UDF for your Program
1. In your current project, right-click User-defined Function and select Add > New LD: Ladder Diagram.
A program that is called “Fct1” is created under User-defined Functions.