beautypg.com

Referencing a hardware module – Rockwell Automation Logix5000 Controllers Add-on Instructions Programming Manual User Manual

Page 79

background image

Using Add-On Instructions

Chapter 3

Structured Text:

The instruction expects arguments for required parameters as listed in the instruction

tooltip.

Tip:

For help with an instruction, select the instruction and then press F1. In Structured Text, make sure the

cursor is in the blue instruction name.

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. Follow this

procedure to use a module reference parameter from within the Add-On

Instruction. This example shows how to retrieve the communication path for a

hardware module.

1. Create the module reference parameter in the Add-On Instruction. See

Creating a module reference parameter

on

page

42

.

2. Create a SINT tag in the Add-On Instruction to hold the module

communication path.

3. Add a GSV instruction in the Add-On Instruction, using the programming

language you chose for the Add-On Instruction. The GSV instruction

allows you to retrieve module information.

4. In the GSV instruction, choose the following values to retrieve the

communication path to the module.

Attribute

Value

Class Name

Module

Instance Name

The module reference parameter you created in the Add-On Instruction

(IO_ModuleSts below)

Attribute Name

Path. This is the communication path to the module.

Dest

The tag to hold the module path (Module_Path below)

Referencing a hardware

module

Rock well Automati on Publication 1756- PM010F-EN-P - Oct ober 2014

79