Last updated: June 10, 2003
Introduction
This document is
one of five that describes the basic ICON program (skeleton.icn)
which normally provides the framework for all ICON programs. This document
describes the module named "Modbus Outputs" which sends control information
to relays and actuators for feedback control. Each block contains the following
functions:
Module Modbus Outputs
Constant Override
enable control block 1
General Parameters
Variable: | override_enable1 | Set to override_enable2 for the second block, etc. Value of 0 is no override, 1 enables override |
Data type: | Float | |
Mode: | Capture |
If
Get override data
Table Parameters
Variable | Status | Expression | Description |
Module | 0 | override_enable1 | If override_enable1 is set to 1 then this If block is executed. This block loads override data. |
Constant Override
values
General Parameters
Variable: | override_values1 | Set to override_values2 for the second block, etc. (Values set output values of Modbus registers for testing.) |
Data type: | Float | |
Mode: | Normal |
Fan Get override data
General Parameters
Source: | override_values1 | Set to override_values2 for the second block, etc. |
Destination: | data_selected1 | Set to data_selected2 for the second block, etc. This variable now contains the override values. |
Count index: | Null | |
Time index: | Null | |
Time def: | Null | |
Last period: | Null. | |
Block size: | 17 | Set to length of Modbus read plus 1. |
Number of indexes: | 1 | |
Direction: | Multiple sources to one destination |
Elseif
Otherwise
set actual Modbus data
Table Parameters
Variable | Status | Expression | |
Module | 0 | 1 | This block will be executed if the If block is not. This block gets actual control data and sends to Modbus output device. |
MAP Import
control data
General Parameters
Array: | control1 | Set to control2 for the second block, etc. |
Direction: | To Array |
Endif
Modbus
send
out Modbus data
General Parameters
Parameter | Example | Description |
Enable: | Null | |
Status: | mod_stat1 | Use mod_stat2 for the second block, etc. |
I/O transfer: | control1 | Use control2 for the second block, etc. |
Com type: | 2 | You may select serial port 1 or 2 depending on which serial port your Modbus device is connected (usually 2). |
IP address: | 0.0.0.0 | |
Port: | 502 | |
Unit Address: | 255 | The address of the Modbus device. |
Register address: | 1 | Select the Modbus starting register address. For writing 1-wire devices and for most other Modbus devices you will use 1. This can only be found in your Modbus device documentation. |
Command: | Set multiple registers (16) | Select the appropriate Modbus write command. |
Register type: | Unsigned integer | You may pick as appropriate. It does not matter for Commands 5 and 15. |
Timeout: | 50 | |
Retries: | 3 |
Limit set
status for event save
General Parameters
Input: | mod_stat1 | Use mod_stat2 for the second block, etc. |
Result: | alarm | Use alarm[1] for the second block, etc. |
Limit: | Null | |
High: | 4 | |
Went high: | 5 | Causes an event to be written when the input goes to 1. |
Window: | 0 | |
Went window: | 1 | Causes an event to be written when the input goes to 0 or 1. |
Low: | 2 | |
Went low: | 3 | |
High limit: | 1.5 | (A 0 or a 1 in the input indicates correct operation. 2 or higher indicates Modbus write fail.) |
High clear: | 1.5 | |
Low clear: | 0 | |
Low limit: | 0 |
Histevt save
alarm
General Parameters
Data: | mod_stat1 | Use mod_stat2 for the second block, etc. |
Status: | alarm | Use alarm[1] for the second block, etc. |
Event file: | 4 | Pick the desired event file. |
Event number: | 3 | Pick the desired event number. |
The above instructions are repeated for each Modbus write. The following instruction exports all the alarms for the master alarm function:
Alarm Export
master alarm
General Parameters
Master: | !alarm[1] | The exported alarm. |
Alarm: | alarm | |
Number of alarms: | 2 | Set to number of Modbus writes. |