1. Create subroutine

1. Create subroutine

To create a new subroutine, follow one of the following steps:

  • In the "Insert" area of the "Edit" menu bar, click on "Object" to bring up the context menu, and then select "Add Subroutine".

  • In the Engineering Explorer, select a program folder and right-click on the menu to choose "Add" ->"Add Subroutine".

The generated subroutine will not immediately appear in the program editor, but will display this entry in the Engineering Explorer and be in a renamed state. After filling in the name, press Enter to confirm.

Attention

When a new program has the same name as an existing program, a new name will be automatically assigned. For example, "New Program" is renamed as "New Program_1".

Double click on this new program in the Engineering Resource Manager to display empty content in the program editor.

If you want to allocate parameters to a subroutine at this time, you can use the [Parameter Table] () to define this subroutine.

1.1. description

Please remember that each subroutine has a separate parameter table. The parameter table will only display the parameters of the corresponding program correctly after selecting the tab of this subroutine. So when editing program parameters, ensure that the program opened by the editor matches.

Each subroutine can have a maximum of 16 valid parameters. If this limit is exceeded, the compilation scenario will report an error.