Create a Method

  1. In the Project Explorer > Subprograms section, right-click a UDFB.
    The context menu appears.
  2. Select Add New Method.
  3. Select an implementation language: (Figure 1)
    • Structured Text (ST)
    • Function Block Diagram (FBD)
    • Ladder Diagram (FFLD)
  4. Figure 1: Add New Method menu

    The New UDFB dialog box opens.

  5. Enter a method name. (Figure 2)
  6. Figure 2: New UDFB dialog box

  7. Click OK to save the changes or selections and close the dialog box. 
    The Properties dialog box opens. (Figure 3)
  8. Figure 3: Properties dialog box

  9. Define the method's Inputs and Outputs parameters in their respective text boxes.
    The Properties dialog box looks similar to Figure 4
  10. Figure 4: Example: Completed Properties dialog box

  11. Click OK to save the changes or selections and close the dialog box.
    The new method is created as a child object under the parent UDFB in the Project Explorer. (Figure 5)
  12. Figure 5: New method

  13. Continue with Define Method Parameters.

See Also

The program editor for the new Method opens automatically, allowing you to implement the logic.


    • Naming Guidelines
      • Use verb-based names (e.g., StartPump, ResetAlarm).
      • Avoid generic names (e.g., Action1, Program 1).
      • Match the naming conventions used for programs and function blocks.

Example: Project Explorer

Subprograms

   9  MotionAxisController (UDFB)

      9  ValidateParameters (Method)

      9  ExecuteMoveProfile (Method)

      9  MonitorAxisFaults (Method)

      9  GenerateDiagnosticInfo (Method)