Create a module reference parameter

A module reference parameter is an InOut parameter of the MODULE data type that points to the Module Object of a hardware module. You can use module reference parameters in both Add-on Instruction logic and program logic. Since the module reference parameter is passed by reference, it can access and modify attributes in a hardware module from an Add-On Instruction.
Use the module reference parameter in two ways:
  • In a GSV or SSV instruction, or an Add-on Instruction, you can use the module reference InOut parameter as the Instance Name or Add-on Instruction parameter.
  • In an Add-on Instruction, or in a GSV or SSV instruction, you can pass the module reference InOut parameter into the InOut parameter of another nested Add-on Instruction instruction.
There are several limitations on module reference parameters:
  • Module references parameters can only be InOut parameters.
  • You can use a module reference parameter only in standard programs and Add-on Instructions, not in Safety programs or Safety Add-on Instructions.
  • Program parameters that reference a module must connect to a module, and cannot reference other module reference parameters.
  • Module reference parameters must be program or Add-on Instruction scope, not controller scope.
    TIP:
    You cannot create a module reference tag. You can only reference modules using an InOut parameter of the MODULE data type.
To create a module reference parameter:
  1. Create a new parameter in a program or an Add-on Instruction.
  2. Select InOut Parameter for the Usage.
  3. Select MODULE for the Data Type.
  4. Select or enter values for the other fields to define the parameter.
To use a module reference parameter in a GSV or SSV instruction in the Ladder Editor:
  1. Add the GSV or SSV instruction to a rung in the Ladder Editor.
  2. Select Module as the Class Name in the instruction.
  3. In the Ladder Editor, double-click the Instance Name field in the instruction and click the down arrow to display the Module Browser. You can also manually type in the name of the parameter.
  4. In the Module Browser, double-click the module reference parameter that you want the instruction to reference.
  5. Select or enter values for the other fields to define the instruction.
To use a module reference parameter in a GSV or SSV instruction in the Structured Text Editor:
  1. Add the GSV or SSV instruction to a rung in the Structured Text Editor.
  2. Right-click the instruction name and select Argument List.
  3. Select Module as the Class Name.
  4. Select the down arrow in the Instance Name field to display the Module Browser.
  5. Double-click the module reference parameter or module that you want the instruction to reference.
  6. Select or enter values for the other fields to define the instruction.
    You can also right-click between the parentheses following the instruction name and select Browse Devices to display the Module Browser.
To pass a module reference parameter into an Add-on Instruction:
  1. Double-click the field for the module reference parameter, and click the down arrow to display the Module Browser.
  2. Select the module reference parameter. If inside an Add-on Instruction, when calling a GSV/SSV or nested Add-on Instruction that takes a module, clicking the module field shows a list containing only the outer Add-on Instruction's module reference parameters.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.