LogixNG Reference - Chapter 10

Modules

A module is a special ConditionalNG which is invoked from regular ConditionalNGs or other Modules. In programing terms it is a sub-routine, method, def, etc. It can use zero or more inputs and return zero or more outputs. It does not respond to expression changes.

A common use would be to return the state of a set of expressions that can be called by various ConditionalNGs rather than listing each expressions in each ConditionalNG. Another exmaple is setting a common group of actions.

When combined with tables, a module could be passed the name of a table row. It would then perform the actions based on the table row data.

The Module Table provides the details on creating a module.

This is a digital expression socket. It can have inputs and outputs as well as returning true or false based on the current state of the expression list.

Chapter 10 digital expression root

This is a digital action socket. This can be used to create an action only module or complex modules with any combination of expressions and actions, such as if then else structures. These can have inputs and outputs.

Chapter 10 digital action root

Inputs and Outputs

The input and outputs are defined by doing a right click and edit on the first line of the tree. In the module, the inputs and outputs are defined as local variables.

Chapter 10 parameters dialog

Click on the Add parameters button. Enter a name and select whether it is for input, output or both. The Select option is used to delete the row or move it up or down.

Chapter 10 parameters sample

The first row is updated to show the inputs and outputs.

Chapter 10 module definitions

Calling a Digital Expression Module

Expression modules are called from ConditionalNG expressions and return true or false.

Use the Call module type in the Other category.

Chapter 10 add expression call

After clicking Create, the Module detail window will open. Select the module from the list. It only shows expresson modules. Click OK to add to the tree.

Chapter 10 call expression list

If there are parameters that need configuration, edit the newly added row and the parameter list will be displayed. If necessary, configure the input and return variables as described in the next section.

Chapter 10 call expression module

Calling a Digital Action Module

Use the Call module type in the Other category.

Chapter 10 add action call

After clicking Create, the Module detail window will open. Select the module from the list. It only shows action modules. Click OK to add to the tree.

Chapter 10 call action list

If there are parameters that need configuration, edit the newly added row and the parameter list will be displayed. If necessary, configure the input variables

Configure Call Parameters

When Edit is selected on the row, the parameters window will open.

Chapter 10 parameters window

For Input types there are a variety of sources. They range from literals to various type of references. The Input data field has the literal value or the reference name.

Chapter 10 input types

For Output types there are two choices. The Output data field contains the name of the choice.

Chapter 10 output types

The selections in this example are local variables.

Chapter 10 call parameters

The resulting ConditionalNG with the local variables and a comment on the module call.

Chapter 10 call action module

Chapter 11 - Tables

Return to the Reference TOC