Monitoring local variables for user-defined functions and user-defined function blocks
Troubleshooting user-defined functions (UDF) and user-defined function blocks (UDFB) differs from normal program monitoring because their logic might execute multiple times per scan.
When connected to a
Micro800
controller, you can:- Monitor UDF and UDFB variables in the language editor.
- For a UDF, only the last execution of the UDF is displayed.
- For a UDFB, only the last execution of the same instance is displayed.
- A UDF cannot be monitored when inside an interrupt.
Monitor UDF and UDFB variables in the variable grid by double-clicking
Local Variables
in Project Organizer
.- For UDFBs, input parameter values of sub-elements of arrays and structures display only the last execution value.
- For separate instances of the same UDFB, Var and VarOutput variables have unique values for each instance, but VarInput variables display only the last execution value for arrays and structures.
To view the input parameter values for each instance, refer to the values of the variables that are being passed into the instance.
In the following example, program SIMPLE_MOV_POU calls a UDF four times and the local variables are updated with four different values. To monitor each execution of the UDF, additional input logic must be added for each UDF to be executed once at a time.
SIMPLE_MOV_POU calling 4 UDF instances

When monitoring the internal logic of the following UDF, only the last executed UDF is shown for the local variables (
SIMPLE_MOV = 4)
. To monitor or troubleshoot each execution of the UDF, additional input logic must be added for each UDF to be executed once at a time.UDF definition

The following example, program Prog1, calls two separate instances of a UDFB. When monitored from the graphical ladder view, 1 is shown as the value being passed into FB1_1; when monitored from the variable grid, 2 is shown as the value for FB1_1.InputParameter. To monitor variables when passing values of sub-elements of arrays or structures into a UDFB, use the graphical view.
Monitoring variables using the graphic view

Monitoring variables using the local

Provide Feedback