S3000/S4000 RTU User`s Reference Manual - Micro

Transcription

S3000/S4000 RTU User`s Reference Manual - Micro
S3000/S4000 RTU
User’s Reference Manual
Software Version 6.2.1
January 23, 2007
Copyright 1997-2007 Micro-Comm, Inc.
Table of Contents
Introduction..................................................................................................................................................... 3
Specifications and Sales Information.............................................................................................................. 4
Board Connections and Jumpers..................................................................................................................... 5
Sample Wiring Diagram................................................................................................................................. 6
Expansion I/O Module Setup........................................................................................................................ 11
Display Module Operation............................................................................................................................ 12
Software Description.................................................................................................................................... 13
Allen-Bradley DF1 and Modbus Protocol Support...................................................................................... 16
S4000 RTU Configuration Program.............................................................................................................. 17
Program Installation................................................................................................................................ 17
RTU Information Screen......................................................................................................................... 18
Configuration Parameters........................................................................................................................ 19
Analog Labels and Scaling Factors......................................................................................................... 22
Output Timer Labels............................................................................................................................... 23
Stop/Start Setpoint Labels....................................................................................................................... 24
User Variable Labels............................................................................................................................... 25
Discrete I/O Labels................................................................................................................................. 26
RTU Script Language Editor.................................................................................................................. 27
Data Table Viewer................................................................................................................................... 28
Display Module Emulator....................................................................................................................... 29
Debug Terminal....................................................................................................................................... 30
RTU Script Language Syntax....................................................................................................................... 31
Personality Module Memory Map................................................................................................................ 39
Introduction
This manual is intended to be the source of all information concerning the Micro-Comm S4000 RTU as well as the S3000
RTU. The S3000 RTU is a stripped-back S4000 having only 4 relay outputs and four 8-bit analog inputs.
The S4000 is a third-generation Micro-Comm RTU that currently runs software that makes it compatible with Micro-Comm
CTU 7, 8 and 9 central software. CTU 7 and 8 are used in older card racks and CTU 9 runs in the C2000 single-board central.
What this means is that the S4000 uses Enhanced Control Card data communications protocol. Please refer to the Control Card
software description for information on this protocol. The following list summarizes the features and I/O capabilities in the
S4000:
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Two completely separate Enhanced Control Card software modules - separate automote times etc.
A third Control Card module whose address is stored in the Personality Module - No automote control capability but can
be used to monitor another station for use in script
User programmable using a Windows or Macintosh software package (RTU Configuration)
The FLASH ROM may be reprogrammed with new versions of the core software
An RS-232 display module is supported for user displays and input
Adjustable baud rate, data bits, stop bits, PTT time and parity for radio communication
Adjustable Automote, LOS and Cycle times for backup control
Automote transmissions can be turned on or off
Adjustable controlling-RTU address
User entered relay output timer settings (both ON and OFF timers)
User entered stop/start settings for automote control or script language use
Display Labels for all analog inputs, discrete I/O and controlling RTU levels
Scaling factors and offsets (range and preset) for all analog displays
Adjustable pulse dividers for both pulse inputs
DF1 Half-Duplex Slave protocol option on the COM1 radio port
Modbus RTU Slave and Master protocol options on the COM1 radio port
RS-485 port for expansion I/O or Modbus RTU Master communication
RTU Script Language Programmability
Note: A later model S4000 utilizes a 32bit processor (like the S4500 PLC). This model, known as “Version 7”, runs much
faster, has larger communication buffers and includes the following capabilities:
• PID() function can have up to 8 loops running simultaneously
• DF1 Half-Duplex Master and Modbus/TCP protocols added
• Script main and subroutine sizes increased
• User Memory expanded to 6000 words
• Pulse input counters added to DI1-DI16 (PI3=DI1 - 50Hz max)
• Added ECCTABLE() function to allow RTU to reply with up to 64 addresses
• Added TSEC17-TSEC32 timer variables
I/O capabilities:
(8)
(8)
(8)
(16)
(8)
(8)
(2) (2)
(1)
(1)
Relay outputs
Open-collector outputs
Relay read-back inputs
Discrete inputs (contact closure)
12-bit analog inputs (0-20mA or 0-5volt dip switch selectable)
8-bit analog inputs
(4) are 0-5volt analogs AI9-AI12 on the terminal blocks
(4) are internal: box temp., battery volts, battery current and receive signal strength
Pulse inputs - high speed
RS-232 communication ports
- COM1 is the radio (COM1B=9pin monitor port, COM1A=25pin for radio cable)
- COM2 is used for the display and programming (baud rate fixed at 9600)
RS-485 communication port
- COM3 is a 4-wire RS-485 port for I/O modules or for Modbus communication
Address input switches (12-bits)
--
Specifications and Sales Information
Description:
Specifications:
I/O
The S4000 RTU is a reliable, full-feature Remote
Terminal Unit. It is a "smart" unit providing
both programmability and interchangeability through a
plug-in memory module. As an integrated component
of a Supervisory Control and Data Acquisition System
(SCADA), the S4000 provides input and output (I/O)
monitoring and control with simultaneous "distributed"
(RTU to RTU) and "central" (CTU to RTU) type
control operations. Its universal communications
interface can provide robust control and data transfer
via radio, dedicated line, phone line, and fiber optic
communication media.
• 8 Form C Relay Outputs, 5A @ 250VAC
• 8 Open Collector Outputs, 100mA @ 12VDC
• 16 Optically Isolated Discrete Inputs, Dry
Contact or Pulse Inputs
• 2 Optically Isolated High Speed Pulse Input,
12.8KHz Resolution
• 1 Pulse Amplification Circuit for Direct
Connection to Flow Meter
• 12 Analog Inputs
8ch, 12bit, 0-5V or 0-20mA Switch Selectable
4ch, 8 bit, 0-5V
• 1 Analog Amplifier Circuit
• 4 Additional On-Board Sensor Analog Inputs
Box Temperature, 0-150°F
Battery Current, ±10A
System Voltage
Receive Signal Strength
Applications:
SCADA Systems:
Water Distribution Control and Management
Waste Water Control and Monitoring
Golf Course Irrigation
Agricultural Irrigation
Gas and Oil Monitoring
Electrical Distribution Monitoring
Local Control:
Constant and Variable Speed Pump Stations
Metering Stations
Water and Waste Water Treatment Plants
Communications
• COM-1A, Radio Port
25pin Sub-D Male, RS-232 and RF signals
• COM-1B, Radio Monitor Port
9pin Sub-D Male TxD, RxD, RTS, GND
• COM-2, Front Panel Display
9pin Sub-D Male RS-232 w/flow control lines • COM-3, RS-485
• Plug In RF MODEM
0-300, 600, 1200/2400 BAUD
CPU and Memory
• 8bit MCU running 8MHz
• 32K FLASH EPROM, Application Program
• Up to 32.5K RAM, Data
• 8.5K EEPROM, Configuration
• 8K UVEPROM, BIOS
Part Number for Ordering:
L15-L17A-0
Memory:
0 - 8K SRAM
1 - 8K Battery Backed SRAM w/Clock
2 - 32K SRAM
3 - 32K Battery Backed SRAM w/Clock
Power Source and Supplies
• 120/240 VAC Power Input Isolation transformer
and Surge Suprestion
• SOLAR charging circuit
• Battery charging and backup circuit
• 13.8VDC @ 8A Switching Power supply
• 12 to 24VDC @ 200mA
Sensor Excitation power supply
Modem:
0 - none (110-19200 baud RS-232)
L17 - 0-300 baud radio modem
L17A - 0-600 baud radio modem
--
Board Connections and Jumpers
The diagram below shows where all I/O terminal blocks, communications ports, jumpers, switches and
other important items are located.
ON/OFF
AUX I/O
Output Relays
Processor Board
COM2
FLASH ROM
DTR
RAM/CLOCK
12V
COM1B
BIOS EPROM
COM1A
TX+
TX- COM3
RX+
RXSGND
+12V
GND
Radio Modem
Analog Input Switches
AAOUT
AGND
0-20mA
1
0-5V
0
--
RTU Address Switches
Sample Wiring Diagram
S4000 RTU PANEL
POWER CONNECTIONS - TB1
+24VAC
-24VAC
GND
120VAC/24VAC
Transformer
(by Micro-Comm)
BATT+
15A-C B
L1
N
G
POWER CONNECTION:
120VAC Power by Others - use
separate 15A circuit
breaker.
ECC #1
? A/Hr Battery
BATT-
DISCRETE OUTPUTS - TB2/TB3
DO1-NO
Discrete Ouput #1
Pump #1 Call
DO1-C
DO1-NC
DO2-NO
Discrete Ouput #2
Pump #2 Call
DO2-C
DO2-NC
DO3-NO
Discrete Ouput #3
Pump #3 Call
DO3-C
DO3-NC
DO6-NO
Discrete Ouput #6
Telemetry Control - Fails
(wired in series with
Closed
existing pressure backup
"CALL")
DO6-C
DO6-NC
ECC #2
DO7-NO
Discrete Ouput #7
Valve #1 Call
DO7-C
DO7-NC
DO8-NO
Discrete Ouput #8
Valve #2 Call
DO8-C
DO8-NC
--
S4000 RTU PANEL
DISCRETE INPUTS - TB4/TB5
Aux.
DI1
ECC #1
Pump #1 Run
Discrete Input #1
COM
Aux.
DI2
Pump #2 Run
Discrete Input #2
COM
Aux.
DI3
Pump #3 Run
Discrete Input #3
COM
DI4
Discrete Input #4
COM
DI5
Discrete Input #5
COM
DI6
Discrete Input #6
COM
Aux.
DI7
Valve #1 Open
Discrete Input #7
COM
Aux.
DI8
Valve #2 Open
Discrete Input #8
COM
DI9
Discrete Input #9
COM
DI10
Discrete Input #10
ECC #2
ECC #1
(DI9-DI16 are IEM Inputs 1-8)
COM
DI11
Discrete Input #11
COM
DI12
Discrete Input #12
COM
DI13
Discrete Input #13
COM
DI14
Discrete Input #14
COM
--
S4000 RTU PANEL
DISCRETE INPUTS - TB4/TB5
DI15
Discrete Input #15
COM
DI16
Discrete Input #16
COM
ANALOG INPUTS - TB7 thru TB9
24V-EX
Analog Input #1
with amplifier
circuit
ECC #1
3 conductor shielded cable
-
AA+
AGND
AA-OUT
+
shield connected to GND
Micro-Comm
60 psi
Transducer
Tank Level
Transducer
0-60 psi = 4-20mA
GND
JUMPER
AI1
AA-
JUMPER
AGND
R-
Span
Resistor
R+
24V-EX
Analog Input #2
3 conductor shielded cable
-
AI2
AGND
+
shield connected to GND
Micro-Comm
300 psi
Transducer
Discharge Pressure
Transducer
0-300 psi = 4-20mA
GND
PULSE INPUTS - TB6
ECC #1
12V-EX
Pulse Input #1
12V-EX
shield connected to GND
3 conductor shielded cable
shield connected to GND
--
Flow Meter
Head
(by others)
Electronic Flow Meter
Head
Gnd
ECC #2
+
Sig
PI2
GND
+
Sig
PI1
GND
Pulse Input #2
3 conductor shielded cable
Flow Meter
Head
(by others)
Gnd
Electronic Flow Meter
Head
S4000 RTU PANEL
RADIO CONNECTION - COM1A
25 Pin Male Sub-D Connector
12VDC
GND
TB1
FUSE
12VDC
GND
Pin 12
12 AWG RED
MDL 4A
12 AWG BLK
39KΩ Resistor
1
2
3
4
5
6
7
8
Pin 13
GND
TXA
PTT
Pin 14
Pin 19
RXA
Pin 16
Pin 7
RTU ADDRESS
SELECTION SW2
1
5
9
+ Pwr
- Pwr
GRN
RED
BLK
GRY
Motorola
Model SM50
Radio
RJ-45
Jack
Antenna
Coax
Lightning
Arrestor
Station Address Dip Switch-SW2
ON = 1
(
,
0
4
)
-
1
5 OFF = 0
*
+
.
/
2
3
6
7
Switches 1-4 set RTU #2's first character
Switches 5-8 set RTU #1's first character
Switches 9-12 set both RTU's last character
--
Radio Connection: Radio
connected to S4000 using
8 conductor flat phone cable
with 25 pin female Sub-D connector
to RJ-45 phone plug. Antenna
connected to lightning
arrestor using RG8U coax.
ECC #1 Address = ??
ECC #2 Address = ??
S4000 RTU PANEL
FRONT PANEL LAMPS & DISPLAY with KEYPAD
Door Mounted
12VDC LED Lamps
AUXILIARY OUTPUTS
25 Pin Female Sub-D Connector
Discrete Output #1
Pin 7
?
Pump #1 Call Lamp
Discrete Output #2
Pin 19
?
Pump #2 Call Lamp
Discrete Output #3
Pin 6
?
Pump #3 Call Lamp
Discrete Output #4
Pin 18
?
Discrete Output #5
Pin 5
?
Discrete Output #6
Pin 17
?
Telemetry Control Lamp
Discrete Output #7
Pin 4
?
Valve #1 Call Lamp
Discrete Output #8
Pin 16
?
Valve #2 Call Lamp
+13.8VDC
Pin 8
Software Output #1
(DO9)
Software Output #2
(DO10)
Software Output #3
(DO11)
Software Output #4
(DO12)
Software Output #5
(DO13)
Software Output #6
(DO14)
Software Output #7
(DO15)
Software Output #8
(DO16)
+13.8VDC
Pin 9
?
Pin 10
?
Pin 11
?
Pin 12
?
Pin 24
?
Pin 23
?
Pin 22
?
Pin 21
?
Pin 13
+13.8VDC
Pin 20
+13.8VDC
Pin 25
FRONT PANEL DISPLAY-COM2
9 Pin Female Sub-D Connector
CD
RXD
TXD
DTR or 13.8VDC
SG
DSR
RTS
CTS
RI
Pin 1
Pin 2
Pin 3
Pin 4
Pin 5
Pin 6
Pin 7
Pin 8
Pin 9
SMT Display
YEL
GRN
WHT
BLU
5
4
1
6
BLK
RED
2
3
NOTE: Jumper on the
Motherboard should be set
to 12V to power the
Display Module (not DTR)
- 10 -
with keypad
RJ-11
Jack
FRONT PANEL DISPLAY:
Operator Interface with LCD
display and keypad.
Displays local analogs, controlling
tank's level, and provides access
to control setpoints.
Expansion I/O Module Setup
(EAO2 Module)
The EDI16 and EAO2 modules allow an RTU to have additional
discrete inputs or analog outputs. These modules are connected to
the RTU using the COM3 terminal block on the S3000/S4000. Both
power and communication lines are provided by the RTU.
I/O Module
RTU
TX+
TXRX+
RXSGND
+12V
GND
TX+
TX-
RX+
RXSGND
+12V
GND
Dip switches set both the address of the module and the baud rate
used by the RS-485 connection to the RTU.
ON
1 2 3 4 5 6 7 8
Switches 1-6 set the address:
Module #1 = switches 1-6 off
Module #2 = switch 1 on, 2-6 off
Module #3 = switch 2 on, 1 and 3-6 off
Module #4 = switch 1 and 2 on, 3-6 off
Currently the S3000/S4000 supports up to 4 EAO2 modules (8 analog
outputs), up to 4 EDI16 modules (64 additional discrete inputs) and
up to 4 EDI16 modules (64 additional discrete outputs).
The baud rate is set using switches 7 and 8:
9600 baud = switches 7 and 8 off
4800 baud = switch 7 off, switch 8 on
2400 baud = switch 7 on, switch 8 off
1200 baud = switches 7 and 8 on
The default baud rate used by the S3000/S4000 is 9600 baud. This can be changed in the RTU
Configuration program is necessary.
- 11 -
Display Module Operation
The Micro-Comm display module allows the operator to view up to 16 analog levels, 16 discrete input
conditions, 16 discrete output conditions, change stop/start setpoints, change output timer settings (both
on and off delays) and view/change the script language user variables (X1-X24). In addition to these
options there is a debug mode available that will let the operator turn on and off outputs, check inputs
and view communications.
TOWER LEVEL
DISCHARGE
12.9 FT
120 PSI
1
2
3
4
5
6
7
8
9
YES
NO
.
0
SPACE
BKSP
ENTER
General Instructions:
• Use the Up/Down arrows to move between categories (analog level displays, discrete inputs and
outputs, timer settings, stop/start setpoints and user variables)
• Use the Right/Left arrows to move between items (which analog screen, timer output etc.)
• Press ENTER to start entering a value for timers or setpoints.
• Use the number keys to enter values. Use BKSP if you need to backspace.
• Press ENTER when done with each entry.
Special Debug Mode:
• Type .456 to get into the view communications screen. All radio communication data will then appear
on the display. Press the up arrow to get out of this mode.
NOTE: The display communicates with the S4000 using a serial cable (9 pin to RJ-11). The protocol
options should be set to 9600 baud, 8 data bits, none parity, echo disabled. These are the factory
defaults. To set a display back to factory defaults, hold down the PERIOD, ZERO and F1 keys during
power up. Then press the F1 key to reload the defaults.
To set parameters, press the PERIOD, ZERO and F1 keys any time after power up.
- 12 -
Software Description
As stated in the introduction, the current software version consists of basically 2 full-blown Enhanced
Control Cards and 1 extra Control Card for bringing back the remaining analogs and virtual I/O. The
table below shows how the large amount of physical I/O in the S4000 was mapped into Control Card
(“Micro-Comm RTU” Protocol) communication rules:
ECC #1 address selected with low 8-bits of address
S4000
Enhanced Control Card #1
Relay outputs 1-6
Discrete outputs 1-6
Discrete inputs 1-6
Discrete inputs 1-6
Discrete inputs 9-16
Input Expansion Module inputs 1-8
EDI Module #1 (1-16) Input Expansion Module inputs 9-24
(future virtual discretes)
Input Expansion Module inputs 25-32
High 8-bits of analog inputs 1-6 Analog inputs A,B,C,D,E,F
Pulse Input #1
Pulse Input
EAO Module #1
Analog Outputs 1-2
ECC #2 address selected with high 4-bits of address
(for example, if S4000 address is PTH, RTU #2 will respond as PH)
S4000
Enhanced Control Card #2
Relay outputs 7,8
Discrete outputs 1,2
Discrete inputs 7,8
Discrete inputs 1,2
EDI Module #4 (1-4 DI65-DI68) Discrete inputs 3-6
EDI Module #2 (1-16)
Input Expansion Module inputs 1-16
Relay read-backs 1-8
Input Expansion Module inputs 17-24
Open collector outputs 1-8 status
Input Expansion Module inputs 25-32
High 8-bits of analog inputs 7-12 Analog inputs A,B,C,D,E,F
Pulse Input #2
Pulse Input
EAO Module #2
Analog Outputs 1-2
ECC #3 address selected in Personality Module
S4000
Enhanced Control Card #3
EDI Module #4 (5-10 DI69-DI74) Discrete inputs 1-6
Battery Voltage (AI13)
Analog input A
Box Temperature (AI14)
Analog input B
Batt. Current (AI15) Analog input C
Rec. Signal (AI16) Analog input D
EDI Module #3 (1-16)
Input Expansion Module inputs 1-16
EDI Module #4 (1-16)
Input Expansion Module inputs 17-32
Software computations (PI3)
Pulse Input
EAO Module #3
Analog Outputs 1-2
- 13 -
S4000 RTU Enhanced Control Card (ECC) I/O Layout
- 14 -
NOTES:
1) Removable Personality Module
Important configuration data is written 3 times in the removable personality module (RPM). If 2 out of the 3 locations
match, then the data is used otherwise default values are used. If the RPM is removed during operation, it will continue to
use the current configuration data but if the power is cycled it will use all default values. A bit will be set in the reply to
the CTU that will tell SCADAview when the RPM is not working (uses bit 6 in discrete input byte). The default values are
generally the same as a normal control card (600 baud, ROM stored stop/start settings etc.) with the exception of the timer
values. Both the ON and OFF timers will default to 120 seconds plus 20 seconds more for each output.
Labels and scaling factors are also stored in the RPM. These as well as the configuration data are changed using the
RTU Configuration program.
2) FLASH ROM
The main RTU program is stored in the FLASH ROM. When you need to update the S4000 software, you can use
the RTU Config program along with the .S19 file containing the new program. Reprogramming the FLASH is a little
dangerous and will result in the RTU not working at all if you stop the programming before it is finished.
- 15 -
Allen-Bradley DF1 and Modbus Protocol Support
The S3000/S4000 can use Allen-Bradley DF1 half-duplex slave protocol, Modbus RTU Slave and Modus RTU Master
protocols. The information below describes what options are supported and how the I/O is mapped:
DF1 Specifications
Data Link Layer Protocol:
Error Checking:
Message Packet Formats:
Modbus Specifications
Protocol Mode:
Error Checking:
Function Codes Supported:
SLC-500 File
DF1 Half-Duplex Slave
CRC-16
SLC-500 Protected Typed Logical Reads/Writes
RTU Slave and Master
CRC-16
Slave: 3-Read Holding Registers, 6/16-Preset Single/Multiple Registers
Master: 1-Read Coil Status, 2-Read Input Status, 3-Read Holding Registers,
4-Read Input Registers, 15-Force Multiple Coils, 16-Preset Multiple Registers
Note: Master messages are defined in the script using the MESSAGE function.
Modbus
RTU Physical I/O and Memory Registers
N9:0
r
40001
r Discrete Inputs DI1-DI16
N9:1
r
40002
r EDI #1 Discrete Inputs DI17-DI32
N9:2
N9:3
N9:4
r
r
r
40003
40004
40005
r EDI #2 Discrete Inputs DI33-DI48
r EDI #3 Discrete Inputs DI49-DI64
r EDI #4 Discrete Inputs DI65-DI80
N10:0
N10:1
r/w
r/w
40006
40007
r/w Discrete Outputs DO1-DO16
r/w EDO #1 Discrete Outputs DO17-DO32
N10:2
N11:0
r/w
r/w
40008
40009
r/w EDO #2 Discrete Outputs DO33-DO48
r/w EDO #3 Discrete Outputs DO49-DO64
N11:1
r/w
40010
r/w EDO #4 Discrete Outputs DO65-DO80
N12:0 - N12:7
r/w
40011-40018
r/w Analog Outputs 1-8 (12 bit)
N13:0 - N13:15
r
40019-40034
r Analog Inputs 1-16 (12 bit)
N14:0 - N14:2
r
40035-40037
r Pulse Input Registers PI1-PI3 (16 bit)
N15:0 - N15:23
r/w
40101-40124
r/w Stop/Start Setpoints 1-12 STOP1,START1,STOP2,START2 etc. (8 bit)
N16:0 - N16:49
r/w
40201-40250
r/w X Script User Variables X1-X50 (16 bit words)
N17:0 - N17:15
r
40301-40316
r Timer Variables TSEC1-TSEC16 (16 bit @ 35.55msec/bit)
N18:0 - N18:63
r
41000-41063
r PMEM Personality Memory (16 bit words)
N19:0 - N19:255
r
42000-42499
r NV Memory Locations 0-255 (0-499 for modbus) (16 bit words)
r/w
43000-43049
r/w User Memory Locations (MREAD,MWRITE) 0-49 (16 bit words)
N20:0 - N20:49
NOTES:
1) When a word location contains an 8 bit value from the RTU, only the word’s LSB is used (MSB will be zero).
2) The order of the SLC-500 integer files was made to match the order expected by the C2000 when mapping CTU I/O.
3) Some locations are read-only "r" and some are read-write "r/w" depending on the protocol.
- 16 -
S4000 RTU Configuration Program
Program Installation
Two versions of the RTU Configuration programs are available (one for Windows 95/98/NT/2000 and
the other for Macintosh). The Windows version will be the one described and pictured in this manual,
however the Macintosh version looks basically the same and the file format is identical.
To Install the Windows version, follow the steps below:
When upgrading to a new version of the program, go to the Control Panels in Windows95/NT and
double-click on Add/Remove Programs. Look through the list and remove any old versions of RTU
Configuration.
1) Insert the CD into the CD-ROM Drive.
2) RUN the SETUP program located on the CD-ROM.
3) Follow the prompts and do a typical install.
4) After installation, the program icon will appear in the Start menu’s Program list.
When running the configuration program for the first time you will need to look in the communications
setup screen to make sure you have the correct COM port number selected. The com port setup is located
in the program’s “Setup” menu. Connection to the S4000 is by means of a Null-modem cable from the
computer’s RS-232 port to the S4000 COM2 port (display port).
- 17 -
RTU Information Screen
The RTU Information screen contains version, date, checksums, user information, address switch settings
as well as a picture of the RTU. This information about the RTU will be available after the user has read
the Personality Module. The Job Name and Site Name fields can be changed if necessary and the User
Name and Last Programmed will reflect who made the most recent change. All the “User” information is
sent to the RTU whenever the personality data is uploaded.
- 18 -
Configuration Parameters
The screen below shows a sample RTU Configuration dialog box. This screen is where all the operational
parameters stored in the Personality Module can be changed (radio communications parameters, output
timer settings, automote control settings and stop/start setpoints).
To retrieve the personality data from an S4000, click on the blue down arrow icon or select Read
Personality Data from the Transfer menu. After making changes, click the blue up arrow icon or select
Program Personality Data from the Transfer menu.
- 19 -
Radio Communication Parameters
Model Name
The model name of the RTU being configured is selected and shown here. This will always change to reflect
the actual RTU whenever the personality data is retrieved. The S3000, S4000, O300 and M2000 are currently
supported and different setup parameters may be available depending on the RTU. For instance the O300
(Onecard III) RTU does not have an ECC #2 so these options are hidden when programming an O300.
Protocol
The protocol selection for the radio communications port (COM1). Options include Micro-Comm RTU
(enhanced control card), Allen-Bradley DF1 Half-Duplex Slave, Modbus RTU Slave and Modbus RTU
Master.
Baud Rate
This selects the speed for the radio communications port (COM1). 110, 300, 600, 1200, 2400, 4800, 9600
and 19200 bps are supported.
Data Bits
The number of data bits used by the radio port (5, 6, 7 or 8). This should be set to 7 for Micro-Comm
RTU communications.
Parity
Parity checking mode (Even, Odd or None). Even parity should be selected when using Micro-Comm
RTU protocol.
Stop Bits
The number of stop bits used by the radio port (1 or 2). This should be set to 2 for Micro-Comm RTU
communications.
PTT
Time in milliseconds that will occur after the radio is keyed and before the data is sent out the radio port.
This should normally be set to 200 msec or more for Micro-Comm RTU communications using conventional
radios. Data radios will allow for much lower PTT times (50 msec or less).
Station #
For use with Modbus or DF1 protocols ONLY. This sets the station # for this RTU as used by the protocol.
COM2 Protocol
Communication protocol used for the display module on COM2. This can be Micro-Comm,
DF1 Half-Duplex Slave, Modbus RTU Slave or Modbus RTU Master.
COM3 Protocol
Protocol used on the COM3 RS-485 port (S3000/S4000). This can be Micro-Comm I/O,
Modbus RTU Slave or Modbus RTU Master. When using Modbus, the messages are defined in
script using the MESSAGE() function.
COM3 Baud Rate
Communications speed for the Micro-Comm I/O modules or for Modbus RTU Master
communication. The default is 9600 baud.
Output Timer Settings
The timer settings control how long the RTU will wait to energize or de-energize a relay output when it has been told to come
on or go off. These timers will always be used regardless of the mode of operation - Micro-Comm CTU control, Automote
(backup) control, Script Language, Modbus or DF1.
NOTE: When using Micro-Comm RTU protocol ECC #1 will use relay outputs 1-6 and ECC #2 will use relays 7 and 8
as it’s discrete outputs 1 and 2.
Stop/Start Setpoints
These setpoints are used by the RTU to control the outputs based on the controlling address’s analog input #1 when operating in
backup control mode. In this way a pump station, for instance, can listen to the controlling tower and control the pumps based
on tank level even if the Central Terminal Unit (CTU) has failed. The setpoints entered here are also available through the front
panel display for operator entry. Stop/Start 1-5 are used for ECC #1 and Stop/Start 7-8 are used with ECC#2.
STOP / START 1-12
Stop and Start setpoints 1 through 12 scaled using the analog selected in theStop/Start Labels screen.
- 20 -
ECC #1 and ECC#2 Options
When using Micro-Comm RTU protocol, there are two separate ECC’s used for communication (two separate enhanced control
card software modules). The options listed below are available on both ECCs:
Pulse Divider
Sets the number of pulses that must occur before the ECC’s pulse input counter is incremented. Very
high speed pulses must be divided down in CTU based systems because of the relatively slow polling
times used and the fact that the pulse input counter is only 16bit. Normally this will be set to 1.
Controlling Address The 2-character address (HH-WW) of the station that will be listened to and used for control by this
ECC. The controlling address’s analog input #1 can be shown on the display module and analog inputs
#1, #2 and discrete inputs 1-6 can all be accessed from within the Script.
Relay Address
The 2-character address (HH-WW) of the station that will be used as the relay site when the ECC sends
it’s automote transmission. NOTE: Setting the address to HH will disable this option.
LOS Time
The time in seconds that the ECC will wait for a central transmission before it gives up and turns off all
the control outputs (1-6 for ECC#1 and 7-8 for ECC#2). This condition will also set a bit in memory
that the Script Language code can use for control.
Automote Time
The time in seconds that the ECC will wait for a central transmission before it begins controlling it’s
outputs based on the controlling address’s analog input #1 along with the backup control setpoints.
This condition will also set a bit in memory for the Script Language to use. This mode or operation is
known as “Automote” or “Backup” control.
Automote Cycle
The time in seconds between transmissions from this ECC when it has gone into automote.
Automote Transmit Whether or not this ECC will transmit it’s automote communications string.
Transmit ALL Data Autmote transmissions wil contain all the ECC’s data (not just analogs A,B and discretes).
Automote Control
ECC #3 Options
Whether or not this ECC will control it’s outputs when in automote. In some cases it may be desirable
to do all the control from within a Script instead of allowing automote to do the control.
ECC #3 is an extra enhanced control card module that will respond when using Micro-Comm RTU protocol. This RTU
is used for bringing back extra analog inputs, 2 more EDI16 modules as IEMs, calculated pulse inputs (PI3 in the Script),
or other calculated values.
RTU Address
Any valid 2-character address (HH-WW) to be used by ECC #3. An address of HH will disable
this option.
Monitor Address
Any valid 2-character address (HH-WW) to be monitored by ECC #3. Analog inputs 1,2 and the discrete
input byte from the monitor address can be used in script for control and/or display.
M2000 Options
The following options are only available when configuring a Micro-Comm M2000 RTU.
Enable Sleeping
When checked, the RTU will go into low-power mode after it is polled from the central or sends an
automote transmission.
Sleep Time (sec)
When sleeping is enabled, the RTU will wake up and listen after this timer (seconds) has elapsed.
Stay Awake (sec)
When sleeping is enabled, the RTU will stay awake this many seconds after being polled (in case it needs
to do some relaying to other sites).
RS-485 I/O
When checked, the RTU will use the RS-485 port for communication with Micro-Comm expansion I/O
modules. If this option is not used, a Micro-Comm Display Module can be attached to the RS-485 port.
- 21 -
Analog Labels and Scaling Factors
To change analog labels and scaling factors, click on the blue water tower icon or select Analog Labels &
Scales from the View menu. The labels and scales are retrieved/sent to the S4000 during reading/writing
of the personality module.
Up to 16 analog levels can be displayed and they will always appear in the order entered in the setup
screen. If an analog label is left blank it will not show up on the display.
When analog levels are displayed, the offset is first added to the analog value and the result is then
multiplied by the range value. (This is the same as the SCADAview program).
- 22 -
Output Timer Labels
To change the 20 character output timer display labels, click on the wristwatch icon or select Timer
Labels from the View menu. The labels are retrieved/sent to the S4000 during reading/writing of the
personality module data.
NOTE: Output 6 is currently always used for Telemetry Control on ECC#1. Output 7 and 8 are ECC#2’s
output 1 and 2.
- 23 -
Stop/Start Setpoint Labels
Stop/Start labels are used on the Display Module to allow the operator to change operational parameters
such as Pump Stop/Start setpoints, High/Low alarms and Pump Restore/Cutoffs. Along with the 20
character label is a selection for what type of setpoints and which analog input # will be used for scaling
and units.
Note: Lines where the label is left blank will not be accessible from the Display Module.
- 24 -
User Variable Labels
User variables are the 16-bit unsigned integer X1-X24 script language variables that can be used for any
purpose. By entering a label in the User Variable Labels setup screen, the current value will be shown
and can be changed on the Display Module.
- 25 -
Discrete I/O Labels
Labels for both 16 discrete inputs and 16 discrete outputs are user defined as of Version 3.0.0 of the
S3000/S4000 software. These labels may be used to display pump calls, pump runs, valve positions,
alarms etc. A 12-character label is used to name the input or output along with a 6-character ON label
and a 6-character OFF label to describe the on or off state. If the input or output name is left blank it
will not appear on the display and if no discretes are labeled the display will just skip over the entire
section (inputs or outputs).
The screen below shows both the Discrete Input Labels and the Discrete Output Labels setup screen:
- 26 -
RTU Script Language Editor
To enter or edit the Script Language Code, click on the script icon or select Script Language Editor
from the View menu. The screen shown below contains the Entry Alarm sample script included when
installing the configuration software. This was loaded by selecting Open File... from the file menu and
then double-clicking on the EntryAlm.S4C file.
Script language can be retrieved from the S4000 by clicking the Read button shown at the bottom of the
editor window or by selecting Read RTU Script from the Transfer menu.
Lines starting with a single quote character are comments and do not get sent to the S4000 when
programming. Comments are only saved in the .S4C configuration file.
After entering lines of code the user can click the Check button to make sure the syntax looks ok and to
see how many bytes of code have been used. Currently the script code can’t be larger than 2048 bytes.
The code is then programmed into the S4000 personality module by clicking the Program button or by
selecting Program RTU Script in the Transfer menu.
Script subroutines are edited by selecting the subroutine number from the list in the lower-left corner of
the screen. Each subroutine can be read, programmed and checked separately using this editor.
- 27 -
Data Table Viewer
The Data Table Viewer screen allows the operator to see and change I/O variables, User variables and
the Stop/Start setpoints in real-time when connected to an RTU. This screen can be very useful when
debugging script language code.
Analog inputs and Stop/Start setpoints are displayed as 12-bit numbers (0-4095) or can optionally be
scaled based on the range/offset values entered in the analog setup screen. Discrete inputs and outputs are
shown as either 1 or 0 (on or off). The TSEC timers will show the number of seconds remaining (0-2330)
and the X user variables will be displayed as 16-bit decimal numbers (0-65535).
When the “Force I/O” option is checked, the I/O variables shown in red may be changed to the desired
value by clicking on the readout box, typing a new value and pressing enter. When the “Disable Script”
option is also checked, the script will stop running and any I/O that it was controlling will then be
accessible.
The Data Table has three extra screens that can be opened:
“More RTU Information” shows the RTU model number, software version number and checksums. The
current automote status bits for each ECC are also shown.
“Output Timer Status” allows the user to see and change discrete outputs, relay output timer counts and
settings and the current automote and override timer values.
“User Memory” shows the current values for all 50 user memory locations (accessed in script with the
MREAD and MWRITE functions).
- 28 -
Display Module Emulator
The display module is an optional hardware component to an S4000 RTU which allows an operator to
see levels and change setpoints. When programming the S4000 with the RTU Configuration program
the operator can use the Display Module Emulator screen to see what the display module would show.
This is very useful since both the display module and the programming software must use the same port
on the RTU (COM2).
- 29 -
Debug Terminal
The Debug Terminal screen allows the user to interact directly with the RTU over the programming port
(COM2) or with other third-party equipment. It will display incoming data using ASCII, Modbus or DF1
mode based on the selection in the lower-left hand corner of the screen. Data logging can also be done by
clicking on the “Log Data...” button and typing in a file name.
When connected to the RTU’s programming port (COM2), radio communications on COM1 can be
monitored by typing “.456”.
- 30 -
RTU Script Language Syntax
Micro-Comm S3000/S4000 - RTU Script Language Rev. 6.1.6 – 4/22/2004
Numbers:
16-bit unsigned integers (0 to 65535)
All computations are done with integer math.
Variables:
DI1-DI16
DI17-DI32
DI33-DI48
DI49-DI64
DI65-DI80
DO1-DO8
DO1TD-DO8TD
DO9-DO16
DO17-DO32
DO33-DO48
DO49-DO64
DO65-DO80
AI1-AI16
T1AI1, T2AI1
T1AI2, T2AI2
T1DI1-T1DI6
T2DI1-T2DI6 T1PI1, T2PI1
AO1-AO8
PI1,PI2
PI3
TSEC1-TSEC16
STOP1-STOP12
START1-START12
X1-X50
L1-L5
Discrete inputs 1-16 (1=on, 0=off)
EDI Module #1 discrete inputs
EDI Module #2 discrete inputs
EDI Module #3 discrete inputs
EDI Module #4 discrete inputs
Discrete outputs 1-8 using the timers
Discrete output 1-8 Timer Done (1=relay is energized) - read only
Open collector outputs on the AUX connector 1-8
EDO Module #1 discrete outputs
EDO Module #2 discrete outputs
EDO Module #3 discrete outputs
EDO Module #4 discrete outputs
Analog inputs 1-16 (12bit 0-4095)
ECC#1, ECC#2 controlling site’s AI1 (from hearing a reply) - read only
ECC#1, ECC#2 controlling site’s AI2 (from hearing a reply) - read only
Discrete inputs from ECC#1’s controlling site - read only
Discrete inputs from ECC#2’s controlling site - read only
ECC#1, ECC#2 controlling site’s PI1 (from hearing a reply) - read only
EAO Module 1-4 analog outputs (12bit 0-4095)
ECC#1, ECC#2 pulse input counters (16bit) - read/write
ECC#3 virtual pulse input counter - read/write
General purpose seconds timers (count down, settable from 0 to 2330 seconds)
Stop setpoints accessed from display (converted to 12bit) - read only
Start setpoints accessed from display (converted to 12bit) - read only
User variables (16bit) - read/write
Local subroutine variables (16-bit) – read/write inside subroutines
Operators:
+
-
*
/
%
|
&
!
^
==
<> <
>
<= >=
=
addition
subtraction
multiplication
division
remainder
OR (bitwise or)
AND (bitwise and)
NOT (logical not - not 1=0 and not 0=1)
XOR (bitwise exclusive or)
is equal to (tests for equality)
not equal to (tests for inequality)
less than
greater than
less than or equal to
greater than or equal to
assignment (sets a variable equal to something)
- 31 -
Functions:
AIN(x)
AITOPI(ai#,pi#,420flag)
Returns the 12-bit analog input value for input #x. The analog input number can be 1-16.
Sets the parameters for the real-time analog input to pulse converter. Setting ai# or pi#
to 0 disables this option. The 420flag tells the converter which analog input scale to use
(0=0-5volt or 1=4-20ma). Both analog modes use a pulse counter scale of 0 to 64 pulses
per second.
ai# - analog input # (1 to 16)
pi# - pulse input # (1 to 3)
420flag – analog scale
Example: AITOPI(3,1,1) Converts a 4-20ma signal on AI3 to a pulse of 0-64pps on PI1.
Note: The analog input must be a “real” input since this function uses the raw input value.
Up to 3 real-time converters can be running at once – one for each pulse input.
AOUT(x,y)
Writes the 12-bit value y to analog output #x. Analog outputs 1-8 are currently supported
using (4) EAO2 modules.
AUTOMOTE(ecc#)
Causes the given ECC# (1 or 2) to transmit it’s automote string immediately. The given
ECC# must be set up for Automote Transmit and must have already gone into automote.
DIN(x)
Returns the value for discrete input #x. The returned value will be 0 if the input is off and
1 if the input is on. Discrete inputs 1-80 are currently supported (16 on-board and up to 4
EDI16 RS-485 I/O modules).
DOUT(x,y)
Energizes or de-energizes output #x based on the value y. The value of y should be 0 to turn
off an output and 1 to turn it on. Discrete outputs 1-8 are relays and will therefore use the On
and Off timer settings. Discrete outputs 9-16 are the open collector outputs which have no
timers associated with them. Discrete inputs 1-80 are currently supported (16 on-board and
up to 4 EDO16 RS-485 I/O modules).
EXIT() or EXIT(x)
Exits the script immediately without processing any more lines. This can be used to bypass
whole sections of code based on some condition. It can also be used to exit a subroutine and
optionally return a value (x) to the main script.
FPSCL(mloc,fl,fh,sl,sh)
Returns a scaled value given a floating-point number at mloc, the min/max floating point
value (fl and fh) and the min/max scaled value (sl and sh). The “mloc” is the starting memory
location for the floating-point number since floating-point numbers are 2-words long. This
function can be used along with the MESSAGE command to convert floating-point numbers
in a PLC to unsigned integer values we can deal with.
For example, if a Modbus speaking PLC has a floating point number located at 40001, the
following two lines of script could be used to read and convert it to integer:
MESSAGE(3,0,1,40001,0,2,3000)
X1=FPSCL(3000,0,1,0,4095)
This example assumes the range is 0-1 for the floating-point register and we are converting
it to 0-4095.
IF(x,y,z)
If x is true evaluate y else evaluate z (else is optional). Multiple statements may be used for y
or z by separating them with a colon. i.e. IF(DI1, DO1=1:DO2=1, DO1=0:DO2=0)
MCOPY(src, dst, nwords)
Copies data from one location in the RTU to another given the following parameters:
src - start memory location for the source data
dst - start memory location for the destination data
nwords - the number of words (16bit values) to copy
Note: A memory location in the RTU will correspond to it’s Modbus reference location
shown in the S4000 DF1-Modbus table minus 40000. Supported memory locations include
all the I/O data (1-37), X Variables (201-250) and User Memory Locations (3000-3049).
Example: To copy the first 16 discrete inputs to X2, the command is MCOPY(1,202,1)
- 32 -
MESSAGE(port, type, addr, ref, offset, npts, mloc, timeout)
Sets up an entry in the message polling table with the following parameters:
Modbus RTU Master Messages (type 0 and 1)
port - com port number (1,2 or 3)
type - message type (0=Modbus RTU Read, 1=Modbus RTU Write)
addr - address of the modbus slave device (1 to 247)
ref - modbus reference location in the slave to start reading or writing
offset - offset added to the reference location to start reading or writing
npts - number of data points (bits or words) to read/write (20 words max.)
mloc - RTU memory location for the data (this will be our modbus slave reference minus
40000; for the I/O 1-37, X Variables 201-250 and User Memory 3000-3049)
timeout - amount of time in milliseconds the RTU will wait for a response
Micro-Comm Read/Write Messages (type 2)
port - com port number (1)
type - message type (2=Micro-Comm RTU Read/Write)
addr - address of the station being polled (0-255 where HH=0, WW=255)
ref – relay station address (0-255)
offset – antenna relay mask (0=no antenna switching, 1=output #1 etc.)
npts - number of data words to read (8 words max.)
mloc - RTU memory location for the data (same as above for modbus). The first 2 words
will always be the output data (discrete output byte and analog output #1). The data read
from the station will be located at words 3-10 depending on how many words are being
requested with the npts parameter. The data order for the entire buffer is shown below:
Word #1: Discrete Outputs 1-6
Word #2: Analog Output #1
Word #3: Discrete Inputs 1-16
Word #4: Analog Inputs #1
Word #5: Analog Inputs #2
Word #6: Analog Inputs #3
Word #7: Analog Inputs #4
Word #8: Analog Inputs #5
Word #9: Analog Inputs #6
Word #10: Pulse Input #1
Note: Analog Output #1 is converted to 8bit for transmission and all analog Inputs are
converted to 12bit after being received.
MREAD(x)
Returns the 16bit value stored in user memory location x (0-49).
MWRITE(x,y)
Writes the 16bit variable or constant y to the user memory location specified by x (locations
from 0-49 are supported).
NVREAD(x)
Reads and returns the 16bit value stored in non-volatile memory location x (0-499).
NVWRITE(x,y)
Writes the 16bit variable or constant y to the non-volatile memory location specified by
x (locations from 0-499 are supported - non-volatile memory is the Personality Module
in the S3000/S4000).
PID(t,ai#,ao#,p,i,d,mn,mx,st)
Sets the parameters for the real-time PID module.
t = target setpoint (0-4095) ao# = analog output # used (1-8)
i = integral term x 1000 (0-65535)
mn = minimum analog output (0-4095)
st = starting value for analog output (0-4095)
- 33 -
Setting ao# to 0 disables the PID.
ai# = analog input # used (1-16)
p = proportional term x 1000 (0-65535)
d = derivative term x 1000 (0-65535)
mx = maximum analog output (0-4095)
PMEM(x)
Returns a byte from the RAM copy of the personality module configuration (locations
0-127). First pass bit, automote status, setpoints, timer settings, real-time clock etc. can
all be read from here. Refer to the personality module memory map for more info.
SCALE(x,rl,rh,sl,sh)
Scales the variable x given the minimum/maximum raw value and the minimum/
maximum scaled value. X is changed to the new scaled value.
SKIP(x)
Skips the next x number of lines in the script. Used to jump over sections of script
based on some condition. i.e. IF(DI1,SKIP(4)) would skip the next 4 lines whenever
discrete input #1 is on.
SQR(x)
Returns the square root of x.
SUB1(x)-SUB4(x)
Calls a subroutine and returns the EXIT(x) value to the main script routine.
Currently up to 4 subroutines are supported. Values can be passed to a
subroutine using the following syntax: SUB1(x1,x2,x3,x4,x5)
Where x1 through x5 are 16bit integer variables or constants passed by value
to the subroutine. They become local variables referenced as L1 through L5
from within the subroutine.
Example:
The following shows the main script and a subroutine. The subroutine totals up the
three values passed and returns the result to the main script. The main script
stores the result in the X1 variable.
Main Script
X1=SUB1(1,2,3)
Subroutine #1
L4=L1+L2+L3
EXIT(L4)
T1AIN(x)
Returns the value of the controlling address’s analog inputs (1 to 6) for ECC#1.
T1AIN(1) and T1AIN(2) will be the same as variables T1AI1 and T1AI2.
NOTE: Expanded analog input data is only buffered by the RTU when it hears
a reply containing “all station data”.
T2AIN(x)
Same as above for ECC#2’s controlling station.
T1DIN(x)
Returns the value of the controlling address’s discrete inputs (1 to 32) for ECC#1.
Discrete inputs DI1-DI6 and DI9-DI32 match the physical or scripted inputs
at the controlling station. T1DIN(1)-T1DIN(6) will be the same as T1DI1-T1DI6.
T1DIN(7) will return the controlling station’s personality module fail flag.
T1DIN(8) will return the controlling station’s override flag.
NOTE: Expansion discrete input data is only buffered by the RTU when it hears
a reply containing “all station data”.
T2DIN(x)
Same as above for ECC#2’s controlling station.
TIME(x)
Returns the system time value based on the item number requested. The items available
are as follows: (Note: Items 1-7 require a clock chip to be installed. The time and date
are set whenever the configuration is programmed).
0 – Seconds since power-up (rolls over at 65535) 4 – Year (0-99)
1 – Day of the week (Sunday = 1)
5 – Hours (0-23)
2 – Month (1-12)
6 – Minutes (0-59)
3 – Day (1-31)
7 – Seconds (0-59)
NOTE: Some functions are only available on the S3000/S4000 RTU. In particular the AIN(), AOUT, DIN(), DOUT() and
MESSAGE() functions will not work on an M2000 or the O300 Onecard III. When the RTU configuration program compiles
the script, it will warn the operator if a function is not available.
- 34 -
General Script Examples:
AI3=AI16
PI3=PI1+PI2
DO1=DI1
DO1=!DI1 DI16=DO1TD
DO2=DI1 | DI2
DO11=T1DI1
AO1=T1AI1
IF(AI2>2048,DO1=1)
IF(AI2<1024,DO1=0)
copy analog input 16 to analog input 3 (writes over the physical AI3)
add pulse counters 1,2 and put result in ECC#3’s pulse counter (add flows)
turn relay #1 on/off based on discrete input #1
turn on relay #1 if input #1 is off and vice versa
set discrete input 16 to 1 if output #1 is on and timed out
turn relay #2 on if input #1 or input #2 is on
turn open collector #3 on/off based on ECC#1’s controlling site input #1
set analog output#1 (I/O expansion module) to equal ECC#1’s controlling site level
turn on relay output#1 if analog gets above half scale
turn off relay output#1 if analog gets below 1/4 scale
High Discharge Cutoff Example:
IF(AI1>START3,DO3=1)
IF(AI1<STOP3,DO3=0)
Timed Output Example:
IF(!DI1,TSEC1=5)
IF(DI1&(TSEC1>0),DO1=1,DO1=0)
turn output #3 on if above the start (alarm) setpoint
turn output #3 off if below the stop (restore) setpoint
NOTE: Relay and open collector outputs are latched on when set to 1.
The script must be set them back to zero to shut off.
if input #1 is not on, reset the seconds timer to 5 seconds
if input #1 is on and the timer is not timed out, turn on output #1 otherwise turn
output #1 off.
300# Transducer - Using a 0-255 PSI Range:
SCALE(AI2,819,3604,0,4095)
the 4-17.6mA range of a 300psi transducer is scaled to 0-255psi (0-4095 is used as the
scaled min and max since analogs are divided by 16 before being sent back as 8bit. All
analogs are treated as 12bit in the script.)
Entry Alarm Example:
IF(DI3,X1=0:TSEC1=120)
Operator Present discrete input #3 resets the alarm flag and the exit timer
IF(!TSEC1&!DI4,X1=1)
If the exit timer times out and the doors are not closed, set the alarm flag
IF(!X1,TSEC2=120)
Reset the alarm timer if there is no alarm
IF(!TSEC2,DO9=1,DO9=0)
If the alarm timer times out, turn on the alarm lamp or horn
NOTES: This Entry Alarm uses a 2 minute exit timer and a 2 minute alarm timer
Input #3 = operator present/armed keyswitch input (1=operator present)
Input #4 = door switches (1=all doors closed)
Output #9 = Entry alarm output (lamp or just sent back to the CTU)
- 35 -
Micro-Comm Script Language - RTU Processing Flow Chart
Much like a PLC processing ladder logic, the script is executed in a continuous loop.
All I/O is read and written outside of the script so all changes made to inputs or outputs
will actually occur when the script finishes.
Read Inputs
(analogs, pulses,
discretes)
Respond to Interrogations
Update the User Display
Local Automote Control
Groups
Run Script
General Housekeeping...
Write Outputs
(start timers etc.)
- 36 -
Micro-Comm Script Language - Ladder Logic Comparisons
The following is a list of Script Language instructions and their corresponding Ladder Logic
equivalent. The Ladder Logic shown is similar to Allen-Bradley SLC-500 instructions.
Script Language
DO1=DI1&DI2
DO1=!DI1&DI2
IF(DI1&DI2,DO1=1)
IF(!DI1&!DI2,DO1=0)
DO1=!DI1|DI2
Ladder Logic
DI1
DI2
DO1
DI1
DI2
DO1
DI1
DI2
DO1
L
DI1
DI2
DO1
U
DI1
DI2
- 37 -
DO1
Script Language
Ladder Logic
MOV
AI2=AI1
AI1
Dest
AI2
SCP
X1=AI1
SCALE(X1,819,4095,0,4095)
Scale w/Parameters
Input
AI1
Input Min.
819
Input Max.
4095
Scaled Min.
0
Scaled Max
4095
Scaled Output
X1
DO1
GEQ
IF(AI1>=2048,DO1=1)
MOVE
Source
GRTR THAN OR EQUAL
Source
AI1
Dest
2048
- 38 -
L
Personality Module Memory Map
Addr
0-
Description
Radio Port Baud Rate
123-
ON Timer for output #1 MSB (timer res = 35.55 msec)
ON Timer for output #1 LSB (0-65535 = 0-2330 sec)
ON Timer for output #2 MSB
65 66 67 -
ECC#2 Automote Xmit Control (b0=xmit, b1=send all)
ECC#2 Automote Time (MSB)
ECC#2 Automote Time (LSB)
456-
ON Timer for output #2 LSB
ON Timer for output #3 MSB
ON Timer for output #3 LSB
68 69 70 -
ECC#2 Automote Cycle Time (MSB)
ECC#2 Automote Cycle Time (LSB)
ECC#2 Analog Output #1 (from CTU)
789-
ON Timer for output #4 MSB
ON Timer for output #4 LSB
ON Timer for output #5 MSB
71 72 73 -
ECC#2 Address (from switches)
ECC#2 LOS Time (MSB)
ECC#2 LOS Time (LSB)
10 11 12 -
ON Timer for output #5 LSB
ON Timer for output #6 MSB
ON Timer for output #6 LSB
74 75 76 -
ECC#2 Status Byte (b0=LOS,b1=Automote,b2=Override)
ECC#2 Automote control flag (1=disable)
ECC#2 Discrete Output Image byte (from CTU)
13
14
15
16
ON Timer for output #7 MSB
ON Timer for output #7 LSB
ON Timer for output #8 MSB
ON Timer for output #8 LSB
77
78
79
80
ECC#2 Automote Relay Address
ECC#2 Analog Output #2 (from CTU)
Radio Port Parity, Data Bits (UART-MR1A)
Radio Port Stop Bits (UART-MR2A)
17 18 19 -
OFF Timer for output #1 MSB
OFF Timer for output #1 LSB
OFF Timer for output #2 MSB
81 82 83 -
Radio Port PTT Delay (x10 msec increments)
Radio Port Protocol (1=MC-RTU, 2-DF1, 3-Modbus)
Station # (for DF1 or Modbus slave)
20 21 22 -
OFF Timer for output #2 LSB
OFF Timer for output #3 MSB
OFF Timer for output #3 LSB
84 85 86 -
ECC#3 Station Address
ECC#3 Discrete Output Image byte (from CTU)
ECC#3 Monitor Address
23 24 25 -
OFF Timer for output #4 MSB
OFF Timer for output #4 LSB
OFF Timer for output #5 MSB
87 88 89 -
ECC#3 AI1 Level (0-255) from Monitor Address
ECC#3 AI2 Level (0-255) from Monitor Address
ECC#3 Discrete Input Byte from Monitor Address
26 27 28 -
OFF Timer for output #5 LSB
OFF Timer for output #6 MSB
OFF Timer for output #6 LSB
90 91 92 -
Product ID # (21=M2000, 15=S4000, 1=O300, 16=S3000)
Software Date Month (convert to Hex for display)
Software Date Year (convert to Hex for display)
29 30 31 -
OFF Timer for output #7 MSB
OFF Timer for output #7 LSB
OFF Timer for output #8 MSB
93 94 95 -
FLASH Checksum (LSB)
FLASH Checksum (MSB)
EPROM Checksum (LSB)
32 33 34 -
OFF Timer for output #8 LSB
Stop Level #1
Start Level #1
96 97 98 -
EPROM Checksum (MSB)
Software Major Version Number (Ascii)
Software Minor Version Number (Ascii)
35 36 37 -
Stop Level #2
Start Level #2
Stop Level #3
99 100 101 -
Software Build Version Number (Ascii)
Realtime Clock - Day of Week (1-7)
Realtime Clock - Month (1-12)
38 39 40 -
Start Level #3
Stop Level #4
Start Level #4
102 103 104 -
Realtime Clock - Day (1-31)
Realtime Clock - Year (0-99)
Realtime Clock - Hours (0-23)
41 42 43 -
Stop Level #5
Start Level #5
Stop Level #7
105 106 107 -
Realtime Clock - Minutes (0-59)
Realtime Clock - Seconds (0-59)
Realtime Clock - Status (1=RTU has clock module)
44
45
46
47
Start Level #7
Stop Level #8
Start Level #8
ECC#1 Pulse Input PI1 Divider
108
109
110
111
Script Status Byte (b0=First Pass bit)
Stop Level #6
Start Level #6
Stop Level #9
48 49 50 -
ECC#1 Automote Control Address
ECC#1 Automote Xmit Control (b0=xmit, b1=send all)
ECC#1 Automote Time (MSB)
112 113 114 -
Start Level #9
Stop Level #10
Start Level #10
51 52 53 -
ECC#1 Automote Time (LSB)
ECC#1 Automote Cycle Time (MSB)
ECC#1 Automote Cycle Time (LSB)
115 116 117 -
Stop Level #11
Start Level #11
Stop Level #12
54 55 56 -
ECC#1 Analog Output #1 (from CTU)
ECC#1 Address (from switches)
ECC#1 LOS Time MSB
118 119 120 -
Start Level #12
M2000 Solar Mode Byte (1=use solar sleep options)
M2000 Solar Sleep Seconds (MSB)
57 58 59 -
ECC#1 LOS Time LSB
ECC#1 Status Byte (b0=LOS,b1=Automote,b2=Override)
ECC#1 Automote control flag (1=disable)
121 122 123 -
M2000 Solar Sleep Seconds (LSB)
M2000 Solar Stay Awake Seconds (MSB)
M2000 Solar Stay Awake Seconds (LSB)
60 61 62 -
ECC#1 Discrete Output Image byte (from CTU)
ECC#1 Automote Relay Address
ECC#1 Analog Output #2 (from CTU)
124 125 126 -
RS-485 (M2-1=IO,0=Disp) (S4-0,1,2=IO,3=MB Slave,4=MB Master)
EDI and EAO Module Status Bits
COM3 bps 17=19200,18=9600,19=4800,20=2400,21=1200
63 -
ECC#2 Pulse Input PI2 Divider
127 -
COM2 Protocol (1-MC Display,2-DF1,3-MB Slave,4-MB Master)
-
-
Addr
64 -
-
-
- 39 -
Description
ECC#2 Automote Control Address