Reconfigure an I/O Module Programmatically
Follow these steps to reconfigure an I/O module programmatically.
You can reconfigure an I/O module from your logic by:
- inhibiting the module,
- using the MSG Module Reconfigure instruction, and
- removing the inhibit.NOTE:DANGER:Inhibiting an I/O module forces it to revert to its program state values. The controller will not control the module until it is uninhibited and the connection is reestablished.
To reconfigure an I/O module programmatically
- Write logic to inhibit the module and remove the connection between the controller and the module:
- On a new rung, create a GSV instruction.
- Choose MODULE for the Object Class operand.
- Choose the appropriate I/O module for the Object Name operand.
- Only I/O modules with names can be accessed with GSV instructions.
- Choose MODE for the Attribute Name operand.
- Bit 2 of this attribute is the inhibit bit.
- Enter an INT tag for the Dest operand.integer (INT)An atomic data type consisting of a word used to store a 16-bit signed integer value (-32,768 to +32,767).
- Add an OR instruction on the rung after the GSV instruction.
- For the Source A operand, enter the tag in the Dest operand of the GSV instruction.
- For the Source B operand, enter the value 4 to set the second bit.
- For Dest, enter the same tag as in the Source A operand.
- Add an SSV instruction after the OR instruction.
- Choose MODULE for the Object Class operand.
- Choose the same I/O module as in the GSV instruction for the Object Name operand.
- Only I/O modules with names can be accessed with SSV instructions.
- Choose MODE for the Attribute Name operand.
- Bit 2 of this attribute is the inhibit bit.
- For the Source operand, enter the same tag used in the GSV Dest operand.
- Write logic to change the configuration tag for the module.
- Write logic to uninhibit the module and reestablish the connection:TIP:Make sure that the module is actually inhibited.
- On a new rung, create a GSV instruction.
- Choose MODULE for the Object Class operand.
- Choose the same I/O module for the Object Name operand.
- Choose EntryStatus for the Attribute Name operand.
- Enter a different INT tag for the Dest operand.
- Mask off the upper nibble of the destination tag by adding an AND instruction.
- Use the tag in the GSV Dest operand as the Source A operand.
- Use the value 16#FF00 for the Source B operand.
- Use the same tag for the Dest as in the Source A operand.
- Compare that tag to the value for inhibited by adding an EQU instruction.
- Use the AND Dest operand as the Source A operand.
- Use the value 16#6000 (the value meaning inhibited) for the Source B operand.
- Uninhibit the module by adding a GSV instruction:
- Choose MODULE for the Object Class operand.
- Choose the same I/O module for the Object Name operand.
- Choose MODE for the Attribute Name operand.
- Bit 2 of this attribute is the inhibit bit.
- Enter an INT tag for the Dest operand.
- Add an AND instruction on the rung after the GSV instruction.
- For the Source A operand, enter the tag in the Dest operand of the GSV instruction.
- For the Source B operand, enter the value 16#FFFB to clear the second bit.
- For Dest, enter the same tag as in the Source A operand.
- Add an SSV instruction after the AND instruction.
- Choose MODULE for the Object Class operand.
- Choose the same I/O module as in the GSV instruction for the Object Name operand.
- Only I/O modules with names can be accessed with SSV instructions.
- Choose MODE for the Attribute Name operand.
- Bit 2 of this attribute is the inhibit bit.
- For the Source operand, enter the same tag used in the GSV Dest operand.
Provide Feedback