You are on page 1of 398

telemetry + control solutions

A Miri Technologies Help Manual

AD2000 Series Wireless


RTU/PLC/Data-Logger
User Manual

Miri Technologies

30 Buckingham Drive, Wangara

Western Australia, 6065

PO Box 1116, Wangara, 6947


phone • (61-8) 9409 8998
fax • (61-8) 9409 9229
email • miri@miri.com.au
website • www.miri.com.au

Part Number - UserManV300


Revision B September 2007
© 2007 Miri Technologies All rights reserved. V3.00 1-2
AD2000 User Manual - Version 3.00
This document replaces all previous publications and is for use in conjunction with the latest
MiriMap2000+ software application and the associated firmware which will be installed into any
AD2000 Series device using MiriMap2000+ Version 3.00 and later. If previous versions of
MiriMap2000+ or AD2000 devices are being used and there is no intention to upgrade them to
Version 3.00, please refer to that documentation as not all items in this document will be relevant.
This version of software and firmware was released in May 2007.

Copyright & Trademark


© Miri Technologies. All rights reserved. No part of the contents of this book may be transmitted or
reproduced in any form or by any means without the written permission of Miri Technologies.
Printed in Australia.
Ethernet is a trademark of Xerox Corporation. Windows 95, Windows 98, Windows 2000, Windows
NT, Windows XP and Vista are trademarks of Microsoft Corporations.

Contacts
Miri Technologies
30 Buckingham Drive, Wangara
Western Australia, 6065
PO Box 1116, Wangara, 6947
Phone: (61-8) 9409 8998
Fax: (61-8) 9409 9229
Email: miri@miri.com.au
Website: www.miri.com.au
Technical Support
Online: www.miri.com.au/support.htm
Email: support@miri.com.au

© 2007 Miri Technologies All rights reserved. V3.00 1-3


Revisions
Date Part No. Rev. Comments

July 2007 UserManV300RevA A Initial Document

September 2007 UserManV300RevB B Dialup, GSM and


GPRS added.

© 2007 Miri Technologies All rights reserved. V3.00 1-4


Table of Contents

CHAPTER 1 - USING THIS MANUAL.........................................................................1-1


Purpose and Audience................................................................................................................................ 1-1
Chapter Summary ....................................................................................................................................... 1-1
Additional Documentation and Information................................................................................................. 1-3
Manual Errors and Request Form............................................................................................................... 1-4

CHAPTER 2 - INTRODUCTION ..................................................................................2-1


What are AD2000 Series Devices? ............................................................................................................ 2-1
Applications using the AD2000 Series Device............................................................................................ 2-3
Basic System Components ....................................................................................................... 2-3
The Common Wireless Solutions Available Today ................................................................... 2-4
Radio Modem Based Wireless Systems ................................................................................... 2-5
Public Wireless Based Systems.............................................................................................. 2-12
Satellite Wireless solutions...................................................................................................... 2-17
Data Gathering Techniques .................................................................................................... 2-18
Remote Connectivity ................................................................................................................................. 2-19
PLC Control Functions.............................................................................................................................. 2-20
Data-logging Monitoring Functions ........................................................................................................... 2-21
Protocol Connectivity to Other Devices .................................................................................................... 2-22
I/O Expansion Modules to Expand AD2000 Series Devices .................................................................... 2-23
Wired Connectivity Options....................................................................................................................... 2-23
AD2000 Series Devices Technical Specifications .................................................................................... 2-26
AD2000 Series Product Comparison Table.............................................................................................. 2-31

CHAPTER 3 - GETTING STARTED ............................................................................3-1


Hardware and Software requirements ........................................................................................................ 3-1
Default Programming ports ....................................................................................................... 3-2
Which Port is Which? ................................................................................................................ 3-2
Mode Switch .............................................................................................................................. 3-3
System Design Concepts............................................................................................................................ 3-4
What is the intended application? ............................................................................................. 3-4
How are the AD2000 Series devices to be arranged? .............................................................. 3-4
How many AD2000 Series devices are to be used in the eventual system?............................ 3-4
What devices are the AD2000 Series devices being connected to? ........................................ 3-4
Upgrading from earlier versions.................................................................................................................. 3-4
Downgrading to previous versions.............................................................................................................. 3-5
Part Numbers .............................................................................................................................................. 3-5

CHAPTER 4 - MIRIMAP2000+ SOFTWARE...............................................................4-1


What is MiriMap2000+ ................................................................................................................................ 4-1
Installation ................................................................................................................................................... 4-2
Running the Software ................................................................................................................................. 4-9
Main Menu-Options................................................................................................................................... 4-10
File ........................................................................................................................................... 4-10
Edit .......................................................................................................................................... 4-12
Project ..................................................................................................................................... 4-16
Display..................................................................................................................................... 4-22
PLC.......................................................................................................................................... 4-26
Watcher ................................................................................................................................... 4-31
Help ......................................................................................................................................... 4-36
Toolbars................................................................................................................................... 4-38
The Project List window .......................................................................................................... 4-39
The Network Map window ....................................................................................................... 4-40

© 2007 Miri Technologies All rights reserved. V3.00 1-5


The Status bar ......................................................................................................................... 4-41
Building a System Network “Map”............................................................................................................. 4-42
Project Map Elements ............................................................................................................. 4-42
Step by Step Guide to Creating a New Project......................................................................................... 4-44
Opening a New Project File ...................................................................................................................... 4-44
Setting the Station Properties.................................................................................................. 4-46
Saving the Project Map File .................................................................................................... 4-47
Assigning Variables ................................................................................................................. 4-48
Configuring the Ports............................................................................................................... 4-51
Configuring Parcels ................................................................................................................. 4-53
Creating the Links between Stations....................................................................................... 4-56
Inserting Ladder Logic............................................................................................................. 4-57
Copying Stations ..................................................................................................................... 4-64
Station Properties - AD2000 Series Type devices.................................................................................... 4-69
General.................................................................................................................................... 4-69
Ports ........................................................................................................................................ 4-83
Parcels..................................................................................................................................... 4-88
Compile ................................................................................................................................... 4-96
Station Properties - I/O Expansion Type devices ................................................................................... 4-104
General.................................................................................................................................. 4-105
Setup Expansion ................................................................................................................... 4-106
IO Expansion Hardware DIP Switch Settings ....................................................................... 4-108
IO Expansion Wiring Details.................................................................................................. 4-109
IO Expansion Module Terminal Details and Specifications .................................................. 4-110
Station Properties - Other Protocol Type devices................................................................................... 4-114
General.................................................................................................................................. 4-114
Station Properties - SMS Type devices .................................................................................................. 4-116
General.................................................................................................................................. 4-116
AD2006 - Ethernet Port Set-up ............................................................................................................... 4-119
Device Installer Configuration Utility...................................................................................... 4-119
AD2006 XPort Ethernet Firmware Update.............................................................................................. 4-126
AD2000 - Ethernet Port Set-up ............................................................................................................... 4-131
Dialup System Set-up ............................................................................................................................. 4-132
Dialup System Configuration Arrangements ......................................................................... 4-132
AD2000 Series Device Dialup Port Configuration................................................................. 4-134
MiriMap2000+ Dialup Configuration...................................................................................... 4-136
HMI/SCADA Dialup Configuration......................................................................................... 4-136
GSM and SMS System Set-up ............................................................................................................... 4-137
Important Ladder Logic requirements for GSM Internal Modems......................................... 4-137
Typical GSM/SMS System Configurations............................................................................ 4-138
AD2000 Series GSM Port Configuration ............................................................................... 4-140
MiriMap2000+ GSM Configuration........................................................................................ 4-143
HMI/SCADA GSM Configuration........................................................................................... 4-143
Using SMS messages on GSM enabled AD2000 Series devices ........................................ 4-143
SMS Message Syntax ........................................................................................................... 4-145
GSM CMEE Errors ................................................................................................................ 4-153
GPRS System Set-up ............................................................................................................................. 4-155
Important requirements for GPRS Internal Modems............................................................. 4-155
Typical GPRS System Configurations................................................................................... 4-155
AD2000 Series GPRS Port Configuration ............................................................................. 4-157
MiriMap2000+ GPRS Configuration...................................................................................... 4-162
HMI/SCADA GPRS Configuration......................................................................................... 4-162
GPRS Diagnostics................................................................................................................. 4-162
GPRS CMEE Errors .............................................................................................................. 4-164

CHAPTER 5 - LADDER LOGIC FUNCTIONS.............................................................5-1


The PLC functions of the AD2000 Series Devices ..................................................................................... 5-1
The internal operations of the AD2000 Series PLC functions .................................................................... 5-1
I/O - (Inputs/Outputs)................................................................................................................. 5-2

© 2007 Miri Technologies All rights reserved. V3.00 1-6


Internal memory points.............................................................................................................. 5-2
Counters .................................................................................................................................... 5-2
Timers........................................................................................................................................ 5-2
Data storage .............................................................................................................................. 5-2
PLC operation............................................................................................................................ 5-2
Editing Ladder Logic programs ................................................................................................................... 5-3
Selecting Edit mode................................................................................................................... 5-4
Inserting logic items on a rung .................................................................................................. 5-4
How to edit the element of choice ............................................................................................. 5-6
Inserting logic elements............................................................................................................. 5-6
Deleting logic elements ............................................................................................................. 5-7
Deleting logic rungs ................................................................................................................... 5-7
Inserting logic connect lines ...................................................................................................... 5-8
Deleting logic connect lines....................................................................................................... 5-9
Copying and pasting rungs and logic sections.......................................................................... 5-9
Undo facility for copying and pasting rungs and logic sections............................................... 5-10
Finding a specific variable ....................................................................................................... 5-10
Find & replace a specific variable............................................................................................ 5-11
Go To a specific rung number or label .................................................................................... 5-11
Adding Example Ladder Logic Rungs ..................................................................................... 5-11
Boolean Logic ........................................................................................................................................... 5-13
Normally Open Contact ........................................................................................................... 5-13
Normally Closed Contact......................................................................................................... 5-13
Positive Transition Contact...................................................................................................... 5-13
Negative Transition Contact .................................................................................................... 5-14
Any Transition Contact ............................................................................................................ 5-14
Output Coil............................................................................................................................... 5-14
Not Output Coil ........................................................................................................................ 5-14
Set Output Coil ........................................................................................................................ 5-14
Reset Output Coil .................................................................................................................... 5-14
Timers and Counters Function Block Descriptions................................................................................... 5-15
Counter Up (CTU) ................................................................................................................... 5-15
Counter Down (CTD)............................................................................................................... 5-16
Counter Up Down (CTUD) ...................................................................................................... 5-18
Timer Pulse (TP) ..................................................................................................................... 5-20
Timer On-Delay (TON) ............................................................................................................ 5-22
Timer Off-Delay (TOFF) .......................................................................................................... 5-23
Timer Accumulating (TACC) ................................................................................................... 5-25
Data Manipulation Function Block Descriptions ....................................................................................... 5-27
Absolute................................................................................................................................... 5-27
Greater Than (GT)................................................................................................................... 5-28
Less Than (LT) ........................................................................................................................ 5-30
Equal To (EQ).......................................................................................................................... 5-31
Maximum ................................................................................................................................. 5-33
Minimum .................................................................................................................................. 5-34
Modulus ................................................................................................................................... 5-35
Bit Shift Left (SHL)................................................................................................................... 5-37
Bit Shift Right (SHR)................................................................................................................ 5-39
Rotate Left (ROTL) .................................................................................................................. 5-41
Rotate Right (ROTR) ............................................................................................................... 5-43
Decrement ............................................................................................................................... 5-45
Increment................................................................................................................................. 5-47
Move........................................................................................................................................ 5-48
Move Not ................................................................................................................................. 5-50
Convert .................................................................................................................................... 5-52
AND Word ............................................................................................................................... 5-55
OR Word.................................................................................................................................. 5-57
XOR Word ............................................................................................................................... 5-59
Arithmetic & Mathematic Function Block Descriptions ............................................................................. 5-61
Add (ADD) ............................................................................................................................... 5-61

© 2007 Miri Technologies All rights reserved. V3.00 1-7


Subtract (SUB) ........................................................................................................................ 5-62
Multiply (MUL) ......................................................................................................................... 5-64
Divide (DIV) ............................................................................................................................. 5-65
Cosine (COS) .......................................................................................................................... 5-67
Sine (SIN) ................................................................................................................................ 5-68
Tangent (TAN)......................................................................................................................... 5-69
ArcCosine (ARCCOS) ............................................................................................................. 5-71
ArcSine (ARCSIN) ................................................................................................................... 5-72
ArcTangent (ARCTAN)............................................................................................................ 5-74
Log Natural (LOG_LN) ............................................................................................................ 5-75
Exponential (EXPONENTIAL) ................................................................................................. 5-76
Log Base10 (LOG_10).............................................................................................................. 5-78
Square Root (SQRT) ............................................................................................................... 5-79
Power (POWER) ..................................................................................................................... 5-80
Degree To Radian (DEGCON)................................................................................................ 5-82
Radian To Degree (RADCON) ................................................................................................ 5-83
Special Function Block Descriptions......................................................................................................... 5-85
Change Detect (CHD) ............................................................................................................. 5-85
High Speed Counter for DIN1 and DIN2 ................................................................................. 5-87
High Speed Rate Calculation for DIN1 and DIN2 ................................................................... 5-89
Log Data Variable (LOG)......................................................................................................... 5-91
Moving Average (MAVG) ........................................................................................................ 5-93
Parcel ...................................................................................................................................... 5-94
RTC Time ................................................................................................................................ 5-97
RTC Date................................................................................................................................. 5-99
Rate Calculation (RATE) ....................................................................................................... 5-101
Scale...................................................................................................................................... 5-103
Shaft Encoder Interface (SHAFT) ......................................................................................... 5-105
Sub-Routine........................................................................................................................... 5-107
Printing Ladder Logics ............................................................................................................................ 5-108
Ladder Logic Cross-Reference List ........................................................................................................ 5-108

CHAPTER 6 - DATA-LOGGING FUNCTIONS............................................................6-1


The Data Logger functions of the AD2000 products................................................................................... 6-1
The difference between “data-log” and “real-time” variables .................................................... 6-1
Setting up the Data Logger Interface ........................................................................................ 6-3
Displaying the data-log data...................................................................................................... 6-5

CHAPTER 7 - PROTOCOLS .......................................................................................7-1


DF1 ............................................................................................................................................................. 7-2
Modes Supported ...................................................................................................................... 7-2
Memory Data Types Supported ................................................................................................ 7-2
Master Mode Configuration ....................................................................................................... 7-2
Slave Mode Configuration ......................................................................................................... 7-9
PLC Programming Software set up......................................................................................... 7-11
HMI Setup................................................................................................................................ 7-11
Modbus ..................................................................................................................................................... 7-12
Modes Supported .................................................................................................................... 7-12
Memory Data Types Supported .............................................................................................. 7-12
Master Mode Configuration ..................................................................................................... 7-13
Slave Mode Configuration ....................................................................................................... 7-19
Modbus TCP/IP ....................................................................................................................... 7-21
PLC Programming Software set up......................................................................................... 7-23
Citect HMI Setup ..................................................................................................................... 7-23

CHAPTER 8 - DIAGNOSTIC VARIABLES..................................................................8-1

© 2007 Miri Technologies All rights reserved. V3.00 1-8


Radio Diagnostic Data ................................................................................................................................ 8-1
RD - 1 Temperature (%MW65160) .......................................................................................... 8-1
RD - 2 RSSI i.e. Radio Received Signal Strength (%MW65161) ............................................. 8-1
RD - 3 Tx Power i.e. Transmit Power (%MW65162)................................................................. 8-1
PLC Diagnostic Data................................................................................................................................... 8-3
PLC System Coils...................................................................................................................... 8-3
Time........................................................................................................................................... 8-5
General Diagnostics .................................................................................................................. 8-5
Data-log Diagnostics ................................................................................................................. 8-6
Port Diagnostic Data ................................................................................................................................... 8-6
Protocol error number per port .................................................................................................. 8-6
Modem Status per port.............................................................................................................. 8-6
Bad Packets per port................................................................................................................. 8-7
Current station ID polled per port .............................................................................................. 8-7
Received station ID polled per port ........................................................................................... 8-7
Retry count per port................................................................................................................... 8-8
Link Fail count per port.............................................................................................................. 8-8
Message Received count per port............................................................................................. 8-8
PCMCIA Diagnostics (PCMCIA port only) ................................................................................ 8-8
Broadcast Diagnostics............................................................................................................... 8-9
Miri2000 Error Codes ................................................................................................................................ 8-10
Code 1000 - Invalid Message.................................................................................................. 8-10
Code 1001 - Bad Command.................................................................................................... 8-10
Modbus Error Codes ................................................................................................................................. 8-10
Code 01 - Illegal Function ....................................................................................................... 8-10
Code 02 - Illegal Data Address ............................................................................................... 8-10
Code 03 - Illegal Data Value ................................................................................................... 8-10
Code 04 - Slave Device Failure............................................................................................... 8-10
Code 05 - Acknowledge .......................................................................................................... 8-10
Code 06 - Slave Device Busy.................................................................................................. 8-10
Code 07 - Negative Acknowledge ........................................................................................... 8-10
Code 08 - Memory Parity Error ............................................................................................... 8-10
Code 1000 - Invalid Message.................................................................................................. 8-10
Code 1001 - Bad Command.................................................................................................... 8-11
Allen Bradley DF1 Error Codes................................................................................................................. 8-11
Code 00h - OK......................................................................................................................... 8-11
Code 01h - Out of buffer space ............................................................................................... 8-11
Code 02h - Delivery problem................................................................................................... 8-11
Code 03h - Duplicate token..................................................................................................... 8-11
Code 04h - Local port is disconnected .................................................................................... 8-11
Code 05h - Application layer timed out ................................................................................... 8-11
Code 06h - Duplicate node...................................................................................................... 8-11
Code 07h - Station is offline .................................................................................................... 8-11
Code 08h - Hardware fault ...................................................................................................... 8-11
Code 10h - Illegal command or format .................................................................................... 8-11
Code 20h - Host has a problem and will not communicate..................................................... 8-12
Code 30h - Remote node host is missing, disconnected, or shut down ................................. 8-12
Code 40h - Host could not complete function due to hardware fault ...................................... 8-12
Code 50h - Addressing problem or memory protect rungs ..................................................... 8-12
Code 60h - Function not allowed due to command protection selection ................................ 8-12
Code 70h - Processor is in Program mode ............................................................................. 8-12
Code 80h - Compatibility mode file missing or communication zone problem........................ 8-12
Code 90h - Remote node cannot buffer command ................................................................. 8-12
Code A0h - Wait ACK (1775_KA buffer full) ........................................................................... 8-12
Code B0h - Remote node problem due to download .............................................................. 8-12
Code C0h - Wait ACK (1775_KA buffer full) ........................................................................... 8-12
Code D0h - Not used............................................................................................................... 8-12
Code E0h - Not used............................................................................................................... 8-12
Code F0h - Error code in the EXT STS byte........................................................................... 8-12
Code 100h - Invalid File .......................................................................................................... 8-12

© 2007 Miri Technologies All rights reserved. V3.00 1-9


Code 101h - Invalid Function .................................................................................................. 8-13
Code 1000 - Invalid Message.................................................................................................. 8-13
Code 1001 - Bad Command.................................................................................................... 8-13

CHAPTER 9 - CABLES, CONNECTIONS AND PIN-OUTS........................................9-1


RS232 Standard Pin Connections .............................................................................................................. 9-1
25 Pin Assignments................................................................................................................... 9-1
9 Pin Assignments..................................................................................................................... 9-2
AD2000 RJ45 Pin Assignments ................................................................................................ 9-2
RS232 Converter Pin Connections ............................................................................................................. 9-3
RS232 25 Pin to 9 Pin converter Pin Assignments ................................................................... 9-3
9 Pin to AD2000 RS232 Converter - Pin Details....................................................................... 9-3
25 Pin to AD2000 RS232 Converter - Pin Details..................................................................... 9-4
Device Cable Details................................................................................................................................... 9-5
AD2000 to PC for Programming software and HMI/DCS cable - RS232.................................. 9-5
AD2000 to AD2000 Extension cable - RS232........................................................................... 9-5
AD2000 to GE Fanuc 90 Series CMM Module - RS232 ........................................................... 9-6
AD2000 to ADAM 4520 RS485/422 Converter ......................................................................... 9-6
AD2000 to Allen Bradley SLC500 PLC RS232 Port ................................................................. 9-7
AD2000 to UDS-10, 100 or 1100 Ethernet to Serial Converter ................................................ 9-7
AD2000 to Greenspan Smart Sensor RS232 ........................................................................... 9-8
Ethernet 10BaseT cables .......................................................................................................... 9-8

CHAPTER 10 - GLOSSARY......................................................................................10-1
Bits, Bytes and Words, Long, Real ........................................................................................................... 10-1
Data acquisition......................................................................................................................................... 10-2
HMIs/MMIs/DCSs & PLCs ........................................................................................................................ 10-2
I/O.............................................................................................................................................................. 10-2
Ladder Logic ............................................................................................................................................. 10-2
Leased Lines & Landlines......................................................................................................................... 10-2
Master ....................................................................................................................................................... 10-3
Master/Slave (Polled) Systems................................................................................................................. 10-3
Narrow-Band Wireless .............................................................................................................................. 10-3
OPC .......................................................................................................................................................... 10-4
Point to Point Systems .............................................................................................................................. 10-5
Point to Multi Point Systems ..................................................................................................................... 10-5
Point Mapping ........................................................................................................................................... 10-5
Protocols ................................................................................................................................................... 10-5
PSTN Modems.......................................................................................................................................... 10-5
Report By Exception (RBE) ...................................................................................................................... 10-5
RS232/422 & 485...................................................................................................................................... 10-6
RTU........................................................................................................................................................... 10-7
SCADA...................................................................................................................................................... 10-7
Spread Spectrum Wireless ....................................................................................................................... 10-7
Store & Forward ........................................................................................................................................ 10-8
Telemetry .................................................................................................................................................. 10-8

© 2007 Miri Technologies All rights reserved. V3.00 1-10


Figures
Figure 1 - Typical Arrangement of AD2000 Series Devices............................................ 2-2
Figure 2 - Typical System Layout...................................................................................... 2-4
Figure 3 - How Far Will Radio Go? .................................................................................... 2-5
Figure 4 - Master/Slave Point to Point System Arrangement......................................... 2-7
Figure 5 - Example of External Radio Connectivity......................................................... 2-7
Figure 6 - Master/Slave Point to Multi-Point System Arrangement ............................... 2-8
Figure 7 - Store and Forward System Arrangement ....................................................... 2-8
Figure 8 - Multi-hop Store and Forward System Arrangement ..................................... 2-9
Figure 9 - Repeater Based Radio System Arrangement ............................................... 2-10
Figure 10 - Sub-Master Based System Arrangement .................................................... 2-11
Figure 11 - GSM Based System - Typical Layout .......................................................... 2-13
Figure 12 - GPRS Based System - Typical Layout - No Carrier Hub ........................... 2-15
Figure 13 - GPRS Based System - Typical Layout - Via Carrier Hub........................... 2-15
Figure 14 - Satellite Based System - Typical Layout using Iridium Network.............. 2-17
Figure 15 - Data-log Scheduler System Arrangement .................................................. 2-19
Figure 16 - Remote Connectivity Example Diagram...................................................... 2-20
Figure 17 - Example Ladder Logic screen from MiriMap2000+.................................... 2-21
Figure 18 - Example of Data-logging Screen in MiriMap2000+ Software .................... 2-22
Figure 19 - Example of I/O Expansion Modules............................................................. 2-23
Figure 20 - Wired Connection Options ........................................................................... 2-23
Figure 21 - Ethernet Networked AD2006s Using Modbus/TCP .................................... 2-24
Figure 22 - Ethernet Networked AD2006s Using Miri2000 and UDP PTMP System... 2-25
Figure 23 - Example of USB2.0 Type A to B Cable Connectors..................................... 3-1
Figure 24 - Programming Ports ......................................................................................... 3-2
Figure 25 - AD2000 Port Numbering ................................................................................. 3-2
Figure 26 - AD2006 Port Numbering ................................................................................. 3-2
Figure 27 - Run/Program Mode Switch............................................................................. 3-3
Figure 28 - AD2000 Series Part Numbers ......................................................................... 3-5
Figure 29 - Full screen view of MiriMap2000+................................................................ 4-10
Figure 30 - Example of Floating Toolbar ........................................................................ 4-38
Figure 31 - Example of Docked Toolbar ......................................................................... 4-39
Figure 32 - AD2000 Series Variable Memory Map.......................................................... 4-71
Figure 33 - IO Expansion Hardware DIP Switch Settings ........................................... 4-108
Figure 34 - IO Expansion Wiring Details....................................................................... 4-109
Figure 35 - M16-LN 16 Point Low Voltage Digital Input Module - General Arrangement
.......................................................................................................................................... 4-110
Figure 36 - M16-LN 16 Point Low Voltage Digital Input Module - Wiring Schematic4-110
Figure 37 - M16-HN 16 Point High Voltage Digital Input Module - General Arrangement
.......................................................................................................................................... 4-111
Figure 38 - M16-HN 16 Point High Voltage Digital Input Module - Wiring Schematic .... 4-
111
Figure 39 - M16-TR 16 Point Relay Output Module - General Arrangement ............. 4-112
Figure 40 - M16-TR 16 Point Relay Output Module - Wiring Schematic .................... 4-112
Figure 41 - M8-AD 8 Channel Analogue Input Module - General Arrangement........ 4-113
Figure 42 - M8-AD 8 Channel Analogue Input Module - Wiring Schematic .............. 4-113
Figure 43 - Dialup System Arrangement - AD2000 Series Device to Device ............ 4-132
Figure 44 - Dialup System Arrangement - MiriMap2000+ to AD2000 Series Device 4-133
Figure 45 - Dialup System Arrangement - HMI to AD2000 Series Device ................. 4-133
Figure 46 - GSM System Arrangement - AD2000 Series Device to Device ............... 4-138
Figure 47 - GSM System Arrangement - MiriMap2000+ to AD2000 Series Device... 4-139
Figure 48 - GSM System Arrangement - HMI to AD2000 Series Device .................... 4-139
Figure 49 - Typical SMS System Arrangement ............................................................ 4-144
Figure 50 - GPRS System Arrangement - AD2000 Series Device to Device ............. 4-156
Figure 51 - GPRS System Arrangement - MiriMap2000+ to AD2000 Series Device. 4-156
Figure 52 - GPRS System Arrangement - HMI to AD2000 Series Device .................. 4-157
Figure 53 - Real-time data collection example................................................................. 6-1
Figure 54 - External time stamp data collection example............................................... 6-2

© 2007 Miri Technologies All rights reserved. V3.00 1-11


Tables
Table 1 - Errors and Request Form - September 07 ........................................................ 1-4
Table 2 - Logic Functions................................................................................................. 2-26
Table 3 - Physical Dimensions ........................................................................................ 2-26
Table 4 - Environmental Specifications.......................................................................... 2-26
Table 5 - Power Interface Specifications ........................................................................ 2-26
Table 6 - Supported Protocols......................................................................................... 2-26
Table 7 - AD2000 Communications Port Specifications ............................................... 2-27
Table 8 - AD2006 Communications Port Specifications ............................................... 2-27
Table 9 - I/O Specifications .............................................................................................. 2-27
Table 10 - Memory Specifications ................................................................................... 2-27
Table 11 - AD2000 Series Temperature Specifications................................................. 2-28
Table 12 - AD200xS Spread Spectrum Wireless Module Specifications..................... 2-28
Table 13 - AD200xR Narrow Band VHF Radio Module Specifications......................... 2-29
Table 14 - AD200xR Narrow Band UHF Radio Module Specifications ........................ 2-30
Table 15 - AD200xG GSM/GPRS Modem Module Specifications ................................. 2-30
Table 16 - Product Comparison Table ............................................................................ 2-31
Table 17 - Link Healthy and Poll Select Block Numbers............................................... 4-34
Table 18 - AD2000 Series Device Physical I/O Memory Allocations............................ 4-71
Table 19 - AD2000 Series Device I/O Expansion Memory Allocations ........................ 4-71
Table 20 - AD2000 Series Device Diagnostic Variables Memory Allocations............. 4-73
Table 21 - Radio Power Settings ................................................................................... 4-103
Table 22 - M16-LN 16 Point Low Voltage Digital Input Module - Specifications....... 4-110
Table 23 - M16-HN High Voltage Digital Input Module - Specifications..................... 4-111
Table 24 - M16-TR 16 Point Relay Output Module - Specifications ........................... 4-112
Table 25 - M8-AD 8 Channel Analogue Input Module - Specifications ...................... 4-113
Table 26 - Number Format Ranges ................................................................................. 10-1

© 2007 Miri Technologies All rights reserved. V3.00 1-12


Chapter 1 - Using This Manual

Chapter 1 - Using This Manual


This chapter provides basic document details so the reader can access the required details.

Purpose and Audience


This manual provides the information needed to configure, use and update the AD2000 Series
products. It is those responsible for evaluating, designing, installing and maintaining systems using
the AD2000 Series products.

Chapter Summary
The remaining chapters in this manual include:

Chapter 2 - Introduction Provides an overview of the main features of the


AD2000 Series products.

Chapter 3 - Getting Started Provides some pointers to system design and


configuration to ensure the correct AD2000 Series
product and system arrangement is used.

Chapter 4 - MiriMap2000+ Provides detailed information on the MiriM2000+


Software software application package which must be used
to enable the various features of the AD2000
Series hardware.

Chapter 5 - Ladder Logic Provides detailed information of the various


Functions function blocks available for use within the Ladder
Logic utility which is included in every AD2000
Series device.

Chapter 6 - Data-logging Provides detailed information of the various data-


Functions logging functions available for use within the Data-
Logger capability which is included in every
AD2000 Series device.

Chapter 7 - Protocols Provides detailed information about the associated


protocols used to connect devices to the AD2000
Series devices.

Chapter 8 - Diagnostic Provides detailed information about the associated


Variables diagnostic variables used with the protocols to
connect devices to the AD2000 Series devices.

Chapter 9 - Cables, Provides useful details on associated cables used


connections and pin-outs to inter-connect the most common devices to the
AD2000 Series devices.

Chapter 10 - Glossary A glossary of useful terms used in the manual.

Although every effort has been made to ensure informational accuracy, the contents of this
publication are presented for informational purposes only. They are not to be construed as
warranties or guarantees, expressed or implied, regarding the products or services described
herein or their use or applicability.
The manufacturer reserves the right to modify, improve or delete the designs or specifications of
these products at any time without notice.

© 2007 Miri Technologies All rights reserved. V3.00 1-1


Chapter 1 - Using This Manual

This document was last printed on Wednesday, 26 September 2007 and there are a total of 398
pages in the document.

© 2007 Miri Technologies All rights reserved. V3.00 1-2


Chapter 1 - Using This Manual

Additional Documentation and Information


The following information is available for use:

AD2000 Series A range of training courses, manuals and guides are


Training Courses available to enhance the information contained in this user
manual - consult miri@miri.com.au for further details and
course details.

AD2000 Product The AD2000 Series product brochure is available for


Datasheet download at the Miri website at AD2000 Series Datasheet.

Website The Miri Technologies website at www.miri.com.au is kept


up to date with current documentation and product
information.

Technical Support Technical support information is available at


www.miri.com.au or via email at support@miri.com.au.

© 2007 Miri Technologies All rights reserved. V3.00 1-3


Chapter 1 - Using This Manual

Manual Errors and Request Form


Should there be any errors or omissions noticed during the use of this manual or sections that
require further enhancement or explanation, please complete the table below and fax to Miri
Technologies on 61-(0)-89-409-9229 or email details to Technical support on
support@miri.com.au.
Table 1 - Errors and Request Form - September 07
Chapter Number Page Number Describe The Error or Content Change/Addition Required

© 2007 Miri Technologies All rights reserved. V3.00 1-4


Chapter 2 - Introduction

Chapter 2 - Introduction
The AD2000 Series products are devices that allow you to enable wireless and wired connections
for remote monitoring and control applications. This introduction allows the user to understand
some of the features of the AD2000 Series products and how they can be used. It is only an
introduction, useful for new-comers to the product and systems. Details on how to use these
features are contained in the following chapters.

As a minimum requirement read this chapter to understand the basics of systems using the
AD2000 Series devices then go to the section which gives a step by step guide to configuring an
AD2000 Series based system. This will enable a quick start and leave reference to the details for
further study.

What are AD2000 Series Devices?


The AD2000 Series are integrated wireless RTU/PLC/Data-Logger devices used for remote
monitoring and control and thus suitable for use in Supervisory Control And Data Acquisition
(SCADA) systems. The module options that are available are designed to suit low to medium I/O
applications where secure, efficient and affordable wireless communication links are required to get
data back to central monitoring locations.
The AD2000 Series device options offer:
‰ In-built RTU functions for data transfer by polled, event or timed methods.
‰ In-built PLC software functions for local control and monitoring of the remote process.
‰ In-built data-logging of numerical data or text.
‰ In-built analogue and digital I/O
‰ Extension analogue and digital I/O modules for local or remote I/O additions.
‰ Wireless communications modules for:
‰ 1-5W UHF internal radio (and up to 25W external).
‰ 1-2W VHF internal radios (and up to 25W external).
‰ 2.4GHz and 900MHz licence free, Spread Spectrum internal radios, 9600-115kbps.
‰ Internal GSM modems.
‰ Internal GPRS modems.
‰ External Iridium enabled Satellite systems.
‰ External 19200/9600bps, 395-520MHz data radios with diagnostics.
‰ External PSTN/Leased line modems.
‰ Additional Serial Communications modules, including in-built PCMCIA PC Type II card
(AD2000) or on-board Ethernet module (AD2006) for Ethernet connectivity.
The AD2000 Series hardware is configured using the MiriMap2000+ configuration software
package.
The AD2000 Series devices have multiple protocol options for interface to popular HMI/DCS and
PLC based systems, e.g. Modbus, DF1, OPC. These options allow the integration of the AD2000
Series devices into existing systems and to a variety of software platforms available worldwide.
To illustrate the typical general arrangement of the AD2000 Series devices see the diagram in the
following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 2-1


Chapter 2 - Introduction

Figure 1 - Typical Arrangement of AD2000 Series Devices

© 2007 Miri Technologies All rights reserved. V3.00 2-2


Chapter 2 - Introduction

Applications using the AD2000 Series Device


The AD2000 Series products are designed for use in remote monitoring and control systems. Such
systems can involve distances of a few hundred metres in a factory area, industrial plant or building
to several hundred kilometers across a wide area. The applications are extensive and some that
the devices used have been applied to are listed below:
‰ Utility water supply systems (e.g. river, dams, pipelines, pressure, flow and level
monitoring, pump control).
‰ Underground water bore systems (e.g. pump start/stop control, fault monitoring, flow,
pressure and level measurement, diesel generator monitoring and control).
‰ Pipeline leak detection systems.
‰ Electricity pole top circuit breaker and re-closer monitoring and control.
‰ Mobile plant equipment monitoring and control (e.g. ore stacker/re-claimers, cranes,
grain silo trippers).
‰ Environmental monitoring (e.g. river flow and level, water quality measurement)
‰ Flood warning/control systems.
‰ Weather monitoring systems.
‰ Oil-field on-shore well level measurement.

Basic System Components


There are several basic system layouts that can be formed with the AD2000 Series devices with
many possible variations varying according to the wireless network interface that is chosen. Some
illustrations of typical system layouts are illustrated in this manual, however, these are to be
considered only as basic component configurations and several variations on these are possible.
Comprehensive analysis of any proposed system design requirements are available from Miri
Technologies.
The basic system components are:
‰ Field I/O Interface - Typically, the data is gathered from field instruments (e.g. level,
pressure, flow, position) via transducers and input into the I/O channels on the AD2000
Series unit. These signals can be digital (on/off, open/close etc.) or via analogue transducers
(e.g. 4-20mA, 1-5V). See the technical specifications section for exact details of the I/O
channels supported.
‰ Local Process Control and Monitoring - This is also possible in all the system
arrangements discussed as the features are available in all AD2000 series devices. Digital
commands (e.g. open/close, start/stop etc.), conditional logic, timer and counters and
numerous mathematical functions for analogue control (e.g. valve position, motor speed etc.)
can be processed. This is processed locally via local logic (termed PLC Logic), using the
Ladder logic language format.
‰ Data-logging - In many SCADA systems there is a requirement to store the exact time an
event condition occurred or to periodically store timer, counter and other variable values (e.g.
flow totals, run times). The in-built data-logging allows this with extensive scheduled data
retrieval utilities available to access the data. A combination of both PLC logic and data-
logging is also possible.
‰ Data sharing with other devices - Connections to serial devices (e.g. PLCs, power
monitoring instruments and other intelligent electronic devices, IEDs) are also supported
where the AD2000 Series devices share a common hardware interface standard (e.g.
RS232, RS285 and Ethernet) and a common communications protocol (e.g. Modbus, DF1).

© 2007 Miri Technologies All rights reserved. V3.00 2-3


Chapter 2 - Introduction

‰ Data Transfer - The data is transferred via a suitable wireless or wired link to transport it to
another location, typically several kilometres away. The distinguishing factor that stands the
AD2000 Series devices apart from stand-alone PLC systems is that they are designed to
transport data efficiently and quickly via several wireless means, with no additional product
required.

Figure 2 - Typical System Layout


This total solution is available with a combination of the AD2000 Series hardware and the
MiriMap2000+ software with full support from the one source.

The Common Wireless Solutions Available Today


There are several “wireless” solutions available today and no doubt many more will appear in the
coming years with the growing momentum towards “3G” wireless solutions. This document
concentrates on the products and systems available today, since there is much “hype” in the media
and many wireless systems we read about do not exist yet. The availability of various wireless
systems also varies across countries depending on the level of telecommunications infrastructure
available. For example, a wireless solution aimed at the Japan and Singapore markets may not be
suited to a solution in Vietnam, Thailand or India. The type of wireless solution to use is also
subject to the distance required to transmit data across and the number of times that this data is to
be sent (or read). Any wireless based product is also subject to local telecommunication authority
regulation and approvals and thus using solutions that have current approval in the country of use
must be considered.
The AD2000 Series of products provide wireless solutions to those systems most commonly
available today, these being:
‰ VHF “Narrow Band” Radio 132-174MHz (typical transmission distances up to 60km)
‰ UHF “Narrow Band” Radio 400Mhz-943Mhz (typical transmission distances up to 30km)
‰ Spread spectrum 900MHz (restricted nations allow this) and 2.4GHz (low power international
ISM band coverage used best used for transmission distances up to 1km)
‰ GSM including SMS transmission (global where network is supported)
‰ GPRS (TCP/IP based with mostly national coverage where network is supported)
‰ Satellite using the Iridium Short Burst Data system (global)

How Far Will Wireless Go?

This is an often asked question and one that can only be described with accuracy when the actual
geographical conditions are considered.

© 2007 Miri Technologies All rights reserved. V3.00 2-4


Chapter 2 - Introduction

Figure 3 - How Far Will Radio Go?


If you use the rule of “line of sight”, meaning if there are no obstructions between the two locations
then the graphic below illustrates the difference between the different types of wireless solution.
The typical maximum range for VHF narrow-band radios without repeaters is 60km, for UHF 30km
and for the two variants of spread spectrum, 1-4km (longer distances can be achieved with spread
spectrum with ideal topographical conditions and with high gain antennae and high masts).
As described already the GSM/GPRS wireless solutions are country wide depending on the
coverage of the respective networks in the country of installation. Satellite is the only truly global
(with the exceptions of North Korea, Poland and Sri Lanka) coverage system that uses the same
network.
Note should be taken to understand that in the spread spectrum area, 900MHz systems will have
longer transmit distances (up to tens of kilometres) possible compared to 2.4GHz systems (only a
few kilometres) and that this difference due to frequency band must be considered when
comparing systems. The choice of antennae also has significant influence on the transmit distance
but some country authorities restrict the use of high gain antenna at these “open” frequencies.

Radio Modem Based Wireless Systems


The most common wireless system using the AD2000 Series devices use internal or external radio
modems. These can be UHF or VHF radios (termed “Narrow Band”) and there are also 900MHz or
2.4Ghz spread spectrum (termed “Broad Band”) options available. The physical interface is either
FFSK (internal to the AD2000 Series device on Port 1), or RS232.

VHF or UHF Radio - Narrow Band

‰ The AD2000 Series units can have an internal narrow band UHF or VHF radio module
installed. Specifications are found at Table 13 - AD200xR Narrow Band VHF Radio
Module Specifications and Table 14 - AD200xR Narrow Band UHF Radio Module
Specifications. The part numbers for such options are of the format AD200xR-xx-xx.
Advantages of “Narrow Band” Wireless solutions

‰ Offers communications to remote locations (i.e. where there is little or no GSM/GPRS/CDMA


or landline telephone based communications coverage).
‰ Offers greater range with up to 30km for UHF and 60km for VHF with greater range when
repeaters are used (hundreds of kilometres have been achieved in some applications).
‰ Offers a “protected” frequency band that the user is legally entitled to use and is protected
from interference (essential for control based systems or critical monitoring systems). The
protection is being offered by the granting of a license from the appropriate country
government telecommunications regulatory authority.

© 2007 Miri Technologies All rights reserved. V3.00 2-5


Chapter 2 - Introduction

‰ Offers an equivalent GSM/GPRS//CDMA (as well as land-line) alternative and is cheaper in


terms of annual operating costs and hardware (i.e. no call connect costs or charges per
megabyte for data). Essentially, once installed this narrow band wireless solution is “free” to
run.
‰ Can be connected more quickly than GSM/GPRS/CDMA, requiring in most cases minimal
installation (i.e. you do not have to wait for telecommunications carrier action or contracts to
be enabled).
‰ Offers greater portability and mobility where the user can move terminals around his plant.
‰ Radio capital cost is equivalent to or cheaper than GSM/GPRS/CDMA in hardware capital
costs.
‰ The user owns the data transport equipment and pays only for radio licensing.
‰ The user is in control of the communications medium and its availability (i.e. you do not have
to rely on the telecom company which is important for control based systems). System
shutdowns are in the user’s control not the carrier’s and thus can be planned into
maintenance schedules.
Disadvantages of “Narrow Band” Wireless solutions

‰ The user must fund the infrastructure costs of putting up masts and installing antennae.
‰ Requires technical competence in radio based systems to ensure correct design.
‰ Lower over the air data rates compared to some spread spectrum systems.

Spread Spectrum Radio - Broad Band

‰ The AD2000 Series units can have an internal 900MHz or 2.4GHz Spread Spectrum module
installed. Specifications are found at Table 12 - AD200xS Spread Spectrum Wireless Module
Specifications. The part numbers for such options are of the format AD200xS-xx-xx.
Advantages of “Broad Band Spread Spectrum” Wireless solutions

‰ License free so low cost to install and quick to install.


‰ Higher over the air data rates (up to 19200 bps) compared to the narrow band systems.
‰ “Worldwide” acceptance as wireless solution so can be installed in most countries.
‰ Offers communications to remote locations (i.e. where there is little or no GSM/GPRS/CDMA
or landline telephone based communications coverage).
‰ Offers an equivalent GSM/GPRS/CDMA (as well as land-line) alternative and is cheaper in
terms of annual operating costs and hardware (i.e. no call connect costs or charges per
megabyte for data). Essentially, once installed this spread spectrum wireless solution is
“free” to run.
‰ Can be connected more quickly than GSM/GPRS/CDMA, requiring in most cases minimal
installation (i.e. you do not have to wait for telecommunications carrier action or contracts to
be enabled).
‰ Offers greater portability and mobility where the user can move terminals around his plant.
‰ Radio capital cost is equivalent to or cheaper than GSM/GPRS/CDMA in hardware capital
costs.
‰ The user owns the data transport equipment.
Disadvantages of “Broad Band Spread Spectrum” Wireless solutions

‰ In high noise areas (e.g. cities and suburban/commercial areas) interference/sharing the
same broad frequency band can mean that the data throughput is severely limited or even
stopped.

© 2007 Miri Technologies All rights reserved. V3.00 2-6


Chapter 2 - Introduction

‰ Transmission distances are only short (typically less than 1km unless “line of sight” is
available in non-urban environments).
‰ The user must fund the infrastructure costs of putting up masts and installing antennae.
‰ Requires technical competence in radio based systems to ensure correct design.
Typical radio modem based system layouts are described in the following sections.

Point to Point System layout

This is the basic system layout as illustrated below:

Figure 4 - Master/Slave Point to Point System Arrangement


Two remote sites are connected by internal or external radios and the data is transmitted across
one data link. Data can be transmitted continuously or periodically with events.

Figure 5 - Example of External Radio Connectivity

Point to Multi-Point System layout

A more complicated system layout is illustrated below:

© 2007 Miri Technologies All rights reserved. V3.00 2-7


Chapter 2 - Introduction

Figure 6 - Master/Slave Point to Multi-Point System Arrangement


Several remote sites are connected by internal or external radios and the data is transmitted across
the data link to one central location. That central location can be a PLC or DCS control system or
an HMI or SCADA software package. Data can be transmitted continuously or periodically with
events.

Store and Forward System layout

In radio based systems in some cases there cannot be direct links between all remote sites. This
may be due to a building or hill interrupting the radio path to such an extent that the signal received
is too weak for reliable operation. In many cases alternate paths do have good signal strength and
these can be used to route the data signals via other remotes in the system. This is known as
“store and Forward”. This is illustrated below:

Figure 7 - Store and Forward System Arrangement


This technique can also be used in situations where the distance between remotes is long, as in
pipelines. This system layout is available for VHF/UHF radio and Spread Spectrum configured
AD2000 Series devices. It is not required for GSM/GPRS systems.

© 2007 Miri Technologies All rights reserved. V3.00 2-8


Chapter 2 - Introduction

This technique is useful when multiple links are required, one after the other in the same direction,
e.g. a pipeline. It does not suit arrangements where the data update times are critical as there is a
delay induced at each intermediate station as it re-transmits the data. This delay must be
accounted for at the transmitting end by lengthening the reply timeout to account for the longer
response from the remotes due to the re-transmitting. The store and forward process is carried out
at the radio level, no data variable values are written to the memory of the intermediate AD2000
Series devices. Polling of the intermediate data variables is still possible and can be identified in
the MiriMap2000+ software by turning on the display of parcels in the Display - Links main menu
option. The following diagram illustrates a Multi-hop Store and Forward system arrangement.

Figure 8 - Multi-hop Store and Forward System Arrangement


Whilst, in theory, this technique can result in a system with many linked hops, if the layout becomes
too complex, a more suitable system would be to include a repeater in the system if the topography
suits.
It should also be noted that Store and Forward systems suit simplex frequencies (same transmit
and receive frequency). If duplex frequencies are used (different transmit and receive frequency),
each hop must have an opposite transmit and receive frequency to the preceding and subsequent
device along the line.

Repeater Based System

In many radio based systems, wide area coverage is required to all remotes. The store and forward
layout illustrated in the previous section will suit situations where a few remotes sites are out of
range. In the case where all sites require coverage aa repeater based system can be a better
proposal. The use of local terrain or infra-structure can be used to locate radio based repeaters at a
high point in the area (e.g. hill top, high building, water tower). Such repeaters will allow all remotes
to send the data via them and the maximum power output to be used for maximum range.
Using repeaters forces all units to communicate via the repeater and often this requires
redundancy or standby hardware to ensure the system is operational in the event of component
failure.
It is essential that duplex frequencies are used for repeaters and that all remotes have the same
transmit and receive pairing of these two frequencies.
Often the repeater has the transmit frequency keyed up constantly. This ensures faster system
polling and stable receive signal strength measurement at the remotes.
This is illustrated in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 2-9


Chapter 2 - Introduction

Figure 9 - Repeater Based Radio System Arrangement


This system layout is available for VHF/UHF radio and Spread Spectrum configured AD2000
Series devices. It is not required for GSM/GPRS systems.

Sub Master Systems

Where a large number of remotes are to be part of a system across a wide geographical area, they
can be sub-divided into smaller systems.
Each sub-system can use the more moderately priced data radios with a lower bandwidth and data
rate to gather from remote sites back to a sub-master AD2000 Series device. Typically these units
only have to process smaller packets of data (10-30 words) and can be configured in numbers to
promote a rapid system update to a sub-master unit This in turn could form a slave mode
connection to a master AD2000 Series device on higher data radio backbone. Here the amount of
data transferred is larger in packet size and thus benefit from the higher data rate and can be
justified in the higher costs.
An example of this is illustrated in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 2-10


Chapter 2 - Introduction

Figure 10 - Sub-Master Based System Arrangement

© 2007 Miri Technologies All rights reserved. V3.00 2-11


Chapter 2 - Introduction

Public Wireless Based Systems


The major development of wide area wireless networks available through public networks installed
by telecommunications companies allows connectivity for some SCADA based systems. Initial
developments use the GSM network and the extended TCP based data capabilities of GPRS.

GSM or GPRS Modem

The AD2000 Series units can have an internal GSM/GPRS modem module installed.
Specifications are found at
‰ Table 15 - AD200xG GSM/GPRS Modem Module Specifications. The part numbers for such
options are of the format AD200xG-xx-xx.

GSM Wireless solutions

This is by far the most common mobile phone standard and is a “world-wide” wireless network. It is
a “common carrier” wireless service and compliments or replaces the traditional “wired” landline
based telephone services we are all familiar with. It is “global” and can be used to send/receive
data across and between countries where the GSM network has been installed. To access the
network the user pays a contract to use the infrastructure that has been installed by a
telecommunications company. It is a connection based system where the user has to dial a
number, make a connection then send or receive data and thus it is relatively slow and can only be
used for historical data updates not real-time. The user is charged based on the length of time
connected. The network must be “data services enabled” for the types of applications the AD2000
products are used on and some telecom carriers charge extra for this service compared to a basic
voice GSM contract. The network data rate is limited to 9600 bps.
The GSM network is an “easy” network to interface to and there are several products in the
marketplace that offer data transfer solutions. The one added “feature” is the Short Messaging
Service (SMS) that the system offers. Here short text messages can be sent to any hand-phone on
the network with, for example, alarm data. This provides a “quick and easy” alarm system without
the need for elaborate SCADA or HMI systems to be installed. The only issue with SMS is that it is
not a guaranteed delivery service and thus cannot be 100% reliable.
Using GSM services with the AD2000 Series devices allows units to be connected together in Point
to Point and Point to Multi-Point network arrangements. Normal device to device parcel based data
transactions are possible using data enabled SIMs, much like a dialup modem connection. Here
one device initiates the connection periodically or on event, connects to the remote device and
reads or writes the data required then disconnects. It I also possible to send device to device read
and write commands via SMS text messages. This varies from the traditional parcel based data
transactions described throughout this manual, however does offer a simplified system where only
basic GM services are available.
In all GSM systems, SMS text messages can be sent to or read from mobile phone hand sets to
enable human interrogation and control of the AD2000 Series devices and any equipment
connected to the I/O terminals and serial ports.

© 2007 Miri Technologies All rights reserved. V3.00 2-12


Chapter 2 - Introduction

Figure 11 - GSM Based System - Typical Layout


Advantages of “GSM” Wireless solutions

‰ Offers communications to country-wide locations (i.e. across larger distances in the region of
hundreds of kilometres that narrow band and spread spectrum solutions cannot transmit
across).
‰ Offers greater portability and mobility where the user can move terminals around his plant or
plants.
‰ The user does not have to fund the infrastructure costs of putting up significant masts and
installing antennae.
‰ “Quick” and “easy” to implement if the GSM service exists in the area of installation.
Disadvantages of “GSM” Wireless solutions

‰ Monthly contract costs are required.


‰ Connection time costs are incurred and these can be significant with increased activity which
can be difficult to predict and control.
‰ Slow data updates and not practical for real time monitoring other than using SMS for alarm
indication.

GSM Service Requirements for use with AD2000 Series Devices

To connect an AD2000 Series device to a GSM network a Data Enabled SIM is required if AD2000
Series to AD2000 Series connections are required. In some telecom carrier systems this is a
separate number compared to the voice number. If SMS only messaging is required then a normal
voice only SIM card can be used.

GPRS Based Systems

General Packet Radio Service (GPRS) is a mobile data service available to users of GSM mobile
phones. It is often described as "2.5G", that is, a technology between the second (2G) and third
(3G) generations of mobile telephony. It provides moderate speed data transfer, by using unused
TDMA channels in the GSM network.

© 2007 Miri Technologies All rights reserved. V3.00 2-13


Chapter 2 - Introduction

GPRS is different from the older GSM Circuit Switched Data (or CSD) connection discussed in this
document. In CSD, a data connection establishes a circuit, and reserves the full bandwidth of that
circuit during the lifetime of the connection. GPRS is packet-switched which means that multiple
users share the same transmission channel, only transmitting when they have data to send. This
means that the total available bandwidth can be immediately dedicated to those users who are
actually sending at any given moment, providing higher utilisation where users only send or receive
data intermittently. Web browsing, receiving e-mails as they arrive and instant messaging are
examples of uses that require intermittent data transfers, which benefit from sharing the available
bandwidth.
Usually, GPRS data are billed per kilobytes of information transferred while circuit-switched data
connections are billed per second. The latter is to reflect the fact that even during times when no
data are being transferred, the bandwidth is unavailable to other potential users.
Packet-switched data under GPRS is achieved by allocating unused cell bandwidth to transmit
data. As dedicated voice (or data) channels are setup by phones, the bandwidth available for
packet switched data shrinks. A consequence of this is that packet switched data has a poor bit
rate in busy cells. The theoretical limit for packet switched data is approx. 160.0 kbit/s (using 8 time
slots and CS-4). A realistic bit rate is 30–80 kbit/s, because it is possible to use max 4 time slots for
downlink. A change to the radio part of GPRS called EDGE allows higher bit rates of between 160
and 236,8 kbit/s. The maximum data rates are achieved only by allocation of more than one time
slot in the TDMA frame. Also, the higher the data rate, the lower the error correction capability.
Generally, the connection speed drops logarithmically with distance from the base station. This is
not an issue in heavily populated areas with high cell density, but may become an issue in sparsely
populated/rural areas.
Telephone operators have priced GPRS relatively cheaply (compared to older GSM data transfer,
CSD and HSCSD) in many areas, such as Finland. Most mobile phone operators don't offer flat
rate access to the Internet (with the notable exceptions of T-Mobile and Cingular in the United
States), instead basing their tariffs on data transferred, usually rounded off per 100 kilobyte.
Typical rates vary wildly, ranging from EUR €1 per megabyte to over €20 per megabyte. In the
U.S., T-Mobile offers US$30 per month unlimited GPRS. In India, BPL Mobile (Bombay) offers
unlimited GPRS for Rs.500 (USD 11) per month. Orange (UK) offers a 1 Gigabyte package for £88
a month. In Poland, Era GSM offers a 2 Gigabyte package of GPRS and UMTS transmission under
Blueconnect brand for €30 a month and Plus GSM offers a 1 Gigabyte package for €15 a month.
GPRS Data on pre-paid packages is usually expensive, and limited to WAP and MMS. Full internet
access, allowing Web browsing, access to POP/IMAP mail, FTP and other mainstream Web
applications is usually restricted to contract packages, and are made available at lower cost.
The maximum speed of a GPRS connection (as offered in 2003) is the same as modem connection
in an analogue wire telephone network, about 4-5 kB/s (depending on the phone used). Latency is
very high; a round-trip ping being typically about 600-700 ms and often reaching one second round
trip time. GPRS is typically prioritized lower than speech, and thus the quality of connection varies
greatly.
In order to set up a GPRS connection, a user needs to specify Access Point Name (APN), user
name and password, and very often an IP address, all provided by the network operator. For the
purposes of AD2000 Series usage on GPRS systems a static IP number must be assigned as this
simplifies the networking to identify each device in the system.
An example layout of the AD2000 Series devices attachment to GPRS based networks is shown in
the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 2-14


Chapter 2 - Introduction

Figure 12 - GPRS Based System - Typical Layout - No Carrier Hub


The GPRS network will allow TCP or UDP networking packets to be used to transfer the data
between a central location and remote sites. The connection from the AD2000 Series devices is
enabled by an internal GPRS modem located inside the AD2000 Series device casing. The part
number for these is AD200xG-xx-xx. External GPRS modems can also be used as long as the
modems used support the same GPRS AT command set (refer to support@miri.com.au for further
details).
A direct TCP packet connection can also be achieved if the GPRS telecom provide can enable
direct access to their network a illustrated in the following diagram:

Figure 13 - GPRS Based System - Typical Layout - Via Carrier Hub


The essentials for GPRS connectivity are:

© 2007 Miri Technologies All rights reserved. V3.00 2-15


Chapter 2 - Introduction

Each device must have a Private Static IP enabled SIM service on an Access Point Name (APN)
assigned network domain. APN is the name of an access point for GPRS. Please note the term
used is “Private Static IP”. This term “Static IP” should not be confused with a static IP address on
the public accessed internet. These can be expensive to obtain due to the lack of global IP number
availability. In the case of the suggested GPRS networks for SCADA usage a “Private Static IP”
number is only required and these are easier and cheaper to obtain from telecom providers. A
Private network is a domain setup by the telecom carrier, accessible to only the telecom carrier and
thus they can assign as many static IP numbers as they wish. No public access is available. This
helps with security issues as well a most SCADA provider companies don’t want public access to
their asset network? The data, once retrieved, can be made available on the public internet via
appropriate web server software packages.
Support for UDP or TCP packets exists. Using UDP will reduce the byte count per packet by
approximately 20 bytes and thus save on data costs if they are charged on a kilobyte basis.
The Scheduler functions within MiriMap2000+ can be used to read data-logged data periodically
via GPRS systems, exporting the data to .CSV files for further use and development. A periodically
polled system with events can be used to create more traditional remote AD2000 Series device to
AD2000 Series device connections for point to point and point to multi-point systems.
Advantages of “GPRS” Wireless solutions

‰ Offers communications to country-wide locations (i.e. across larger distances in the region of
hundreds of kilometres that narrow band and spread spectrum solutions cannot transmit
across).
‰ Offers greater portability and mobility where the user can move terminals around his plant or
plants.
‰ The user does not have to fund the infrastructure costs of putting up significant masts and
installing antennae.
‰ “Quick” and “easy” to implement if the GPRS service exists in the area of installation.
‰ Ideal for historical data-log data retrieval based systems where regardless of the actual
connection reliability the data since last connection is always gathered on the next
successful connection.
Disadvantages of “GPRS” Wireless solutions

‰ Monthly contract costs are required.


‰ Requires service providers to have static IP networks set up on their GSM system network.
‰ Data “used” costs are incurred and these can be significant with increased activity which can
be difficult to predict and control (unless some other contract can be negotiated by the end
user or fixed priced “unlimited” Mbyte contracts are available).
‰ GPRS is typically prioritised lower than speech, and thus the quality of connection varies
greatly if voice traffic is high (e.g. holiday periods).
‰ When the location is far from the nearest GSM cell tower, the connection speed drops
logarithmically with distance from the base station.
‰ Not suitable for “real-time” data faster than 5-10 minutes.

GPRS Service Requirements for use with AD2000 Series Devices

To connect an AD2000 Series device to a GPRS network a Private Static IP enabled SIM is
required if AD2000 Series to AD2000 Series connections are required. Dynamic SIM cards cannot
be used.

© 2007 Miri Technologies All rights reserved. V3.00 2-16


Chapter 2 - Introduction

Satellite Wireless solutions


Satellite has always been the dream “wireless” solution with global coverage being the main
attraction. The reality is that most satellite services offer this through a mixture of land based
systems and satellite. Many satellite services offer coverage in regions only and the “global”
offering transfers data through the existing earth based telecommunications infra-structure.
Iridium was a truly global Low Earth Orbiting Satellite (LEOS) system based on 66 orbiting
satellites at an elevation of approximately 600 miles above the earth in polar orbits. The only places
it doesn't work is North Korea , Poland and Sri Lanka.
Iridium was initially a project headed by Motorola in the late 1990’s whereby they developed the
system and attracted investors globally. Unfortunately, the project was doomed from it’s inception
since management had no idea how to evaluate market demand as it related to price. The system
at this juncture cost 5 Billion USD$ and could only attract less than 50,000 subscribers. In the year
2000, the system went into bankruptcy and was almost de-orbited until it was pulled from
bankruptcy court in 2001 by a consortium of private investors for 25 Million USD$. The system
exists today with handsets and service pricing at dramatically lower costs than initially developed at
and has become a marketable success showing close to 100,000 subscribers. Since the US
Defence Department had a stake in maintaining the system it’s future under the new owners is
assured (it had a $200 million contract to participate in the project and also continues to use the
service. It says it spent $140 million building its own gateway in Hawaii and paying Motorola to run
it, and buying 3,000 satellite handsets). The Iridium system was a significant component to media
and military communications in the recent war in Iraq.
The Iridium Satellite System is the only provider of truly global, mobile satellite voice and data
solutions with complete coverage of the Earth (including oceans, airways and Polar regions). The
constellation is now managed by Boeing under an engineering contract and works through one
down linking gateway located in Tempe, Arizona. USA. The service is ideally suited for a variety of
rural and industrial applications, covering a wide range of vertical segments which includes:
construction, media, government, defence/military, EMS, marine, mining, forestry, oil and gas,
aviation and so on. Although predominantly voice based, the Iridium network also has some unique
data service features when compared to other satellite services (such as Inmarsat etc.).
Miri Technologies is working closely with Iridium service providers to utilise their Short Burst Data
(SBD) system that allows large packets (1900 bytes) of data to be sent from remote locations to a
central server via the Iridium network and then onto email recipients world-wide. This would allow
remote users to retrieve periodic data information from sites throughout the world and have the
data available at any corporate network headquarters.

Figure 14 - Satellite Based System - Typical Layout using Iridium Network


Advantages of “Satellite” Wireless solutions

‰ Offers “global” communications.


‰ Offers greater portability and mobility where the user can move terminals around his plant or
plants (country-wide).

© 2007 Miri Technologies All rights reserved. V3.00 2-17


Chapter 2 - Introduction

‰ Can offer remote data links to equipment on almost any part of the earth’s surface, in areas
where landline and other wireless services do not exist (e.g. ideal for trans-national pipelines
and marine applications).
Disadvantages of “Satellite” Wireless solutions

‰ High running costs (although with Iridium they have matched GSM data-based service costs)
‰ High capital cost of modems and antennae (when compared to the narrow-band and
GSM/GPR solutions).
‰ Restricted services and not a wide range of products available in the marketplace.

Data Gathering Techniques


In many remote monitoring applications data is generally collected in real time. Typically there is a
central monitoring site that gathers the remote location data. There could be tens of remote
stations and one central location. The terminology typically used is that one AD2000 Series unit
acts as the “master” and there can be one or several “slave” devices. These can be in the form of
any of the layouts discussed in the section on typical system layouts.
There are also many remote monitoring applications where data is generally collected locally to the
remote device, stored with a time stamp on each record and that data is retrieved periodically via
the data communications link. Here the critical factor is not knowing, at the central monitoring
location what happened at the instant an event occurred but to know the sequence of events at a
later date. This is ideal for water supply systems where changes over a period of time are
accumulated locally to the remotes (e.g. flow totals, pressures, run-hours etc.). Using a
combination of periodical scheduled data-log gathering with events for critical alarms a system
which conserves bandwidth and limits air time costs can be design (especially useful on
GSM/GPRS based systems).
Several options are available in the AD2000 Series system software to get the data across the
networks that are formed by the AD2000 Series devices:

Continuously Polled

The Master will “poll” the slave devices requesting the data. This data poll can be continuous or
periodic. Continuously polled systems are best suited where the fastest possible update time is
required. The restriction is that on larger systems (100+ slaves) the time to get event changes can
be long, depending on how long the polling cycle takes.

Periodically Polled (with events)

The Master will “poll” the save devices at pre-determined times (e.g. every 10 minutes, every hour,
every day) as set in the polling cycle of the Master AD2000. In between the poll there is no activity.
This allows events at the slaves to get access to the master AD2000 in between polls to send
event changes. The restriction here is that if events are sent during the time a Master is polling they
may not get through.

To avoid losing event data, event data packets should always be duplicated with polled data
packets.
This is a system feature suited to modem based systems (e.g. dial-up, GSM and GPRS).

Broadcast Event Polling

This is a unique feature to the AD2000 Series products that can be used only on radio systems
where all slaves will be able to “hear” the Master polls. The polling sequence is the same as a
regular poll where the Master will “poll” the slave devices requesting the data. In between polls a
“Broadcast” for events request from the slave devices is sent. Any slave will send events queued to
the Master. This will provide faster event updates from the slave AD2000s than in the normal
periodically polled systems and ensures all events get through.

© 2007 Miri Technologies All rights reserved. V3.00 2-18


Chapter 2 - Introduction

Scheduled Data-log Reading

In any real-time system, when data is gathered it is presented to some form of SCADA or HMI
software application. This software will add a time stamp for the day and the hour, minute and
second for use in the local HMI/SCADA alarm database. In most cases there is a slight delay
between the actual event taking place in the field and the time this software application applies that
time stamp. Where the update time is fast or where the delay in this time-stamp is not an issue
then most systems can tolerate the delay.
Many systems are less concerned in having the data read in “real-time” but do require the actual
time the event or the value was recorded to be used. The AD2000 Series devices have internal
data-logging capabilities and can store tens of thousands of sampled events or values and text
messages. Typical system applications that can use this feature are weather and environmental
monitoring, water supply, waste-water and flood monitoring systems.
The system arrangement used is to run a software scheduler product on a centrally located PC and
use it to gather the data-log data from the remote network. The data is retrieved with the historical
time stamp attached to each data value or text string recorded at the remote in the data-log
memory of the AD2000 Series device. That data is then exported to a Comma Separate Variable
(CSV) file format for onward use in analysis or via external programs such as HMI/SCADA software
packages.

Figure 15 - Data-log Scheduler System Arrangement


A combination of a periodically polled system with events and this scheduled data-log reading of
records provides a suitable method of having urgent event data sent in “real-time” and historical
data stored and sent occasionally. The advantage in this method is that non-essential data is still
gathered, records of data values never lost, the time stamping is accurate and the system
bandwidth does not have to accommodate the throughput demands of a continuously polled
system. This is ideal for slow to respond, non-critical systems.

Remote Connectivity
The AD2000 Series devices can be connected in system configurations that will allow remote “over
the air” monitoring and programming. The following diagram illustrates the remote connection
capability. Once all the AD2000 Series units in the project contain the same project configuration
details from the same project file, each unit is aware of the physical links between them. This is
determined by a routing table and thus any changes to the physical links in the configuration should
be updated to the installed AD2000 Series units that these change effect.

© 2007 Miri Technologies All rights reserved. V3.00 2-19


Chapter 2 - Introduction

Figure 16 - Remote Connectivity Example Diagram


In the diagram, the radio network is the primary data connection. However, connecting a PC
running MiriMap2000+ to one of the spare communications ports will allow remote connection to
the other AD2000 Series units via the radio network. Typically this would be a PC connection to the
RS232 port, however this is also possible via the Ethernet port.
Remote connections from slave units to other devices is also possible as long as the master device
leaves a time slot in communications to allow the remote to access the network.

All stations must first be configured with the same MiriMap2000+ configuration file,
have unique identifier numbers assigned and have working physical links available between
the sites.

PLC Control Functions


In many remote monitoring applications there are requirements to perform local control logic on the
various field devices that are being monitored. Traditional approaches would be to install a small
Programmable Logic Controller (PLC) at the site to do this and connect it to an external modem
device. Connecting such devices to external modems (radio, GSM, GPRS etc.) often requires
special modules, cables, software and knowledge to implement all of which can add to the
engineering process in both time and cost. Since the AD2000 Series devices combine real-time,
data-logging and programmable logic capabilities then they can be integrated into a variety of
remote monitoring and control systems “out of the box”. The in-built PLC capability is inherent to
the AD2000 device via the Ladder logic interface and thus no extra software or knowledge is
necessary to implement a remote monitoring device with PLC control.
A program in ladder logic, also called a Ladder Logic, is similar to a schematic for a set of relay
circuits. Ladder logic is useful because a wide variety of engineers and technicians can understand
and use it without much additional training because of the resemblance to familiar systems.
Advantages of using the internal AD2000 PLC functions are:
‰ Integrated software package handling all AD2000 Series program and monitoring functions
‰ Integrated communications allowing local and remote “over the air” connections
‰ No other special cables or software
‰ A compact solution, useful when limited space is available
‰ In-built PLC software functions for local control and monitoring of the field devices connected
to the AD2000 Series device via I/O or serial channels.

© 2007 Miri Technologies All rights reserved. V3.00 2-20


Chapter 2 - Introduction

‰ Real-Time Clock coils and diagnostic memory points so that control and monitoring functions
can be completed based on the time of day.
‰ On-line (local and remote) monitoring of logic and memory variables.
‰ Tabbed view sub-routine programming so logic code can be written in manageable sections.
‰ Special function blocks to perform integral data parcel event sending within ladder logic
‰ Special function blocks to perform integral data logging within ladder logic
‰ Special function blocks for Moving Average, Flow Rate calculations and others.
A full listing of the PLC/Ladder logic functions available for programming use can be seen in the
technical specifications section.
An example of the Ladder logic screen in the MiriMap2000+ software package is shown below and
for details on configuration go to the chapter on Ladder Logic Functions.

Figure 17 - Example Ladder Logic screen from MiriMap2000+

Data-logging Monitoring Functions


In many remote monitoring applications there are requirements to store or data-log certain events
and memory variables that are being monitored. This could be digital status (e.g. alarms, fault
conditions or a required device status change etc.) or counters and analogue values (e.g. rainfall,
run hours, tank levels, flows). These values can then be read later, either locally or remotely for
analysis or input into a SCADA software system.
Traditional approaches would be to install a separate data-logger device at the site to do this and
connect it to an external modem device. Connecting such devices to external modems (radio,
GSM, GPRS etc.) often requires special modules, cables, software and knowledge to implement all
of which can add to the engineering process in both time and cost.

© 2007 Miri Technologies All rights reserved. V3.00 2-21


Chapter 2 - Introduction

Since the AD2000 Series devices integrate wireless RTU/PLC/Data-Logger functions into one
product remote monitoring and control is possible “out of the box”. The in-built data-logger
capability is inherent to all the AD2000 devices and no extra software or knowledge is necessary to
implement a remote monitoring device with data-logging capability.
The AD2000 Series Data-logger functions offer:
‰ In-built data-logger interface to enable periodic and event based data logging.
‰ Descriptive text string logging with embedded memory variable values (e.g. DD:MM:YY
HH:MM:SS Tank level=10.05m)
‰ Log counters, timers and any internal AD2000 memory variable in short and long integer and
floating point format.
‰ Scheduler to remotely read any data-log data from any AD2000 in the network and export to
Comma Separated Variable (CSV) file format for use with databases and spreadsheets.
An example screen from the data-logging utility in MiriMap2000+ is displayed below and for details
on configuration go to Chapter 7 - Data-logging Functions.

Figure 18 - Example of Data-logging Screen in MiriMap2000+ Software

Protocol Connectivity to Other Devices


In many SCADA systems the data gathered via the remote monitoring system will be viewed and
processed via a SCADA software package or Human Machine Interface (HMI) package. Typically
these are installed at the central monitoring station and will host several commonly used industrial
protocol drivers to allow the data from the AD2000 Series device to be read from or written to via a
suitable interface.
The most popular protocols such as Modbus and Allen Bradley (Rockwell) DF1 are supported in
the AD2000 Series devices. Other special protocols are also written for special applications and
devices. The AD2000 Series devices use their own protocol to enable the routing techniques used
for remote programming and store and forward repeating of data. There is an OPC Server
available for this AD2000 protocol to allow interface to SCADA and HMI systems that support the
OPC Client connectivity (see http://www.opcfoundation.org or further information).

© 2007 Miri Technologies All rights reserved. V3.00 2-22


Chapter 2 - Introduction

For a full detailed list of protocols supported see Chapter 8 - Protocols.

I/O Expansion Modules to Expand AD2000 Series Devices


In many situations the on-board analogue and digital Input/Output (I/O) channels on the AD2000
Series modules will satisfy most applications. There are situations where additional I/O are required
and the I/O Expansion modules are available for this scenario. These use the RS485 2 wire
interface to connect the data link to the main AD2000 Series module. In the case of the AD2000
this requires an RS232/RS485 converter (available as a DIN rail mounted module from Miri
Technologies, part number M232-485) between one of the AD2000 RS232 ports and the I/O
Expansion module RS485 terminals. In the case of the AD2006 there is an on-board RS485 port
designed to connect these modules to.
Up to 32 I/O Expansion modules can be supported on one AD2000 Series Device port (subject to
the use of correct RS485 cabling and termination). The arrangement is shown in the diagram
below:

Figure 19 - Example of I/O Expansion Modules

Wired Connectivity Options


Typically the AD2000 Series devices are used where wireless connectivity is required. However,
they will be required to pass the data gathered via these networks to traditional wired devices such
as HMI/SCADA PCs or DCS/PLC based systems. The wired options available on board the
AD2000 Series hardware are:
‰ RS232, RS485, 2wire/4wire FFSK audio and Ethernet
Interfaced to fibre optic systems is also possible via common converters.
Some typical connections are suggested in the following diagram:

Figure 20 - Wired Connection Options


For further details on the interface options per AD2000 Series device see the Technical
Specifications section.
Ethernet LAN and WAN connections are also possible between the AD2006 units operating with
the Miri2000 or Modbus/TCP protocols in master or slave modes, enabling point to point and point
to multi-point configurations.

© 2007 Miri Technologies All rights reserved. V3.00 2-23


Chapter 2 - Introduction

A typical example using the Modbus/TCP protocol is shown in the following diagram:

Figure 21 - Ethernet Networked AD2006s Using Modbus/TCP

The more traditional AD2000 Series device Master to Slave Point To Multi-Point (PTMP) system
configuration is also possible on LAN and WAN networks. Typically this has a single master
AD2000 Series device with multiple slave AD2000 Series devices.
A continuous or periodically polled system can be built in the same manner as described I the
manual section Building a System “Network” Map. Chossing the source and destination ports
assigned to Ethernet (in the case of the AD2006 this is Port5), the parcels can be constructed
between the AD2000 Series devices. The AD2006 devices should be used and the Ethernet ports
set up to use UDP. Details on how to set up the AD2006 Ethernet port is available in the section
AD2006 - Ethernet Port Set-up.

It is important to note that in this arrangement the remote port settings are defined. From the
slave devices they point to the Master IP address and for the Master the IP address is set to
x.x.x.255 so as to accept all incoming packets and broadcast all outgoing packets.
A typical example using the Miri2000 protocol with UDP is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 2-24


Chapter 2 - Introduction

Figure 22 - Ethernet Networked AD2006s Using Miri2000 and UDP PTMP System

© 2007 Miri Technologies All rights reserved. V3.00 2-25


Chapter 2 - Introduction

AD2000 Series Devices Technical Specifications


The following technical specifications are listed for the various options available for the AD2000
Series devices:

Table 2 - Logic Functions


Logic Functions Subject to change as new features are added - Consult User Manual.

Arithmetic & Maths - Add, Subtract, Multiply, Divide, Cosine, Sine, Tangent, Arc Cosine, Arc Sine,
Arc Tangent, Log Natural, Exponential, Log Base10, Square Root, Power, Degree To Radian, Radian
To Degree
Data Manipulation - Absolute, Greater Than, Less Than, Equal To, Maximum, Minimum, Modulus, Bit
Shift Left, Bit Shift Right, Rotate Left ,Rotate Right, Decrement, Increment, Move, Move Not, Convert,
AND Word, OR Word, XOR Word
Boolean - Normally Open, Normally Closed, Positive Edge, Negative Edge, Any Edge, Output Coil,
Not Output Coil, Set/Reset Output Coils
Timer/Counter - Counter Up, Counter Down, Counter Up Down, Timer Pulse, Timer On-Delay, Timer
Off-Delay, Timer Accumulating
Special - Change Detect, High Speed Counter for DIN1 and DIN2, High Speed Rate Calculation for
DIN1 and DIN2, Datalog Variable, Moving Average, Parcel, RTC Time, RTC Date, Rate Calculation,
Scale, Shaft Encoder Interface, PID (option on application).

Table 3 - Physical Dimensions


Dimensions (for AD2000 & AD2006)
Length 202mm (7.95”)
Width 178mm (7.01")
Depth 60mm (2.36")
Weight (with internal radio or modem) 950g
Weight (with no internal radio or modem) 650g

Table 4 - Environmental Specifications


Environmental Specifications
Operating temperature range -10°C to +70°C
Operating humidity range < 90% RH
Storage temperature range -40°C to +85°C

Table 5 - Power Interface Specifications


Power Interface Specifications *24VDC option available AD2000/2

Main input voltage - range +10.5 VDC to +15.0 VDC


Main input voltage - nominal 12.0 VDC
Peak input current (maximum) 200mA @ 12.0 VDC

Table 6 - Supported Protocols


Protocols
Miri2000 (&Oval2000)
Modbus
Allen Bradley DF1 Half Duplex Slave
OPC
TCP/IP Protocol stack, UDP, Telnet configuration
Protocol development available on requested

© 2007 Miri Technologies All rights reserved. V3.00 2-26


Chapter 2 - Introduction

Table 7 - AD2000 Communications Port Specifications


Port Specifications AD2000
1
Internal module - number 1 x FFSK modem or RS232
1
Either FFSK or RS232 not both. With any internal communications module fitted, e.g. GSM/GPRS module, this port is not available for
external device connection. FFSK modem data rates selectable 1200/2400/4800 bps. RS232 date rates 300-38.4kbps.

2
Serial Ports - number 1 x RS232
2
All to 38.4kbps, RS232 via RJ45 connectors
3
PCMCIA/PC Card - number 1 x type II
3
Supports Ethernet (LAN & ADSL connectivity). RS232 and CF FLASH memory card capability. Specific cards only to be used with
installed drivers. Not all PCMCIA/PC Cards are compatible. Contact AD2000 dealer for compatible products.

Table 8 - AD2006 Communications Port Specifications


Port Specifications AD2006
1
Internal module - number 1 x FFSK modem or RS232
1
Either FFSK or RS232 not both. With any internal communications module fitted, e.g. GSM/GPRS module, this port is not available for
external device connection. FFSK modem data rates selectable 1200/2400/4800 bps. RS232 date rates 300 to 115kbps.

2
Serial Ports - number 2 x RS232 + 1 x RS485
2
All to 115kbps, RS232 via RJ45 connectors, RS485 via screw terminals
Ethernet Option 1
Interface Ethernet 10Base-T or 100Base-TX (Auto-Sensing)

Connector RJ45

Layer 3 Protocols TCP, UDP, IP, ARP, ICMP, SSH, SSL, XML, HTTP, PPP, PAP, CHAP, DNS, SMTP,
RSS, DHCP, BOOTP, AutoIP, SNMP, FTP, TFTP, Telnet, CGI

USB 2.00 Programming port 1

Table 9 - I/O Specifications


Input/Output Specifications AD2000 (N.B. Optical isolation to AD2006 (N.B. Optical isolation to 3kV)
3kV)
Digital Inputs - number 16 16
Digital Inputs - voltage 10-50VAC/DC or 10-50VAC/DC or
70-110VAC/DC 70- 110VAC/DC
Digital Inputs - pulse 1 High Speed to 5kHz 2 High Speed to 5kHz
(All digital inputs count to 5Hz) (to 50VDC) (to 50VDC)
Digital Outputs - number 4 (2 form A and 2 form C) 4 (2 form A and 2 form C)
Digital Outputs - type Relay or Relay or
Transistors 100mA sinking Transistors 100mA sinking
35VMax 35VMax
Analogue Inputs - number 8 (if 4 x Analogue O/Ps used 4 I/Ps 8 (if 4 x Analogue O/Ps used 4 I/Ps
available) available)
Analogue Inputs - type 4-20mA/1-5V or 4-20mA/1-5V or
0-20mA or 0-20mA or
0-10V 0-10V
Analogue Inputs - format 12 bits 12 bits
Accuracy 0.1% Accuracy 0.1%
Linearity 0.1% Linearity 0.1%
Analogue Outputs - number 4 x 4-20mA (Optional) 4 x 4-20mA (Plug-In Module)

Table 10 - Memory Specifications


Memory Specifications AD2000 AD2006
RAM 256kbyte 512kbyte
Program storage FLASH 512kbyte 512kbyte
1 1
Datalog FLASH (on-board) 512kbyte 1Mbyte
1
As an example 4 x 12bit resolution analogue channels are time stamped data-logged every 15 minutes to give approx 136 days of data
logging before first data is over-written. (1Mbytes=1024*1024=1048576bytes, 10 bytes/logged channel)

© 2007 Miri Technologies All rights reserved. V3.00 2-27


Chapter 2 - Introduction

Table 11 - AD2000 Series Temperature Specifications


AD2000 Series Temperature Specifications
AD2000R (Specified without radio) -30 to +70 Celcius
AD2000E -30 to +70 Celcius
AD2000B -30 to +70 Celcius
450SR Series Radio Standard -10 to +60 Celcius
Version
450SR Series Radio 1 Watt only -10 to +70 Celcius
450M Series Radio -30 to +60 Celcius
450E Series Radio -30 to +60 Celcius
150SR Series Radio -30 to +60 Celcius
900SS Radio Module -30 to +70 Celcius
24SS Radio Module -30 to +70 Celcius
M16-LN Input Module -30 to +70 Celcius
M16-HN Input Module -30 to +70 Celcius
M16-TR Relay Module -30 to +70 Celcius
M8-AD Analogue Input Module -30 to +70 Celcius

Table 12 - AD200xS Spread Spectrum Wireless Module Specifications


Specifications
Frequency Option1 902-928MHz
(where approved)
Frequency Option2 2.4000-2.4385GHz
(Global ISM Band)
Spreading Spectrum Type Frequency Hop, direct FM
Network Topology Point To Point, Point To Multi-Point, Store & Forward

Channel Capacity 7 hop sequences share 25 frequencies

Certifications ETSI (2.4GHz model only), FCC Part 15.247 (Both)

Performance
Indoor/Urban Range (900MHz) 457m
Indoor/Urban Range (2.4GHz) 183m
Outdoor LOS Range (900MHz) 11km (dipole)
32km (high gain antenna)
Outdoor LOS Range (2.4GHz) 5km (dipole)
16km (high gain antenna)
Serial Data throughput 9600/19.2kBPS
RF Baud rate 10,000/20,000BPS

Transmit Output Power (900MHz) 140mW (21.5dBm)


Transmit Output Power (2.4GHz) 50mW (17dBm)
Receiver Sensitivity (900MHz) -110dBm@9600BPS
-107dBm@19.2kBPS
Receiver Sensitivity (2.4GHz) -105dBm@9600BPS
-102dBm@19.2kBPS
Environmental Specifications
Operating temperature range 0°C to +70°C
Operating humidity range < 90% RH
Storage temperature range -40°C to +85°C
General
RF Connector type SMA

© 2007 Miri Technologies All rights reserved. V3.00 2-28


Chapter 2 - Introduction

Table 13 - AD200xR Narrow Band VHF Radio Module Specifications


AD200xR Narrow Band VHF Internal Radio Module
Type 02
Frequency Range 132-174KHz
Frequency Control Synthesised
Emission Designator 12.5kHz –11KOF3E
25kHz –16KOF3E
FCC Acceptance Type NP42422430-001
IC Acceptance Type 2984195377A
Transmitter
Tx Power 2W or 5W
(Please specify)
RF Output Impedance 50ohm
Duty Cycle 50%
Attack Time 7millisecs
Frequency Stability 2ppm
FM Hum and Noise -40dB at 12.5kHz
-45dB at 25kHz
Modulation Distortion Less than 3%
Current Drain 1.2A@2W
Receiver
Sensitivity -116dB for 12dB SINAD
Frequency Stability 2.5ppm
Attack Time 7millisecs
Carrier Detect Time 30millisecs
Selectivity -60dB at 12.5kHz
-70dB at 25kHz
Inter-modulation -70dB
Current Drain 90mA
Conducted Spurious -57dBm
Audio Distortion Less than 3%
General
RF Connector type SMA

© 2007 Miri Technologies All rights reserved. V3.00 2-29


Chapter 2 - Introduction

Table 14 - AD200xR Narrow Band UHF Radio Module Specifications


AD200xR Narrow Band UHF Internal Radio Module
Frequency Range 370-520MHz
Sub-Frequency band options
10 (Tx) 848 to 858MHz
(Rx) 920 to 934MHz
11 (Tx) 920 to 934MHz
(Rx) 848 to 858MHz
12 855 to 860MHz (Tx & Rx)
14 (Tx) 925 to 943MHz
(Rx) 906 to 924MHz
15 (Tx) 904 to 922MHz
(Rx) 925 to 943MHz
16 924 to 944MHz (Tx & Rx)
50 403 to 417MHz (Tx & Rx)
51 450 to 465MHz (Tx & Rx)
52 465 to 480MHz (Tx & Rx)
53 480 to 494MHz (Tx & Rx)
54 505 to 518MHz (Tx & Rx)
55 435 to 450MHz (Tx & Rx)
56 418 to 435MHz (Tx & Rx)
57 428 to 443MHz (Tx & Rx)
o
Frequency Stability +/-1kHz(-10 to 60 C)
Aging <=1ppm/annum
Transmitter
Tx Power 100mW to 5W
Modulation Direct FM DC to 25MHz
Tx/Rx Turn-around time <30msec
Timeout Timer 1-60secs
Tx Spurious <=65dBc
Receiver
Sensitivity -118dB for 12dB SINAD
Blocking >75dB (EIA)
Inter-modulation <=70dB (EIA)
Spurious Response <=70dB (EIA)
Selectivity and De-sense Better than 70dB (EIA)
AFC Tracking +/- 3kHz Tracking@-90dBm/attack time<10ms
Mute Fully open to –60dB
General
Transmit Current Drain 650mA @ 13.8V
1600mA @ 13.8V
Receive Current Drain 70mA
RSSI Signal/Temperature/Tx Power Internal Diagnostics
RF Connector type SMA

Table 15 - AD200xG GSM/GPRS Modem Module Specifications


Data Service Specifications
Dual Band 900/1800MHz
Phase 2 + Specifications
SMS
Class 10
Coding: CS1 to CS4
SMG31bis compliant
Internal TCP/IP Stack
Conformity
Safety EN 60950:2000 Issue 2000
EN 50360:2001 Issue 2001
Electromagnetic Compatibility EN 301 489-1 Issue 1.2.1
EN 301 489-7
Radio Spectrum Efficiency EN 301 419-1 Issue 4.1.1
EN 301 511 Issue 7.0.1
Approvals - GSM EC-R&TTE Reg. No. H1M2030490112-C
Approvals - CE CE0681
General
RF Connector type SMA

© 2007 Miri Technologies All rights reserved. V3.00 2-30


Chapter 2 - Introduction

AD2000 Series Product Comparison Table


Table 16 - Product Comparison Table
Feature AD2000 AD2006
Micro-processor type 32 bit 32 bit
On-board Program Memory (RAM) 256kbytes 512kbytes
On-board PLC Program Variable Memory (RAM) 256kbytes 512kbytes
On-Board Configuration & Program Storage (FLASH) Memory 256kbytes 512kbytes
On-Board Datalog (FLASH) Memory 512kbytes 1Mbytes
On-Board Battery Backed Real Time Clock  
Digital Inputs 16 16
Number of above Digital Inputs configurable as High Speed 1 2
Counter inputs to 5kHz
10-50VAC or DC Low Power and 60-130VAC or DC High Power  
Digital Input Options Available
Digital Outputs 4 4
Number of Digital Outputs Selectable as Form A or Form C Relays 2 2
(all others are fixed at Form A)
Analogue Inputs 8 8
See See
Analogue Outputs 4(option) 4 (plug-in)
Note 1 Note 1

I/O Expansion Module Connectivity See Note 2 See Note 2


In-Built RS232 Ports 1 2
In-Built RS485 Port  1
In-Built PCMCIA Type II slot (for option cards) 1 
In-Built 300/1200/2400/4800 Baud FFSK Modem or RS232 Port 1 1

USB 2.0 Programming port  


Total Maximum Number of Communications Ports 3 5
Report By Exception (Event Messaging) Capability  
PLC Logic Functions  
Data-logging Capability  
Real Time Clock (RTC)  
Multiple Protocol Capability  
Windows Software Configuration Programme Package  
OPC Server to OPC compatible Client HMI Packages  
In-Built GSM/GPRS Modem Capability  
In-Built CDMA Modem Capability  
In-Built Spread Spectrum Radio Modem Capability  
In-Built UHF Narrow Band Radio Modem Capability  
In-Built VHF Narrow Band Radio Modem Capability  
Connectivity to External radio Modems  
Connectivity to External PSTN/Leased Line Modems  
TCP/IP & UDP via Ethernet capability See Note 3 
Mounting Bracket  
-40C to +85C Temperature rated device options  
Industrially proven, rugged housing  
IP rated enclosures available  
Removable Terminals  
Power Supply Option 12 or 12 or 24VDC
24VDC
Solar Power Option  
The table above illustrates the options available on the different AD2000 Series devices options:
Notes:

© 2007 Miri Technologies All rights reserved. V3.00 2-31


Chapter 2 - Introduction

1. On the AD2000 & AD2006 the Analogue Outputs are jumper configurable. Use of each output
channel will reduce the number of input channels available by one channel, e.g. use 1
analogue outputs channel, 7 analogue inputs can be used, use 2 analogue output channels, 6
analogue inputs can be used etc. The AD2000-xA-xx option MUST be ordered to have
analogue outputs. The AD2000 has to have the outputs fitted at the factory. The AD2006 has a
plug-in socket available, so the analogue outputs can be purchased and installed as required.
2. On AD2000 I/O Expansion modules are connected via external RS232/485 converter, on the
AD2006 this connection is via the in-built RS485 port.
3. On AD2000 this is via a separate PCMCIA card. On the AD2006 this is via a on-board module
that is fitted internal to the AD2006 casing.

© 2007 Miri Technologies All rights reserved. V3.00 2-32


Chapter 3 - Getting Started

Chapter 3 - Getting Started


This section describes how to get your AD2000 Series hardware up and running and configured
with MiriMap2000+.

Hardware and Software requirements


To operate any basic system you need the following hardware:

‰ Two AD2000 Series devices with either wireless or wired interfaces. The chapter on the
AD2000 Series part numbers gives further details about the various products available.
‰ A suitable power supply. There are two power supply options available for the AD2000
Series products, 12VDC or 24VDC. Each requires the correct supply voltage applied to
operate correctly and so as not to be damaged. A 1.5A switch mode power supply
converting AC voltages from 240 or 110VAC to 12V or 24V DC is recommended. The 12V
versions of the AD2000 Series devices have part number AD200x-xx-xx-12 and the 24VDC
models have part number AD200x-xx-xx-24. Labeling on the AD2000 Series casing is
different for the two models.
‰ Suitable antennae and inter-connecting cables for the wireless option being used.
‰ A PC or laptop with the following specifications:
Software requirements
Windows Vista, 2000 Pro, XP Pro, 2000 Server, 2003 Server or NT 4 (Service Pack 6)
Microsoft Internet Explorer (Version 6.0 or later). This will enable the .CHM format Help files.
Hardware requirements
Minimum: Pentium II 500MHz, 256MB RAM, 30MB HD (free) Monitor 1024 x 768 screen resolution
1 x RS232 port (COM port) for the AD2000 devices or 1 x USB2.0 port for the AD2006 devices
USB2.0 to RS232 converters can be used, ensure they come with suitable driver CDs to allow
correct configuration into your PC. MiriMap2000+ will detect all correctly installed ports and prompt
the user to choose. Ensure that the Com Port Wizard in enabled in Project Options for this to work.
‰ An AD2000 Series RS232 programming cable for the AD2000 or AD2006.
‰ The AD2006 devices have an in-built USB2.0 Type B port available for programming, thus
for the AD2006 only a USB2.0 Type A to Type B cable as illustrated in the following
diagram can be used for programming:

Figure 23 - Example of USB2.0 Type A to B Cable Connectors

© 2007 Miri Technologies All rights reserved. V3.00 3-1


Chapter 3 - Getting Started

To operate any basic system you need the following software:


‰ MiriMap2000+ Version 3.00 software application. This is available for download from the Miri
Technologies website www.miri.com.au.
‰ To use the Import/Export variables utility and the data-log data viewing, Microsoft Excel is
recommended. A text editor can be used but Excel allows greater flexibility in this process.

Default Programming ports


The default programming ports for connecting MiriMap2000+ are as illustrated in the following
diagram:

Figure 24 - Programming Ports

Which Port is Which?


The following diagrams illustrate the port numbers on the AD2000 Series devices.

Figure 25 - AD2000 Port Numbering

Figure 26 - AD2006 Port Numbering

© 2007 Miri Technologies All rights reserved. V3.00 3-2


Chapter 3 - Getting Started

Mode Switch
The AD2000 Series devices have two operational modes, Run and Program. To change mode,
locate the mode switch on the right hand side of the device. The mode switch can be moved to
either position without the need to turn the power off.

Figure 27 - Run/Program Mode Switch


In RUN mode all ladder logic, data-log and communication port functions operate. This is the
normal position of the mode switch. The Front LED
In PROG, program mode, ladder logic, no data-log functions operate and only the default
communication port settings will be available. Use this mode if no connectivity to the AD2000
Series device is possible. This may be due to ports being set-up incorrectly or where they are
unknown and need to be restored to default settings.
For the AD2000 units in PROG, program mode, the Port2 - RS232 port is available for
programming with the default communication port settings of 38.4k, 8, N, 1.
For the AD2006 units in PROG, program mode, the Ports 1, 2, 3 and 5 (RS232 port) are available
for programming with the default communication port settings of 38.4k, 8, N,1 and the USB port5 is
also available.
Default setting map files can be found in the MiriMap2000+ Examples folder.

© 2007 Miri Technologies All rights reserved. V3.00 3-3


Chapter 3 - Getting Started

System Design Concepts


Before commencing any software or hardware configuration, consideration of the following should
be made. Some typical pointers to assist this design process follow.

What is the intended application?


The AD2000 Series products are designed for remote monitoring in low to medium I/O point
applications using wireless communication links. Whilst the AD2000 Series devices have internal
PLC and data log functionality, they are primarily designed to process the PLC and data-log
processed data internally and allow communications across wide area networks. For stand alone
PLC systems consider stand alone PLC equipment.
Verify the required update speed across the communications network. Radio offers the best speed
and data throughput, however, there are several types of radio available (internal and external) and
these all offer trade-off in data rates compared to costs. The higher the data rate, the higher the
cost. For systems with 20 or 30 words of data, having high data radios may not be required or be a
significant cost disadvantage.

How are the AD2000 Series devices to be arranged?


Refer to the section on typical system layouts to design the best system arrangement. For larger
point to multi-point systems, (more than 30 remotes) some form of event triggering with periodic
polling will be required if the polling time response is to be reasonable. Consider the feature of
exchange parcels to halve the polling time.

How many AD2000 Series devices are to be used in the eventual system?
Consider here the intended maximum, not just the immediate requirement. Typical experience
indicates that many systems will be expanded in the future and accommodating these at the start
of the design process can simplify this future expansion.

What devices are the AD2000 Series devices being connected to?
Consider the type of transducers, their number and what power requirements are necessary to
interface the to AD2000 Series device.
Where other PLC devices are being connected, consider the amount of data that is required and
what affect that will have of the system polling time.

Upgrading from earlier versions


The AD2000 unit hardware (AD2000, not AD2006) has had 6 hardware revisions on the PCBs,
Rev-0 to Rev-5 to add features and to resolve known issues. All versions can be upgraded to the
latest firmware, however, there are some limitations on older units that have to be considered. The
simplest method of upgrading the units is to fit recently created firmware EEPROM Flash chips into
socket U104 on the AD2000s. This can be done in the field as long as due care is taken and a
clean environment available. Contact Miri Technologies support for further details
support@miri.com.au.
Otherwise, there is a method available to upgrade the firmware via the RS232 port on the AD2000.
There have been several versions of the application software package to accommodate the various
stages of product growth. The major revisions were Version 1.xx, 2.0x, 2.10 and now Version 3.xx.
All AD2000 Series devices that have been programmed with Version 2.10 and upwards can be
upgraded serially using later releases of MiriMap2000+.

An AD2000 or AD2006 device programmed with a Version 3.xx release of MiriMap2000+ and
the associated firmware can communicate across a radio network to AD2000s running the Miri2000
protocol which were programmed with the last release Version 2.12SP6 of MiriMap2000+. Thus,
immediate upgrades are not required to process data parcels, however, to fully utilize the features
of Version 3.xx such units should be upgraded at the most appropriate opportunity.

© 2007 Miri Technologies All rights reserved. V3.00 3-4


Chapter 3 - Getting Started

In GPRS based systems using AD2000s, the data transmission mode used in Version
2.12SP6 of MiriMap2000+ and the associated firmware was ASCII. In Version 3.xx releases of
MiriMap2000+ and the associated firmware it is now Binary. Thus, immediate upgrades are
required to process data parcels between stations and thus they must all be upgraded at the
same time when moving to Version 3.02 and onwards.

Downgrading to previous versions


For AD2000s only (not AD2006s). Any units which have been programmed with Version 3.xx
release of MiriMap2000+ and the associated firmware, can be programmed with Version 2.12SP6
of MiriMap2000+ and used on a system based on this version. AD2006s can only be supported via
Version 3.xx release of MiriMap2000+ and the associated firmware.

Part Numbers
There are several AD2000 Series device types available and each can be configured with different
wireless and I/O options. See part number list below:

Figure 28 - AD2000 Series Part Numbers

For the UHF and VHF radio modem connections (internal or external) there are two channel
bandwidths commonly available, 12.5kHz and 25kHz. Please ensure that the correct type is known
and specified at the time of order to avoid incorrect operation.
For example, an AD2006, using an internal data radio module with digital input terminals capable of
accepting 24VDC control voltages, with only analogue input terminals and powered by a 12VDC
source will have the part number as follows:
AD2006R-LN-12.
An AD2000, using an internal data radio module with digital input terminals capable of accepting
110VAC control voltages, with the analogue output option fitted and powered by a 24VDC source
will have the part number as follows:
AD2000R-HA-24.

© 2007 Miri Technologies All rights reserved. V3.00 3-5


Chapter 4 - MiriMap2000+ Software

Chapter 4 - MiriMap2000+ Software


This chapter describes the detailed software application called MiriMap2000+ which is used to
configure the AD2000 Series devices. At least one copy of this software is required to use the
AD2000 Series devices. The software is a licensed product.

What is MiriMap2000+
This manual is an update to previous documentation on the MiriMap2000+ software application
and refers to features found in Version 3.00 onwards.
It is a software package that contains the application interface for programming the AD2000 Series
devices. One of the main functions of the AD2000 Series devices is to send data from point A to
point B via various communications paths (cable, radio, dialup, satellite, Ethernet, GSM etc.). This
software sets up the communications ports, defines the memory variables, determines the method
of transmission and the conditions that will allow this to occur (i.e. polled, periodic or on event). The
software also transfers the configured parameters, the necessary operating code and
communication protocol drivers into the AD2000 Series device via the programming port. The
added functionality of a Ladder Logic programming interface for writing PLC type logic functions
has also been introduced into the MiriMap2000+ version of software. There is the added capability
to set the AD2000 Series devices up as data-logger units and a separate logger configuration
interface has been included.
The MiriMap2000+ software package runs on Microsoft© Windows NT Version 4/2000/XP based
PCs and above and it uses a graphical interface to make the configuration process easier and
more intuitive (best viewed at a screen area of 1024 x 768 pixels). MiriMap2000+ Version 3.00 and
above no longer supports Windows 95/98/ME due to Microsoft© itself no longer supporting these
products.
The software package does not allow configuration of the interconnected devices supplied by third
parties such as PLCs. These must use the programming packages supplied by the manufacturer.

© 2007 Miri Technologies All rights reserved. V3.00 4-1


Chapter 4 - MiriMap2000+ Software

Installation
The software is installed from a single installation file of the format:
MiriMap_CDSetup_VerXYY_SPZ.exe where:
‰ X is the major revision number.
‰ YY the minor revision number (e.g. 01, 02 etc.).
‰ Z the service pack number if required.
Once this is obtained it should be saved to a suitable folder on the installation PC (e.g. C:\Temp). It
should also be backed-up onto another storage device for safe keeping.
From the local drive (e.g. C:\Temp), locate the file and Run (select the file and double-click) to get
the following screen and prompt.

If installed from a CD the file can be selected from a link on the first page of the browser page
that prompts on start-up.
‰ Step 1 - The first step in the installation process is the welcome screen.

Select Next if the installation is to continue. Cancel to abort the installation.


‰ Step 2 - Scroll through and read the notes first to ensure that the licensing process is
understood.

© 2007 Miri Technologies All rights reserved. V3.00 4-2


Chapter 4 - MiriMap2000+ Software

‰ Step 3 - Enter the full name and full company name of the registered user.

‰ Step 4 - If this is a new installation press Next and install to the default folder:
C:\Program Files\Miri Map2000+Ver3
N.B. If the installation is an update to an existing installation please read the notes after this
diagram.

© 2007 Miri Technologies All rights reserved. V3.00 4-3


Chapter 4 - MiriMap2000+ Software

A single PC can have several different installations of MiriMap2000+ versions installed.


Each version must be installed into a separately named folder. By default the installation program
will install to C:\Program Files\Miri Map2000+Ver3 over-writing any currently installed files.
To install to a different folder, at the Select Destination Directory stage of the installation select
Browse and either point the installation to the folder required or type it in directly. An example of
this screen and process is shown below:

If the folder already exists there will be a warning prompt as shown below:

Accept this by pressing Yes or press No and rename the folder.


‰ Step 5 - Press Next

© 2007 Miri Technologies All rights reserved. V3.00 4-4


Chapter 4 - MiriMap2000+ Software

‰ Step 6 - The installation can backup any existing files if required.


If the backup option is selected there is an option to choose the backup folder.

Press Browse and type in the required folder or choose Next to accept the default which is the
folder named Backup, a sub-folder to the one being installed to.
‰ Step 7 - This completes all the set-up components of the installation and the installation can
proceed.

© 2007 Miri Technologies All rights reserved. V3.00 4-5


Chapter 4 - MiriMap2000+ Software

Press Next and the installation for the files proceeds. Once the MiriMap2000+ files have been
installed another prompt appears to install the utility used to configure the AD2006 Ethernet ports.
You must install this, even if the hardware you are using is not an AD2006 device.

Press OK.
If this is a new installation an option to define the folder the files will be installed into is presented -
choose the default folder:
C:\Program Files\Lantronix\DeviceInstaller\
If this is an upgrade or the utility has been installed before an option to repair appears.

© 2007 Miri Technologies All rights reserved. V3.00 4-6


Chapter 4 - MiriMap2000+ Software

Do not remove, press install or repair options and then Finish.


‰ Step 8 - The utility files are installed.

Press Close
‰ Step 9 - The final stages of the MiriMap2000+ installation follow. Scroll through and read
and verify that the licensing process is understood. Press Next.
‰ Step 10 - The installation is complete.

‰ Step 11 - Press Finish. To run the program, Select Start - All Programs - MiriMap2000+
and choose the installed version you wish to run.

© 2007 Miri Technologies All rights reserved. V3.00 4-7


Chapter 4 - MiriMap2000+ Software

‰ Step 12 - A Windows shortcut can be placed onto the desktop if required. Right click at the
installed version to run via a short cut and press Send To - Desktop (create shortcut)

© 2007 Miri Technologies All rights reserved. V3.00 4-8


Chapter 4 - MiriMap2000+ Software

Running the Software


To run the program, Select Start - All Programs - MiriMap2000+ and choose the installed version
you wish to run.

The software will run for the first time and display the welcome screen as shown.

This is used to allow quick access to the default folder where the project files saved previously are
located. If the installation is new, the default folder is defined by Windows to be My Documents
and will be empty. It is recommended to change this to the projects folder for the installation being
used, e.g.
C:\Program Files\Miri Map2000+Ver3\Projects and this can be done when saving the first file.

Multiple installations of MiriMap2000+ can be maintained on the same PC if each is installed


into a separate folder. A separate icon for each will be available at Start - All Programs - MiriMap
2000+. However, should a unique desktop icon be required the user must create this manually.
See the section on creating a desktop icon for further details.
Each installation will save the files created in MiriMap2000+ to the last folder used. This is stored in
the Windows Registry so that it is remembered next time MiriMap2000+ is used. If multiple
installations are used, ensure that the Save As file save option is used and that the correct folder is
chosen, or use a common folder but name the files in such a way that their version can be
recognised prior to open.

MiriMap2000+ configuration files can be “up-graded” from previous MiriMap2000+


versions to the current version. They cannot be “down-graded” from a current version to a
previous version. Take care in opening files previously saved in an older version (e.g. Ver
2.12) then saving them to project folders for a more recent version. If they are required for
use in the previous version do not save with the same name. It is recommended that a
naming convention (e.g. Filename_DDMMYY11207) and use the Save As save option to
avoid this.
Press the Cancel or Manual Setup button to get to the main screen as illustrated in the following
diagram.

© 2007 Miri Technologies All rights reserved. V3.00 4-9


Chapter 4 - MiriMap2000+ Software

Figure 29 - Full screen view of MiriMap2000+


The screen is divided into areas described in detail in the following sections.

Main Menu-Options
The main menu lists the options available:

These menu options are described in detail in the following paragraphs.

File
Several common file operations are available from this main menu option and are detailed in the
following sections.

© 2007 Miri Technologies All rights reserved. V3.00 4-10


Chapter 4 - MiriMap2000+ Software

New

This option opens the Welcome screen allowing a new project to be created. Select Manual Setup.
This option also allows an existing project file to be opened via the Open Existing button.

Open

Opens the familiar Windows file open screen. Browse to locate the required file.

Save and Save As

Opens the familiar Windows file open screen. Browse to locate the required folder.

Take note of the issues associated with opening and saving older versions of MiriMap2000+
project files with the newer versions of MiriMap2000+.

Upgrade

This is a utility to upgrade the AD2000 Series device firmware for releases of MiriMap2000+
versions prior to 2.10. These units cannot be upgraded directly from Version 3.00 due to significant
differences in the versions. To proceed with this upgrade it is essential that Ver 1.07 of
MiriMap2000 is used first to download the firmware file m2v02_03.bin to the AD2000 unit.
Attempting to upgrade directly to version 3.00 will only result in communication timeouts whilst
trying. Refer to the section on upgrading AD2000s for further details.
This option is only for older versions of the AD2000. Any AD2006 or AD2000 that has been
programmed with Version 2.10 of MiriMap2000+ or later will be upgraded automatically when the
firmware is different from the MiriMap2000+ application version.

Print Setup

This option opens the familiar Windows printer setup screen. Browse to locate the required printer.

Print Reports

The configuration data used in MiriMap2000+ can be printed. Due to the large amount of data that
can be printed, this menu option opens a screen to allow the various printed items to be defined.

If the default options are selected take note of the warning screen as shown in the following
diagram:

© 2007 Miri Technologies All rights reserved. V3.00 4-11


Chapter 4 - MiriMap2000+ Software

Instead, select a single station and then choose the specific reports required.

If Adobe Acrobat is installed, then printing to PDF allows previewing of the printed reports prior to
printing to paper.

1, 2, 3 etc.

This option lists the last files opened and provides a shortcut to re-opening them.

Exit

Selecting this will exit the MiriMap2000+ application and close the current project file, if it has not
changed since the last save.

Edit
Several editing options are available for various elements of the project map and are detailed in the
following paragraphs.

© 2007 Miri Technologies All rights reserved. V3.00 4-12


Chapter 4 - MiriMap2000+ Software

Undo

For any supported edit functions (the option will be solid black, not greyed out), pressing Ctrl+Z will
undo the previous ten actions.

Redo

For any supported edit functions (the option will be solid black, not greyed out), pressing Ctrl+Y will
redo the previous ten undone actions.

Cut

For any supported edit functions (the option will be solid black, not greyed out), pressing Ctrl+X will
delete the selected item.

Copy

For any supported edit functions (the option will be solid black, not greyed out), pressing Ctrl+C will
copy the selected item.

Paste

For any supported edit functions (the option will be solid black, not greyed out), pressing Ctrl+V will
paste the previously copied item.

Delete

For any supported edit functions (the option will be solid black, not greyed out), pressing Ctrl+Del
will delete the selected item.

Export Ladder to Disk

In the Ladder Logic screens, after selecting one or more rungs of ladder logic, selecting this option
will allow the logic structure and variables to be exported to a file. The file format for this exported
ladder is .mml.

Import Ladder from Disk

In the Ladder Logic screens, previously exported rungs of ladder logic, saved in export file format
.mml will allow the logic structure and variables to be imported to an open ladder logic page.

On import the variable assignments and descriptions from the imported file may differ
from the currently opened ladder logic page. Three options exist as shown below:

‰ Selecting Leave Current Variables will leave any variable defined in the current map
unchanged. Since the imported ladder may have had different nicknames and descriptions,
this may result in confusing labels to proceed with caution.
‰ Selecting Merge with station variables taking precedent will only add new variables and
will not overwrite variables that exist with the imported variables.

© 2007 Miri Technologies All rights reserved. V3.00 4-13


Chapter 4 - MiriMap2000+ Software

‰ Selecting Merge with import variables taking precedent will only add new variables and
will also overwrite variables that exist with the imported variables.

Example Ladder logic for the various function blocks can be imported quickly from the
Examples folder. When doing this use the third import option, Merge with import variables taking
precedent. The variables used in these example ladder logic rungs are in the range above
%MW50000. Please note that importing this ladder can overwrite existing memory variables in your
project if your project already has variables defined in the range above %MW50000. The memory
addressing of the imported logic should be adjusted to suit your application.

Import Variables

This applies to the selected station only. After selecting the Import Variables option a file open
dialogue box will appear. Locate the desired file to import and select. The file is of the type .CSV
(Comma Separated Variable). There are three options available on importing as shown below:

‰ Selecting Delete all variables in station will erase all variables and overwrite with the
imported variables.
‰ Selecting Merge with station variables taking precedent will only add new variables and
will not overwrite variables that exist with the imported variables.
‰ Selecting Merge with import variables taking precedent will only add new variables and
will also overwrite variables that exist with the imported variables.

Export Variables

This applies to the selected station only. Once selected, choosing the Export Variables option will
open a Save As dialogue box to export the variable details for that station to a Comma Separated
Variable (CSV) file. This form of file can be used with many editors and programs such as Excel to
modify the variables individually. For instance, the variables may be re-named to more meaningful
descriptions such as Pump KW, Dam Height etc. The modifications can be saved and added to the
chosen station via the Import Variables edit menu option.
The warning message shown below will be displayed and the guidelines indicated should be
adhered to strictly in order to avoid corrupting the map.

© 2007 Miri Technologies All rights reserved. V3.00 4-14


Chapter 4 - MiriMap2000+ Software

It is best to export an existing variable list and modify it only rather than trying to create a new list
from scratch. Appending to the variable list is the only way to add new variables. Do not insert
new variables.

PLC Ladder logic

Selecting this option will open the Ladder logic page for the selected station. For further details see
the chapter in this manual on Ladder Logic Functions.

Data-Logging

Selecting this option will open the Data-logging page for the selected station. For further details see
the chapter in this manual on Data-logging Functions.

Scheduler

Selecting this option will open the Scheduler utility used in association with data-logging for the
selected station. For further details see the chapter in this manual on the Scheduler utility.

Find Var

When within the Ladder Logic interface, selecting this option CTRL+F (i.e. press the Ctrl key and
the F key at the same time) will open the Find dialogue box to locate Ladder logic variables

To search for bit variables only, check the Search Bits option. To search by nickname, check the
Nicknames option, otherwise memory addressing will be used. If multiple Ladder logic pages are in
use, check the Global Search option to search all defined pages.

Find Next

When within the Ladder Logic interface, if the variable is used in several places, pressing this
option (or F3) will search through each instance of the variable in use in the Ladder logic after the
initial search has been started.

Replace Var

When within the Ladder Logic interface the Ctrl+H keystroke combination (i.e. press the Ctrl key
and the H key at the same time) allows the user to find and replace a variable that matches the
criteria specified. The search criteria form for the Find & Replace is illustrated below:

© 2007 Miri Technologies All rights reserved. V3.00 4-15


Chapter 4 - MiriMap2000+ Software

The variable to be found is selected from the Find What drop down box and the replacement
variable is selected from the Replace With drop down box. The optional search parameters are
available to search through all rungs or only between certain rung numbers. If the Replace All
checkbox is ticked then all occurrences of the variable within the search parameters will be
replaced. If the Replace All checkbox is not ticked then all occurrences of the variable within the
search parameters will be replaced one by one with a user confirmation being displayed each time.
The choice to search for variables by nickname or physical memory location is available. To use
nicknames, ensure that the nicknames checkbox is ticked.
Select the Bit only option to restrict the search to bit variables.

Project
Several project-wide options can be set as detailed in the following paragraphs.

New

This option will open the Main Menu Welcome screen to allow a new project to be created via the
select the Manual Setup button. An existing project can also be opened via the Open Existing
button. In MiriMap2000+, an entire project is saved in a single project file, there are no other files
created and thus this file should be saved carefully.

Com Setup

This menu option will open the Communication Properties menu.

Using the Comms Port Wizard will simplify the connection processes described in the following
paragraphs.
Ethernet

Check this box and specify the IP address of the remote AD2000 Series device that will be
connected to. Specify the correct port number and whether the units are using UDP or TCP
framing. This option is also used for GPRS IP addressing when the Modem Type is set to any of
the GPRS options.

© 2007 Miri Technologies All rights reserved. V3.00 4-16


Chapter 4 - MiriMap2000+ Software

Serial Port - Com Port

This is the COM port number assigned by Windows and can be any number from 1-255. Typically
on-board RS232 ports start at COM1, COM2 is also reserved for the same then other devices such
as USB to RS232 converters will be assigned from COM3 onwards. Be sure to verify the port
selected is the correct one to be used by MiriMap2000+ and is not being used by other
applications. Verification is made via Windows Control Panel - System - Hardware - Device
Manager under the folder Ports (Com & LPT).
Open Control Panel and find the System icon.

This opens the System Properties screen. Select the Hardware tab and press Device Manager
button:

Scroll down to find the Ports (Com & LPT) folder and open to view the installed ports.

© 2007 Miri Technologies All rights reserved. V3.00 4-17


Chapter 4 - MiriMap2000+ Software

Serial Port - Modem Type

By default this is set to No Modem and is used for the majority of serial connections, e.g. RS232
and USB 2.0. MiriMap2000+ can connect to remote AD2000 Series devices using a variety of
modems (e.g. Dialup, GSM and GPRS). Choose the correct modem from the Modem Type list.

MiriMap2000+ does not use any of the Windows modems settings to make a link to the
modem types supported in the Modem Type list. Do not attempt to use Control Panel -
Phone and Modems Options.

Once a modem has been selected and used, on returning to use RS232 connections
the No Modem type must be re-selected.
Serial Port – Baud Rate, Parity, Stop, Data Bits and Flow Control

Always use the following settings.


38400, None,1 Stop bit, 8 Data Bits, Hardware (RTS/CTS).
Modem Timeout

This is an inactivity timeout period. If no data communications occurs in this period MiriMap2000+
will disconnect the link. A default period of 30 seconds is used to allow users to change between
different online functions (e.g. Watcher, Data-log read) before disconnection occurs.
Modem Connect Time

This is the time period MiriMap2000+ waits to get a CONNECT with the remote device. The default
setting is 60 seconds. Once this expires a retry is attempted up to the maximum of times set in the
Retries field.
Port Timeout

This is the time period MiriMap2000+ waits once connected, for a response to a command sent to
the remote device. The default period is 10 seconds.
Retries

The number of retries attempted after timeout occurs.


TX Delay after RTS

This is for RS485 connections when connecting via an RS232 to RS485 device to allow an RS485
turn-around time. The default period is 5 seconds.

© 2007 Miri Technologies All rights reserved. V3.00 4-18


Chapter 4 - MiriMap2000+ Software

Properties

Enter a meaningful name for the project or accept the default name.
The project properties dialogue box allows entry of any text in this area to describe the project or to
use as a scratchpad for revision notes. The data entry screen will scroll down as the text fills.
The project version number will increment every time the project files is saved. This will wrap
around at 99. The number can be reset manually if this auto-increment is not required. Simply
highlight the number and type the required number in.
For data-logging systems, the folder that is used to store the log files is typically stored in a folder
with the same name as the project file. This means if the filename is changed the data-log files are
stored into a new folder of the same name as the filename. To fix this folder to a single data-log
storage folder check the Use Fixed Log Directory and define the folder as required.

Options

This option screen is used to allow various parameters to be used within the project.
Automatically Clean Ladder Logic On Compile

This will tidy up any missing ladder logic columns or lines when the project is compiled. Default is
ON.
Auto - Archive datalog data

The auto archive entry is used to specify the number of entries in the log file, before it archives the
data.

© 2007 Miri Technologies All rights reserved. V3.00 4-19


Chapter 4 - MiriMap2000+ Software

For example, if 15,000 items are read from the logger, and this parameter has been set to 10,000,
then it will archive the first 10,000 entries into an archive file and the current data-log file will have
5000 entries in it. By clicking the Load Archive button in the All Data-log screen, you can load
previously archived logs. See the chapter on data-logging functions for detailed information. Default
is 10000.
Ignore Driver version in Download

Setting this option ON will give the option not to process the automatic firmware verification. This
should only be used in extreme conditions if requested by Miri Technologies support. Default is
OFF.

Select to continue, no to abort. Continuing means there is no check for firmware differences and
following warning prompts for a choice of which files to send. Yes will send the firmware files
anyway (but not check for differences), No sends only the configuration changes to Ladder Logic
and other device parameters.

Prompt Stop Polling (Off is no Stop Poll)

As of Version 3.00 for MiriMap2000+ there is no prompt displayed to stop polling when accessing a
remote via the network, as required in previous versions. There is a new mechanism in Version
3.00 that interposes online monitoring (i.e. Watcher and Ladder Logic monitoring) packets with
polled parcels. In fast data network links this will work with minimal effect on the system polling
parcels. However, on slower 2400 baud systems this may slow down the network polling. This is
especially significant when doing remote firmware updates or reading lots of data-log data. It may
be desirable to stop polling and setting the ON will allow the prompt to appear to allow user choice.
Default is OFF.
Display Com Port Wizard

As of Version 3.00 for MiriMap2000+ there is no need to determine the COM port settings that
have been assigned to USB2.0 RS232 converters and which IP address to connect through when
using Ethernet. Ensuring that this Wizard option is selected will prompt the user to choose the
various ports that are available from a pop-up menu. Default is ON.
On accessing any communications functions a screen will appear similar to the ones shown below.
Select the correct communications port prior to connecting to the AD2000 Series device.

© 2007 Miri Technologies All rights reserved. V3.00 4-20


Chapter 4 - MiriMap2000+ Software

For RS232 and USB ports these will be the installed COM ports already defined in Windows.

The COM port must be installed and defined under Windows prior to opening the wizard for it
to be listed. See the section in the Project - Com Setup menu option for Serial Port - Com Port
setup details within Windows.
For IP addressed devices the Wizard will list the IP address of the currently selected station with a
history list of previously selected stations.

If these numbers do not match the required setting, they can be manually updated and will be
available next time.
Prior to pressing the OK button, verify that the IP address and port number is correct for the remote
device otherwise timeouts will occur.
Retain the checked Display Next Time option to allow the Com Port Wizard to operate on the next
connection. If the check is removed, the Com Port Wizard can be re-enabled by selecting the
Project - Options - Display Com Port Wizard option.

Wrap Ladder logic

Check this option to ensure the ladder Logic screens are displayed with a fixed width for ease of
viewing. Long ladder rungs will auto-wrap with the symbol below:

Maximum Number of Backups

Every time the project file is saved, a backup copy of the previously saved version of the project file
is made with the same name and the subscript _BAKXX. The number XX will increment by one to
the maximum value entered in this field.
Device Installer Dir

The XPort Ethernet device on the AD2006 uses a Device Installer to enable configuration and
firmware upgrading. This lists the folder the software utility is installed in. See the section on
programming the AD2006 Ethernet port for details on using this utility.

© 2007 Miri Technologies All rights reserved. V3.00 4-21


Chapter 4 - MiriMap2000+ Software

Password

The MiriMap200+ project can be password protected to limit usage.

The passwords are case sensitive and must be recorded in a safe place.
The passwords are only set when the file is saved. To change them, Full Access must be available,
after which, the passwords can be deleted or adjusted. If the passwords are lost the project file
must be sent to Miri Support support@miri.com.au for recovery.
Full Access - Only allows read/write access to fully adjust the project.
Read Var Access - Only allows the user to open the MiriMap2000+ file and to go online to view
real-time Watcher charts and Ladder Logic and to upload data-log records. Changes can be made
but cannot be compiled or saved.
View Only Access - Only allows the user to open the MiriMap2000+ file but there is no access to
online facilities to view real-time Watcher charts and Ladder Logic or to upload data-log records.
Changes can be made but cannot be compiled or saved.

Display
Several display options can be set as detailed in the following paragraphs.

View - Status Bar

The status bar located on the bottom section of the main MiriMap2000+ screen can be toggled on
or off. The default is ON.

View - Project List

The Project List can be turned off to allow more screen area for Ladder logic. It can also be turned

on or off via the toolbar option icon . The default is ON.

© 2007 Miri Technologies All rights reserved. V3.00 4-22


Chapter 4 - MiriMap2000+ Software

See the section on The Project List Window for further details.

Links - Physical, Parcel

On the main MiriMap2000+ screen, solid black lines are displayed that indicate physical links
between different stations. Dotted lines indicate parcel links, i.e. the data links between two
stations. These are used in the compile process to determine if parcels are correctly linked and for
routing of data via different ports. There must be a physical link between two stations to ensure
data parcels to be processed. To aid viewing in complex maps, these physical link lines can be
turned on or off via this option. The default is ON.

The solid line indicates a physical link.


The dotted line indicates a parcel (i.e. data) link.
The purpose of this is best illustrated when using store and forward techniques. The dotted lines
clearly show that the parcels are sent between two stations but the physical path is an indirect one.

The routing of data is handled by the compiler so the user need only enter the desired parcel
source and destination details as normal.

© 2007 Miri Technologies All rights reserved. V3.00 4-23


Chapter 4 - MiriMap2000+ Software

Zoom In/Out/To Fit

The main screen display can be viewed at different resolutions to make visibility easier. Zoom in or
out options are available and a zoom to fit option will adjust the station icons to the size to fill the

current screen area. The zoom in or out options are also available via the toolbar icons.

Using a higher graphics option for the PC display screen will also give a greater area for
displaying maps with a large number of stations. Typically a screen size of 1024 x 768 pixels will
allow most medium sized maps to be viewed easily without scrolling.

Grid

This option allows the main screen display to use a grid or not. Selecting this option allows
adjustment of the grid spacing, to set on or off the grid display and to set whether the station icons
snap to the grid.

Memory Allocation

A memory allocation table for each station can be viewed via the main menu option Display -
Memory Allocation. Every variable declared in the AD2000 Series device is displayed with the
nickname and physical address and an indication of whether the variable has been written to by
either a parcel or Ladder Logic function. This facility is available only for AD2000 Series devices
not PLC Type stations.
The memory allocation table can also be displayed from the Element Browser form by pressing the
Memory Allocation button.
A new station will have the basic fixed variables already declared and an example of this is shown
below:

© 2007 Miri Technologies All rights reserved. V3.00 4-24


Chapter 4 - MiriMap2000+ Software

The Name and Address columns can be sorted as alpha numeric ascending or descending by
selecting the desired column with the mouse. The sort type is indicated in the top right-hand corner
of each column by an up (alpha numeric ascending) or down (alpha numeric descending) arrow.
As variables are used in parcels and Ladder Logic a cross is marked in each bit for each variable
used. If an entire word is used, the cross will be in every bit field.
Where variables that occupy 32 bits are declared, the memory allocation will display the name
twice and indicate the memory location across two 16 bit %MW words in physical memory. This is
illustrated in the following diagram:

Where more than one variable has been declared across the same physical address, the fields are
displayed in red.

When this is attempted a warning is given at the variable declaration stage and the user should
carefully consider the impact of such an action.
By selecting the red highlighted rows with the mouse and double clicking, a dialogue box is
displayed showing the declared variables at the same physical address. In this event the effects of
such a double allocation should be investigated.

© 2007 Miri Technologies All rights reserved. V3.00 4-25


Chapter 4 - MiriMap2000+ Software

As a design tip, it is advisable to declare different memory type (word, long etc.) in separate blocks
to avoid this double allocation. The variable declaration process will limit this from happening but in
some situations the double declaration process may be desirable (e.g. where memory variables are
set to emulate a PLC slave mode driver).
The Export button will allow the memory allocation list to be exported to a .CSV (Comma
Separated Variable) file for use in other programs.
The memory allocation is also available as a printed report in the Print Reports menu option.

Ladder XReference

This option is only available when the Ladder Logic screen for a station is open. Selecting the
option will display the cross reference of Ladder Logic elements to aid in debugging the logic.

The Export button will allow the Ladder Cross reference list to be exported to a .CSV (Comma
Separated Variable) file for use in other programs.
The Ladder Cross reference list is also available as a printed report in the Print Reports menu
option.

Communication Diagnostics

This is a debugging option available for Port 1 on the AD2000 Series devices only which when on
will reflect the data packets being transferred via that port. This is useful for GPRS based systems.

PLC
The PLC menu options are only available when operating within the Ladder Logic screens. These

are enabled by selecting the required station icon and pressing the Ladder Logic icon , or
pressing Ctrl+D, or clicking the right hand mouse button and selecting the menu option PLC Ladder
Logic.
Ladder logic is available in the station icon for an AD2000 Series device when the station icon has
an L in the bottom right hand corner as shown:

The options available are as follows:

© 2007 Miri Technologies All rights reserved. V3.00 4-26


Chapter 4 - MiriMap2000+ Software

These options also have direct keyboard options which can be easier to use. Where available
they are listed on the right hand side of the menu item.

Insert

This is only available in Edit mode. A prompt to enable this Edit mode will appear if the function is
called and the project is not in Ladder logic edit mode.

The option allows one or several rungs of logic or a row or a column to be inserted before or after
the current cursor position. This is the method used to add logic to the Ladder Logic screens.
Keyboard equivalent is INS.

Delete

This will delete any selected row (rung) of ladder logic. Keyboard equivalent is DEL.

Delete Column

This will delete any selected column (a single rung item) of ladder logic. Keyboard equivalent is
CTRL+U.

Edit Mode

All changes to the ladder logic code structure have to be performed in Edit mode. Select this option
to enable/disable this mode. Keyboard equivalent is CTRL+E.

© 2007 Miri Technologies All rights reserved. V3.00 4-27


Chapter 4 - MiriMap2000+ Software

Edit Cell

Each cell in a Ladder logic rung can be selected and edited to assign variables to the cell function.
Selecting with the mouse and double clicking does the same as using this menu item.

Rung Description

Every rung can have a text description added to it. Select this option to open the rung description
edit screen.

Keyboard equivalent is CTRL+K.


Once this screen is open, other rung descriptions can be selected and edited via the Previous and
Next buttons removing the need to close the screen to get to another rung description.

Jump To Rung

To quickly jump to another rung number select this option. If rung labels have been added this
option allows quick jumps to those labelled rungs to be made.

Keyboard equivalent is CTRL+J.

Label Rung

It can be useful to label certain rungs to aid navigation.

Keyboard equivalent is CTRL+L.

Add Ladder Page

Ladder logic can be divided into several pages, or sub-routines. This allows long and complex logic
to be read easier and written according to operation. Select this menu option from within an
existing Ladder logic page and create with a unique name.

© 2007 Miri Technologies All rights reserved. V3.00 4-28


Chapter 4 - MiriMap2000+ Software

Delete Ladder Page

To delete a previously assigned ladder logic page select this option from within the Ladder logic
page you wish to delete. The ladder logic page must be empty of any logic that is assigned to
parcels first.

Contacts

The digital input elements of any Ladder logic rung consist of contacts. These are added via the
Contacts menu option or by using the Ladder Toolbar option .

A complete list if the contacts and their function is available in the Ladder Logic section of the
manual.

Coils

The digital output elements of any Ladder logic rung consist of coils. These are added via the Coils
menu option or by using the Ladder Toolbar option as follows:

A complete list if the coils and their function is available in the Ladder Logic section of the manual.

Function Block

The control elements of any Ladder logic rung consist of Function Blocks. These are added via the
Function Block menu option or by using the Ladder Toolbar option.

© 2007 Miri Technologies All rights reserved. V3.00 4-29


Chapter 4 - MiriMap2000+ Software

A complete list if the Function Blocks and their function is available in the Ladder Logic section of
the manual.

Insert Wire

In order to create rung branches to create AND and OR conditions, wires are inserted. These are
added via the Insert Wires menu option

or by using the Ladder Toolbar option.

A complete list if the Function Blocks and their function is available in the Ladder Logic section of
the manual.

Delete Wire

In order to delete rung branches using AND and OR conditions, vertical and horizontal wires may
need to be deleted. These are deleted via the Delete Wires menu option

or by using the Ladder Toolbar option.

© 2007 Miri Technologies All rights reserved. V3.00 4-30


Chapter 4 - MiriMap2000+ Software

A complete list if the Function Blocks and their function is available in the Ladder Logic section of
the manual.

PLC Online

Select this option to go online and view ladder logic real time status. This is equivalent to selecting
the icon . The keyboard equivalent is CTRL+F5.

Watcher
Watcher charts view the current memory variables “online” by using one of the communications
links on the AD2000 Series devices via a PC communications port.

Online Data

Select this menu option to display a blank Watcher chart or select the using the General Toolbar
watcher option. . This will open a blank Watcher screen as below:

The Watcher screen gives the user a facility to directly monitor the internal variables to determine
their current status via a watch table.

Before trying to go online with a Watcher table, ensure that the correct programming
cable is attached and configured correctly to the correct COM port on the PC used. Check
this via the main menu option Project - Com Setup. The AD2000 port MUST have the
Miri2000 protocol defined. The PC port parameters should be: Baud rate - 38.4k, Parity -
None, Stop bits - 1, Data bits - 8.

© 2007 Miri Technologies All rights reserved. V3.00 4-31


Chapter 4 - MiriMap2000+ Software

To ensure the list of all available COM ports and Ethernet ports available on the PC being
used, ensure that the Com Port Wizard option is enabled.
The connected station ID can be verified by selecting the Connected To button which is on the left
hand side of the Watcher screen. This will send an ID request to the locally connected AD2000
Series device and display the response.
‰ First ensure that the station to be monitored is chosen. This can be achieved in two different
ways. Select the Station icon in the map page on the screen first then open the watcher.
Otherwise, select it in the menu option on the Watcher screen top left-hand corner (next to
the word Watcher) and choose the required station from the drop down box.
‰ Next select the memory variable that is required for monitoring. This can be done by
selecting the drop down box of the Nickname column to select by an assigned nickname or
the Memory column to select by the physical memory address (i.e. the %MW or %ML
address).

To select the next memory location in sequence (e.g. %MW2 having selected %MW1), press
the keyboard function F9. Repeat this until the desired range of memory addresses is displayed.
Note that the more variables selected the slower the update time so it is better to have multiple
watch charts with smaller ranges than one large chart.
‰ Size the chart to full screen if required.
‰ When the button displays ONLINE, it indicates that the Watcher chart will attempt to go
online when pressed.
‰ When the button displays OFFLINE, it indicates that the Watcher chart will attempt to go
offline when pressed.
‰ Diagnostic words are displayed in square brackets [ ] to aid searching.
‰ Internal bits are displayed in traditional brackets { } to aid searching.
An example Watch chart displaying the analogue I/O variables is displayed to illustrate the chart
layout and options.

Watch

Select the correct station to view the online status from.

© 2007 Miri Technologies All rights reserved. V3.00 4-32


Chapter 4 - MiriMap2000+ Software

Chart

Select this button to display a real-time chart for the first 8 values in the Watcher chart. This can
be useful for commissioning or where graphical representation of the data is required. This is a
utility tool only and does not replace the full functionality of SCADA or HMI charting tools.

Structure the watcher table to position the values required for viewing as the first 8 entries. The
Watcher chart can still hold more than 8 values but they will only be available for online viewing via
the table format.
Analogue Screen Update (secs)

Slide the bar across to adjust the update time. This applies simple time filtering to the updating of
variables onto the watch chart screen, it does not adjust the update period on the hardware.
Connected To

Select this button to send a Get ID request to the connected AD2000 Series device. This will
confirm the station ID and type.

For convenience, this function can also be run from the main map window by selecting an
AD2000 type icon and right clicking the mouse and selecting the Connected To option.
Online/Offline

When this button displays ONLINE, it indicates that the Watcher chart will attempt to go online
when pressed.
When the button displays OFFLINE, it indicates that the Watcher chart will attempt to go offline
when pressed.
Single/All

These two buttons are associated with the writing of data values to the online device. The watcher
must be online prior to this option be performed.
Enter a value in the New Data column on the right hand side of the Watcher chart. If a single
variable is entered, ensure that the row is highlighted the press the Single button to write this entry
to the connected device.
If multiple data entries are required to update several variables, enter the required values in the
New Data column on the right hand side of the Watcher chart, then press the All button to write
these entries to the connected device.

© 2007 Miri Technologies All rights reserved. V3.00 4-33


Chapter 4 - MiriMap2000+ Software

Ensure that the variables that are being written to via the watcher are able to accept the data. If
there are parcels or ladder logic rungs that write to the same variable, the watcher update will be
immediately over-written. It will appear that the update did not work. Inspect the parcels screens
and perform a Find function on the ladder logic to find such issues.
LSB Left

Check this option to view the online data in reverse bit order (i.e. bit 16 is LSB). Without the bit
checked, the bit order is bit 1 is LSB). For further details on the bit order representation refer to the
glossary item on bits, bytes, words etc.
Save Table

This option allows a Watcher table that has been built to be saved and used later. Create the
required table, select the Save button and enter a unique name for the table. On pressing OK, the
table is saved to the map file. Saved Watcher tables can be opened via the Project List window.
Load/Save Values

These options allow a set of pre-defined watcher write values to be saved or loaded. If a set
variables are to be saved whilst monitoring a device, select the Save Values button and the data
will be saved to disk in the form of a CSV file. To laod a previously set of pre-defined watcher write
values select the Load Values button and the data will be read from disk in the form of a CSV file.
Packet/Retry Count

These are display only variables to indicate that the watcher is online and operating correctly. The
packet count will increment every time a data packet is received. The retry count will increment
every time a retry is required after a non-reply from a remote device to a watcher request.

Link/Poll Bits

Link Healthy bits are internal memory variables in the AD2000 Series devices that indicate if the
port communications are functioning when the port is in polling mode (continuous or periodic).
There is a group of 128 x 16 bit word blocks per port, each bit within these words representing the
station identifier numbers 1-2048.
The following table illustrates the block numbers used for the link healthy and poll select bits.
Table 17 - Link Healthy and Poll Select Block Numbers
Block Stn # Stn # Block Stn # Stn # Block Stn # Stn #
1 1 To 16 47 737 To 752 93 1473 To 1488
2 17 To 32 48 753 To 768 94 1489 To 1504
3 33 To 48 49 769 To 784 95 1505 To 1520
4 49 To 64 50 785 To 800 86 1361 To 1376
5 65 To 80 51 801 To 816 87 1377 To 1392
6 81 To 96 52 817 To 832 88 1393 To 1408
7 97 To 112 53 833 To 848 89 1409 To 1424
8 113 To 128 54 849 To 864 90 1425 To 1440
9 129 To 144 55 865 To 880 91 1441 To 1456
10 145 To 160 56 881 To 896 92 1457 To 1472
11 161 To 176 57 897 To 912 93 1473 To 1488
12 177 To 192 58 913 To 928 94 1489 To 1504
13 193 To 208 59 929 To 944 95 1505 To 1520
14 209 To 224 60 945 To 960 96 1521 To 1536
15 225 To 240 61 961 To 976 97 1537 To 1552
16 241 To 256 62 977 To 992 98 1553 To 1568
17 257 To 272 63 993 To 1008 99 1569 To 1584
18 273 To 288 64 1009 To 1024 100 1585 To 1600

© 2007 Miri Technologies All rights reserved. V3.00 4-34


Chapter 4 - MiriMap2000+ Software

Block Stn # Stn # Block Stn # Stn # Block Stn # Stn #


19 289 To 304 65 1025 To 1040 101 1601 To 1616
20 305 To 320 66 1041 To 1056 102 1617 To 1632
21 321 To 336 67 1057 To 1072 103 1633 To 1648
22 337 To 352 68 1073 To 1088 104 1649 To 1664
23 353 To 368 69 1089 To 1104 105 1665 To 1680
24 369 To 384 70 1105 To 1120 106 1681 To 1696
25 385 To 400 71 1121 To 1136 107 1697 To 1712
26 401 To 416 72 1137 To 1152 108 1713 To 1728
27 417 To 432 73 1153 To 1168 109 1729 To 1744
28 433 To 448 74 1169 To 1184 110 1745 To 1760
29 449 To 464 75 1185 To 1200 111 1761 To 1776
30 465 To 480 76 1201 To 1216 112 1777 To 1792
31 481 To 496 77 1217 To 1232 113 1793 To 1808
32 497 To 512 78 1233 To 1248 114 1809 To 1824
33 513 To 528 79 1249 To 1264 115 1825 To 1840
34 529 To 544 80 1265 To 1280 116 1841 To 1856
35 545 To 560 81 1281 To 1296 117 1857 To 1872
36 561 To 576 82 1297 To 1312 118 1873 To 1888
37 577 To 592 83 1313 To 1328 119 1889 To 1904
38 593 To 608 84 1329 To 1344 120 1905 To 1920
39 609 To 624 85 1345 To 1360 121 1921 To 1936
40 625 To 640 86 1361 To 1376 122 1937 To 1952
41 641 To 656 87 1377 To 1392 123 1953 To 1968
42 657 To 672 88 1393 To 1408 124 1969 To 1984
43 673 To 688 89 1409 To 1424 125 1985 To 2000
44 689 To 704 90 1425 To 1440 126 2001 To 2016
45 705 To 720 91 1441 To 1456 127 2017 To 2032
46 721 To 736 92 1457 To 1472 128 2033 To 2048

Note that the Link Healthy bits are ON to indicate a healthy status and OFF otherwise.
Poll Select bits are internal memory variables in the AD2000 Series devices that indicate if the port
communications are enabled when the port is in polling mode (continuous or periodic). There is a
group of 128 x 16 bit word blocks per port, each bit within these words representing the station
identifier numbers 1-2048.

Note Poll Select bits must be set ON to disable polling and OFF to enable polling (which is the
default state on power up or re-start).
Each block number consists of 16 bits and each bit relates the link healthy bit or the poll select bit
to a Station identifier (between 1 and 2048 - the maximum number of stations available in any one
map). The station identifier is the number set in the Station Properties - General tab. If this number
is changed at any time the appropriate link healthy bit or the poll select bit in any external PLC or
HMI program must be altered to reflect the change.
The internal Link healthy bits and Poll Select bits can be viewed from the dedicated Watcher
screen as shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 4-35


Chapter 4 - MiriMap2000+ Software

Select the appropriate display type from the option drop down box to see the link Healthy bits or the
Poll Select bits and then choose the correct port for the connection. Pressing the Online/Offline
button will toggle the real time update for these points.

In the Poll Select screen there is an option to select a whole row and set all points ON or OFF.
Individual stations can be selected by highlighting the required but and typing in a 1 (one) or a 0
(zero), noting that 1 (one) turns polling OFF to that station ID and 0 (zero) turn ON polling to that
station ID.

The watch charts only allow viewing of these status points when online with
MiriMap2000+. To use the Link Healthy or Poll Select bits in an AD2000 Series device (e.g.
for use in ladder logic or for monitoring via an HMI), the bits required must be mapped
across using parcels.
It is recommended that this be done as the first set of parcels per map.

In the diagram above, the first three link healthy blocks (station IDs 1-48) for port 1 are mapped via
a parcel to a memory variable used to image Modbus Holding Registers that can be read via an
HMI supporting this protocol. The same blocks for poll select bits are written from Modbus Holding
Registers (e.g. an HMI setting to control whether the stations with identifiers 1-48 should be
enabled for polling).

Help
The Help menu allows selection of the online help, licensing and version details.

© 2007 Miri Technologies All rights reserved. V3.00 4-36


Chapter 4 - MiriMap2000+ Software

Help Contents

This menu option will open the online help screen in .CHM format (Compressed HTML). This
version of the help is identical in content to the paper or PDF version.

License Information

This menu option will shown the licensing screen to either enable the software to be licensed or to
view the license details.

Every copy of MiriMap2000+ must be licensed. The license has to be purchased and what is
purchased is a software based code known as an INIT CODE. The software application can be
downloaded from the Miri Technologies website support pages www.miri.com.au/support.htm at
any time for free.
Initially the software will run on any PC, fully functioning for 30 days if no previous version 3.xx
MiriMap2000+ application has been installed on that PC.
To extend this period, the licensed INIT CODE must be purchased. Send the purchase order for
the software to support@miri.com.au along with the two codes, the Site Code and the Machine ID
(MID).

To avoid mistakes in reading similar characters, instead of writing these codes manually simply
select all the characters in each of the two codes with the mouse and press CTRL+C to Copy them
one by one, pressing CTRL+V to paste into an email. Email these two codes to
registration@miri.com.au using the email address of the registered owner of the PC onto which the
software will be installed.
Once all purchasing details have been confirmed, the INIT CODE will be sent to the email address
provided and that email address will serve as the recorded user until otherwise changed. Select the
INIT CODE (CTRL+C to Copy, CTRL+V to paste) and paste into the Init Code option on the
screen. Press OK and the product will be licensed.
The license can be transferred to another PC by selecting the Transfer License option and
following the instructions.
The license can be removed from the PC by selecting the Remove License option and following the
instructions.

The license should be removed in the case you decide to move your license to another
computer. You should also remove your license before you reformat hard drive, flash
motherboard bios, erase all files from disk, install new operating system or before doing
any other operation which can change initial Site code. As soon as you reinstall
MiriMap2000+ send to registration@miri.com.au the new Site/MID code together with valid
Removal code. The new Init code will be isused to you afterwards.

© 2007 Miri Technologies All rights reserved. V3.00 4-37


Chapter 4 - MiriMap2000+ Software

Debug Information

Setting this option will allow a debug utility to run to capture the software application processes.
This will only be required under instruction from Miri Technologies support and thus normally it
should be OFF.

About AD2000 Programming Software

This menu option will open the version details of the installed program.

When referring to technical support it is useful to them to know these version details.

Toolbars
Floating and Docking Toolbars
The toolbars are movable. This allows the user to move them according to viewing requirements.
To move the toolbar, locate the mouse on the toolbar move handles on the left hand edge of the
toolbar. Press the selector mouse button and hold. Drag the mouse with the button pressed to
move the toolbar to the position required then release the mouse button. The toolbars can be
“floating” on the screen or “locked” on the left, right, top or bottom edges of the screen.

Toolbar move handle 1 Toolbar move handle 2


Illustrations of floating and docked toolbars are shown below:

Figure 30 - Example of Floating Toolbar

© 2007 Miri Technologies All rights reserved. V3.00 4-38


Chapter 4 - MiriMap2000+ Software

Figure 31 - Example of Docked Toolbar


The toolbars available are:
Toolbar-General
The following toolbar applies to all general functions of the software:

Toolbar-Ladder
The following toolbar applies to all Ladder Logic functions of the software:

The Project List window


The project list window allows all the stations (and their identifier numbers) in the current project to
be viewed.

© 2007 Miri Technologies All rights reserved. V3.00 4-39


Chapter 4 - MiriMap2000+ Software

By pressing the cross icon on the top right-hand corner of this window it will close leaving more
screen area for the Map window. To re-enable this window, select the View menu option and
ensure that the project list item has a tick against it. The Display Project List Menu button can
also be depressed to restore this window.
For each station several items can be viewed. To open each station select the + menu item open
icon:

.
All stations will have a default icon for Ladder logic as shown:

The number in brackets indicates the number of rungs of ladder logic currently available.
If Watcher charts have been created and saved these will be noted by the Saved Watcher icon:

Select and double click with the mouse to open the Watcher chart, noting that only one Watcher
screen can be open at any one time.
Selecting the Watcher icon and pressing the right hand mouse button will display the following
menu:

To allow saved Watcher screens to be deleted, copied or displayed.

The Network Map window


The network map window is where the graphical display of the system is shown when a project file
is loaded from disk or a new map is created.

© 2007 Miri Technologies All rights reserved. V3.00 4-40


Chapter 4 - MiriMap2000+ Software

The Status bar


The status bar is found on the lower portion of the screen and certain online operations and their
status are displayed here. The PC communications port used, the baud rate settings and the status
are displayed.

© 2007 Miri Technologies All rights reserved. V3.00 4-41


Chapter 4 - MiriMap2000+ Software

Building a System Network “Map”


Every AD2000 Series device requires a software configuration to enable operation. Typically a new
device will be shipped with a default configuration that simply enables the ports to allow connection
via a PC running the MiriMap2000+ software package. No data exchanges will be available and
there will be no Ladder Logic or Data-logging. However, the AD2000 Series device may have been
programmed previously and is being placed into a new system and thus any default settings may
have been changed by a previous configuration. The following steps are required to ensure that the
devices work correctly in the proposed system.
‰ The term “Map” in the context of configuring AD2000 Series devices is defined as “the
software configuration developed with MiriMap2000+ to identify each device in a single
system, determining how they are connected via physical communication ports, and setting
the manner in which data is passed between those ports”.
The simplest method of starting a system is to use one of the template files available in the
installation. These are available in the Examples folder under the MiriMap2000+ installation folder.
This can be accessed from the Welcome screen when opening a new file via the File - New menu
option.

This list will change as example maps are added to the installation. If they are missing please
contact Miri Technologies support support@miri.com.au for current copies. By default, the files are
installed in the folder:
\Program Files\Miri Map2000+Ver3\Examples
For users interested in the process of building a system network map, it is recommended that the
creating a new project section is followed as it illustrates the basic steps typically used in the map
building process.
Consideration of the various project map elements I also required and these are illustrated in the
following Project Map Elements section.

Project Map Elements


Each MiriMap2000+ project is saved to a single file. In that file the settings are saved for several
elements that represent different types of “Station” with “Links” between them. These elements
are illustrated in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 4-42


Chapter 4 - MiriMap2000+ Software

The stations are linked to each other via physical links represented by solid black lines and will
have parcels created between them to transfer data, represented by dashed lines.
In the section on creating a new project a step by step process will be used to illustrate the
recommended mapping technique. The various types of station types will have different property
settings are defined by reference to the following sections.
‰ Station Properties - AD2000 Series Type devices
‰ Station Properties - I/O Expansion Type devices
‰ Station Properties - Other Protocol Type devices
‰ Station Properties - SMS Type devices

© 2007 Miri Technologies All rights reserved. V3.00 4-43


Chapter 4 - MiriMap2000+ Software

Step by Step Guide to Creating a New Project


The mapping process is used to configure all the elements of the system so that data transfer
occurs efficiently and local logic and conditions are processed. Typically this requires the following
steps:
‰ Step 1 - Create the stations
‰ Step 2 - Configure the station memory variables
‰ Step 3 - Configure the station ports
‰ Step 4 - Configure the data parcels between the stations
‰ Step 5 - Configure the physical links between the stations
At this stage a basic system will have been created to transfer data between the stations, however,
local logic is typically required to move the memory variables obtained for Ladder logic or field
devices to the memory variables being transferred and thus a further step is required:
‰ Step 6 - Write any local Ladder logic. See the chapter on Ladder Logic.
In some instances, the local conditions may be data-logged to provide a historical record of events
and variables in the stations and thus another additional step may be required:
‰ Step 7 - Add Data-logging conditions and add any local Ladder logic if required to add to the
basic logging utilities. See the chapter on Data-logging.
To illustrate the processes involved, the system layout shown in the following diagram will be
configured as an example map.

Opening a New Project File


The assumption is that a new project is to be created. Run MiriMap2000+ and select the Manual
Setup button at the welcome screen. If MiriMap2000+ is already open, select File - New, then
select the Manual Setup button at the welcome screen.

© 2007 Miri Technologies All rights reserved. V3.00 4-44


Chapter 4 - MiriMap2000+ Software

This displays a blank map screen as shown in the following diagram ready to apply stations to.

There are usually three ways to edit station icon in a map. Using the Toolbar icon; Right
Clicking the mouse to open the menu options; pressing a key-stroke combination of the Control
CTRL key plus a QWERTY keyboard letter key (e.g. CTRL+ T). When these are available, they will
be listed in the format:

‰ Locate the Icon Label toolbar icon , Menu Option Menu Label, Press Key-code.
To add a new station:

‰ Locate the Add Station toolbar icon , Menu Option New Station, Press CTRL+T.

© 2007 Miri Technologies All rights reserved. V3.00 4-45


Chapter 4 - MiriMap2000+ Software

In each case, a cross hair locator appears. Move the mouse to a suitable position on the blank
screen and press the left mouse button.
This places a station icon onto the network map window area.

To edit the properties of each station, the correct icon must be selected. To do this, locate the new
station icon and select with the mouse.

A selected station is highlighted in red as shown above.


‰ Double Click the left hand mouse button or Right Click the right hand mouse button and
select the option Station Properties.

Setting the Station Properties


The Station Properties screen opens as shown in the following diagram:

Full details for the setting for this station type are available in the section Station Properties -
AD2000 Series Type devices.
Initially, this step by step will create a basic station using the following settings:
‰ A polling Master Station on Port 1 using the internal radio modem option
‰ A Modbus Port configured to be a slave mode device to an HMI which is the polling Master
(i.e. initiating requests for data)
‰ Remote stations with 10 word memory allocations for data coming from the Master station
and 20 word memory allocations for data going to the Master station.
Since this is to be the Master station, it is often easier to assign an identifier which is not equal to
the default of 1 and much greater than the total number of slave stations the system will ever be
allocated. Typically an identifier of 100 is chosen.
‰ Select the Identifier entry on the General tab and change the number to 100.
‰ Select the Station Name entry and type in Master.

© 2007 Miri Technologies All rights reserved. V3.00 4-46


Chapter 4 - MiriMap2000+ Software

‰ Select the AD2000 Model option and select 2006.


‰ Select the Description entry and add some basic text to describe the station
‰ Press OK
The warning screen comes up to acknowledge the identifier number has changed.

‰ Press OK

Saving the Project Map File

Now save the file. Do this regularly during the various stages of configuration, to avoid losing
data.

Select the File save menu option or the icon and save with an appropriate name.

In the Project Properties screen, enter a suitable project title and any revision notes that may be
required as the map is built. The Project version number will automatically increment each time the
file is save, however, it can be manually set to any number required.

Now create a new station with Identifier 1 as the first remote station. To add a new station:

© 2007 Miri Technologies All rights reserved. V3.00 4-47


Chapter 4 - MiriMap2000+ Software

‰ Locate the Add Station toolbar icon , Menu Option New Station, Press CTRL+T.
By default this will have station name “Station 1” and Identifier of 1. In this case all the default
properties can be accepted, however, open the Station Properties (select the Station 1 icon with
the mouse) to review the General Properties page:

Assigning Variables
Next, the memory variables must be assigned (refer to the section on assigning variables for full
details). Initially these are created to accommodate the data transfer process between the slave
station and the master. This memory needs to be in a contiguous block so that the process can be
completed as efficiently as possible.
Here a naming convention should be used to label this memory so it is obvious to other users. The
user can choose their own naming convention, however, one convention that many people can
relate to is InBox and OutBox. Analogueous to emails,
‰ The InBox is a label to represent data or messages that are coming IN to the device.
‰ The OutBox is a label to represent data or messages that are to be sent OUT from the
device.
Select the Variables button to display the Element Browser.

© 2007 Miri Technologies All rights reserved. V3.00 4-48


Chapter 4 - MiriMap2000+ Software

Select the Create Variable button and create the memory variables to accommodate the required
contiguous blocks (i.e. as stated earlier in this section, 10 word memory allocations for data coming
from the Master station and 20 word memory allocations for data going to the Master station). The
first option to display is the Create Variable menu. In the Variable Nickname entry type InBox,
leave the Memory Types as 16 bit (only select 32 bits when assigning memory variables for 32 bit
long and floating point memory), leave the default Memory Location at 1, in the Number to
Create, type in 10 (the block length), add a comment if required:

Press OK. This will have created a block of memory variables from %MW1 to %MW10 labelled as
InBox00001 to InBox00010 as shown below:

Select the Create Variable button again and create the 20 word memory allocation OutBox for
data going to the Master station:

Press OK.

© 2007 Miri Technologies All rights reserved. V3.00 4-49


Chapter 4 - MiriMap2000+ Software

This will have created a block of memory variables from %MW11 to %MW30 labelled as
OutBox00001 to OutBox00010 as shown.

In the design process consider all expected physical I/O requirements and spares leaving a
“gap” of spare memory between the InBox and the OutBox memory allocations. All data across the
radio is best sent in one single block (or multiples of 100 word blocks if the data requirement is
high). In the above allocation the OutBox could have been started at %MW101, leaving the
memory locations %MW31 to %MW100 unassigned for “future” use as InBox allocations. The
memory variables to %MW200 could also be left unassigned for “future” use as OutBox allocations.
Press OK twice and save the project.
Select the Master station and select the Station Properties form. The memory allocation for the
Master is performed in a similar manner by selecting the Variables button. In this system, it was
determined that the data being gathered across the network was to be used to display on an HMI
via a Modbus port configured on the AD2006 to be a slave mode device (the HMI is the polling
Master initiating requests for data). Some understanding of the protocols to be used in this link may
be required, for further details referred to the section on protocols.

Modbus is simple protocol and as a result is supported widely in PLC/HMI and DCS products.
To ensure fast, simple and efficient communications, most HMIs also require data to be read or
written in contiguous blocks and to be of the same memory type. In Modbus Holding Register
memory is the same as the AD2000 Series %MW memory in structure. They are both 16 bit word
based. Holding Register 400001 means the first memory location, the type being labelled by the
first digit 4. In the AD2000 Series devices the entire variable memory is 64k words (65535 words)
in length. Most PLC/HMI and DCS products will support the maximum Modbus memory addressing
range which is also 64k words (65535 words). However, the original Modbus addressing maximum
was 10,000 and thus to accommodate products that cannot be addressed to read the 64k word
maximum, it is recommended to keep all addressing under this 10,000 limit. For products that do
support the full 64k range, AD2000 Series device diagnostic memory areas are directly accessible
by Modbus. For further information on the AD2000 Series device memory structure refer to the
memory diagram.
Select the Create Variable button again and create the Modbus memory allocations for the data
that is to be read by the Modbus device connected to the AD2006. In the Variable Nickname entry
type 4x (to represent the fact that the allocation is Holding register type memory), leave the
Memory Types as 16 bit (only select 32 bits when assigning memory variables for 32 bit long and
floating point memory), leave the default Memory Location at 1, in the Number to Create, type in
1000 (the block length), add a comment if required:

© 2007 Miri Technologies All rights reserved. V3.00 4-50


Chapter 4 - MiriMap2000+ Software

Press OK. This will have created a block of memory variables from %MW1 to %MW1000 labelled
as 4x00001 to 4x01000 as shown below:

Press OK. Select the Ports tab.

Configuring the Ports

The default settings for the ports should always be used. They have been adjusted and
tested to operate with typical hardware and software applications.
The port parameters to be adjusted for this example project are Port 1 and port 5.

© 2007 Miri Technologies All rights reserved. V3.00 4-51


Chapter 4 - MiriMap2000+ Software

‰ Port 1 has the internal data radio modem installed and the Master is the initiating device that
gathers the status of the memory variables at the remote site. This is termed a Polling
Master. It writes data from the Master device to the remote (slave) device and repeats this.
‰ Port 5 is to be the Modbus slave connection to the HMI and thus is to be a slave device on
this connection. This is termed No Polling. The interface on this port will be RS232.
With the Port1 tab selected, adjust the Polling setting to Continuous.

Press Apply, Yes to accept and then select Port 5 tab.


Adjust the Protocol entry to Modbus via the drop-down box. Adjust the interface to RS232, leaving
the PLC address at 1 and change only if required by the HMI interface (e.g. if the physical link is
multi-drop and there is already a Modbus station ID=1). Select the PLC Variables button to open
the PLC Allocation screen as follows:

In this screen the Modbus memory types are assigned against the AD2000 Series device memory
so that an image is created to respond to the Modbus Master requests. The default setting is to
image the entire 64k words (65535) of the AD2000 Series device memory as Modbus Holding
Register memory. This allows bits to be sent as packed digitals in Holding Register type memory
and all other memory types to be referenced to this memory type. Most HMI products will support
this, if not then read only bits can be assigned as Modbus type Inputs at a suitable and read/write
bits as Modbus type Coils. Read only words can be assigned as Modbus type Input Registers.
Press OK and accept the Modbus memory changes if prompted, to return to the Port properties
screen as shown in the following screen.

© 2007 Miri Technologies All rights reserved. V3.00 4-52


Chapter 4 - MiriMap2000+ Software

Press Apply, Yes to accept and then select Parcels tab.

Configuring Parcels
The Parcels tab is where the configuration is completed to process data between two devices.
Referring to the original diagram, 10 x 16 bit words are to be sent from the Master to the Station1
remote and 20 x 16 bit words are to be read from that remote station by the Master.

Parcels are built on the basis of defining a source station and a starting memory location, with
a length and then determining the source port. Parcels are always defined at the station where
the parcels are being sent from. This is despite the fact that when the system is running, the
parcels are controlled by the Polling Master device (in this example the Master). This is done to
ensure that the correct source and destination stations are set each time. (This process becomes
more obvious when event parcels are being configured).
First define the parcel for the 10 x 16 bit words which are to be sent from the Master to the Station1
remote.
Select the New button.
The Source station cannot be adjusted, it is already the selected station. The Source Variable has
to be determined and in this example the first address available in the list nickname 4x00001
(variable address %MW1) is selected). The Destination station is Station 1. Select this on the right
hand column from the Station drop down box. The Destination Variable has to be determined
and in this example the first address available in the list nickname InBox00001 (variable address
%MW1) is selected. Define the parcel (memory variable block length) length by typing 10 into the
Number of 16 bit Words entry box. Finally define the Source Port as being Port 1, the radio port.
The screen is then displayed as follows:

© 2007 Miri Technologies All rights reserved. V3.00 4-53


Chapter 4 - MiriMap2000+ Software

The red highlighted variables indicate those that are being used in the parcel. This warns the user
of parcels already assigned to prevent memory areas being over-written.
Press OK. The following screen shows the newly created parcel.

To view the properties by variable address, rather than nickname, uncheck the option Display
Nicknames on the bottom right hand corner of this screen.
Press OK.
Now define the parcel for the 20 x 16 bit words which are to be read from Station1 remote by the
Master. Select the Station 1 icon, then select the Parcels tab.
Press the New button.
The Source station cannot be adjusted, it is already the selected station. The Source Variable is
the starting variable address for the block assigned OutBlock (%MW11). The Destination station is
Station 1. Select this on the right hand column from the Station drop down box. The Destination
Variable has to be determined and in this example a starting address in the Master memory
allocations is chosen so as to leave memory free for future stations data blocks. The first address
available in the list nickname 4x00101 (variable address %MW101) is selected). Define the parcel
(memory variable block length) length by typing 20 into the Number of 16 bit Words entry box.
Finally define the Source Port as being Port 1, the radio port. The screen is then displayed as
follows:

© 2007 Miri Technologies All rights reserved. V3.00 4-54


Chapter 4 - MiriMap2000+ Software

Press OK. The following screen shows the newly created parcel.

Here the last parcel created is also listed. It can only be viewed at this station, to edit it the source
station parcel properties form must be opened.
The Station 1 ports have not been configured yet. To do this, select the Station 1 Ports tab. The
default settings are applicable for this port and thus no changes are required.

© 2007 Miri Technologies All rights reserved. V3.00 4-55


Chapter 4 - MiriMap2000+ Software

If the PCMCIA port is likely to be used, it should be enabled. This is achieved by setting it to the
correct interface. Select the PCMCIA tab and adjust the Interface setting from None to RS232 (for
an RS232 card). For Ethernet PCMCIA cards refer to the section on configuring Ethernet ports on
an AD2000. The screen should be as shown in the following diagram:

Press OK and Yes to accept the changes made.

Creating the Links between Stations


The main map screen is now visible with two station icons. The two stations have been configured
for the port settings and the data parcels. The remaining configuration step is to define the physical
link between the two that the data will be sent via.

‰ Locate the Add Link toolbar icon , Menu Option New Link, Press CTRL+L or right click
and select New Link option.

© 2007 Miri Technologies All rights reserved. V3.00 4-56


Chapter 4 - MiriMap2000+ Software

Using the cross-hair mouse locator, select the Master station icon and drag the mouse across to
the Station 1 icon. Release once the link line is created between the two stations. Double click the
line to open the Communication Link Properties screen as shown below.

In this example the default settings will allow the compiled configuration map to work. In future
maps, particularly when different ports and protocols are being used this screen must be adjusted
to ensure that the interface and protocols match across the physical link. The compiler will warn of
mismatches when they occur.
The mouse can be returned to Normal mode by selecting the icon on the toolbar.

Inserting Ladder Logic


At this stage the software configuration has been set up to send the data via the ports requested.
However, there is no actual field data assigned to the Inbox and OutBox memory blocks. Original
MiriMap2000+ map configurations used further parcels to map the physical I/O variables to the
data transfer variable blocks. With the inclusion of Ladder Logic capabilities this method provides a
more user friendly method and one that can be monitored easily. It is now the recommended
method.
‰ At the remote station, Station 1 all the 16 digital inputs, the 8 analogue inputs and the radio
RSSI diagnostic variable are required for monitoring at the Master.
‰ At the Master will send 16 digital control bits and 4 analogue output set-points.
Select the Station1 icon with the mouse and enter the Ladder Logic edit screen.

© 2007 Miri Technologies All rights reserved. V3.00 4-57


Chapter 4 - MiriMap2000+ Software

‰ Locate the Ladder Logic toolbar icon , Menu Option Toggle Ladder Logic, Press
CTRL+D or right click and select PLC Ladder Logic option.
For full details on the Ladder Logic process and functions and how to edit in this mode, refer to the
chapter on Ladder Logic. For the purpose of this example, a step by step guide will illustrate the
basic methods used.
This will display the ladder logic screen as shown in the following diagram:

The next step is to map all the local I/O of use to some of the memory variables you just created.
By convention (and you can create your own as you get used to mapping but this is quite a useful
and logical one) we map the data in the following order:
‰ Digital Inputs
‰ Analogue Inputs
‰ RSSI (Received Signal Strength Indicator). This is only useful if you are using the internal
radio option.
Map them into the block of memory variables that will eventually be sent to the slave unit in this
system. Based on the allocation configured previously in this section, this would be 4x00001 or
%MW1.
The Ladder Logic interface must be in edit mode to make any changes. Right click the mouse key
and select Edit Mode or press Ctrl+E or highlight the tool bar icon .
The edit area will now be shaded black. Then select the Function Block toolbar option

and the following screen should display:

© 2007 Miri Technologies All rights reserved. V3.00 4-58


Chapter 4 - MiriMap2000+ Software

Scroll down until the Move Words Function Block and press OK showing:

Now select the MOVE function block and double click to edit the required parameters (or right click
the mouse when highlighting the function block and select the Edit Cell option). There are three
parameters to be set for this function block.
First highlight Inputs A and then select the “Variable ID or Value” drop down box. Select the
Source memory variable called Digital Inputs on the left-hand side of the form. They are not
immediately visible on the form so scroll down until you see the variable name.

Highlight any variable in the source list and then type the first letter of the variable you wish to
locate (in this case D, it takes you to the first D in the alphabetical list). Then type the second letter
(in this case I, it takes you to the first DI in the alphabetical list) which turns out to be the variable
you wish. Select it so it is highlighted.
Add a function block name (e.g. Move Digitals). This is optional (it is good documentation practice).

Next highlight Inputs B, check the Constant checkbox and then select the Variable ID or Value
and enter a value of 1.

© 2007 Miri Technologies All rights reserved. V3.00 4-59


Chapter 4 - MiriMap2000+ Software

Now choose the destination variable that the Digital Inputs will be moved to (OutBox00001,
%MW00011). Highlight Outputs C and then select the Variable ID or Value drop down box. Select
the destination memory variable called OutBox00001.

Once all three parameters are completed, press OK to view the following:

The digital inputs can be assigned individual bit names and descriptors. Refer to the section on
Assigning Bits for further details.
Now insert a new rung after the one just created.
‰ Locate the PLC Menu Option Insert, Press Ins or right click and select the Insert option
(see below).

Repeat the insertion of the Move Word function block for the following parameters.

© 2007 Miri Technologies All rights reserved. V3.00 4-60


Chapter 4 - MiriMap2000+ Software

A - Analogue Input1, B - 8, C - OutBox00002


This is because all 8 analogue channels are to be mapped across to the next 8 variables in the
OutBox block.
Change the function block name as required.

The single Move block could have been repeated 8 times for each analogue channel 1-8,
however, by entering an 8 in the B parameter box then this will do the same thing and makes the
Ladder Logic easier to read and faster to operate.
There is one more variable that is available at the slave that may need at the Master, the radio
diagnostic variable RD2-RSSI. This is a measure of received radio signal strength. It should be
transferred to the master for monitoring of the link status over time (via trends etc.). To add this
repeat the insertion of the Move Word function block for the following parameters.
A - RD2-RSSI, B - 1, C - OutBox00010
On completion of the third Move rung the following screen should be displayed:

The data that is being sent from the Master will be available in the memory block references
InBox00001 to 10. The data represents 5 x 16 bit words of data, the first word being 16 digital bits
packed into one word (4 of which can be applied directly to the physical digital outputs on the
AD2000) and 4 analogue output channels. To get these to physical I/O points, similar ladder logic
needs to be written.
For the first 4 digital outputs add 4 individual rung as follows.
‰ Locate the PLC Menu Option Insert, Press Ins or right click and select the Insert option
(see below).
Insert an empty rung below the last Move rung created above. Ensure that the black highlighted
edit marker is on the left hand side of the rung:

© 2007 Miri Technologies All rights reserved. V3.00 4-61


Chapter 4 - MiriMap2000+ Software

On the Ladder toolbar, locate the Open Contact icon and select it. This opens the edit variable
screen as below:

On the Element ID drop down box locate the Variable InBox00001, the first word in the data block
from the Master and ensure a 1 is written into the Bit field. Press the green tick button to accept.
Move the mouse to the far right hand side of the rung, highlighting the NOP, No Operation column.

On the Ladder toolbar, locate the Output Coils icon and select it. This opens the edit variable
screen as below:

On the Element ID drop down box locate the Variable Digital Output, ensure a 1 is written into the
Bit field. This is the first physical I/O point assigned to the AD2000 digital output 1. Press the green
tick button to accept. This leaves a single rung copying the first digital bit from the Master AD2006
to the first digital output at Station 1.

This process can be repeated to assign the next 3 bits, if required.

Ladder rungs can be copied and pasted and then edited to speed this process up. Refer to the
section on copying and pasting ladder logic rungs for further details.
Once the 4 digital bit copies are completed the following rungs should be available:

© 2007 Miri Technologies All rights reserved. V3.00 4-62


Chapter 4 - MiriMap2000+ Software

The remaining ladder rungs can be completed with another Move block which moves the
InBox0002 to 5 variable to the AD2000 physical memory associated with the Analogue Output
channels.

Analogue Output channels are options to the base AD2000 Series devices and thus the
hardware option must be installed in order that these channels will write to them as 4-20mA
physical signals. The part number is AD200x-X-XA-XX. Refer to the section on part numbers
for further details.
The Move block this time has A - InBox00001, B - 4, C - Analogue Output.
Once the 4 analogue output channel copies are completed the following rungs should be available:

Leave the Ladder Logic screen to get back to the map window by menu option PLC Ladder Logic
(or press Ctrl+D or select the icon ). Answer Yes to jumping back the main screen from edit
mode if this was the case.
Save the project file.

© 2007 Miri Technologies All rights reserved. V3.00 4-63


Chapter 4 - MiriMap2000+ Software

At this stage all the basic requirements have been added to allow a point to point system to
function. The next step is to put the software configuration into the hardware. This process is
detailed in the station properties Compile tab.

Copying Stations
In many systems the remote stations will be identical in the majority of functions. Having created a
single station which will include ladder logic and possibly data-logging it is possible to copy the
entire station to another station ID one or many times. This reduces development time significantly.

It is recommended that a station be thoroughly tested prior to any copying, to ensure all ladder
logic, data-logging, communication ports and data parcel transfers operate as expected. This will
minimize repeated corrections on the copied stations.
The new map created in the previous example has the following layout:

In the MiriMap2000+ software layout this is the basic point to point system configuration as shown
below:

A second station is to be added to make it a point to multi-point system layout as shown in the
following diagram:

This has the same parcel transactions, 10 x 16 bit words sent from the master to the slave Station2
and 20 x 16 bit words read from the slave Station2 by the Master.

© 2007 Miri Technologies All rights reserved. V3.00 4-64


Chapter 4 - MiriMap2000+ Software

To create the Station2 in MiriMap2000+, select the Station1 object in the map and copy.
‰ Locate the Main Menu Edit item and select Copy, or Right Click and locate the Edit Copy
item, or press Ctrl+C to copy the station.
Paste a copy of the station object in the map.
‰ Locate the Main Menu Edit item and select Paste, or Right Click and locate the Edit Paste
item, or press Ctrl+V to paste the station.
The station is copied with all the same parameters except the identifier number and the Station
Name which is appended with the label _Copy. The identifier allocated is the next available
undefined identifier number in the current map. If the identifier is to be assigned to a specific
number assign it now via the Station General Identifier option. The map will now resemble the
diagram below:

Rename the station to a suitable name (e.g. Station 2), removing the _Copy. To do this select the
copied station icon, double click and edit the General parameters as required. Drag the icon to a
suitable position in the map area.
Next create a link from the new station to the Master.

‰ Locate the Add Link toolbar icon , Menu Option New Link, Press CTRL+L or right click
and select New Link option.

Using the cross-hair mouse locator, select the Master station icon and drag the mouse across to
the Station 2 icon. Release once the link line is created between the two stations. Double click the
line to open the Communication Link Properties screen as shown below.

In this example the default settings will allow the compiled configuration map to work. In future
maps, particularly when different ports and protocols are being used this screen must be adjusted
to ensure that the interface and protocols match across the physical link. The compiler will warn of
mismatches when they occur.
The mouse can be returned to Normal mode by selecting the icon on the toolbar.

© 2007 Miri Technologies All rights reserved. V3.00 4-65


Chapter 4 - MiriMap2000+ Software

With a physical link created the parcels can be added to ensure the data is transferred across the
link.
Select the Master station and double click to open the Station Properties menus and select the
Parcels tab.

The copy process has copied the parcels but has not filled in the source variables. This is because,
typically, the data is coming from a different memory block in the Master and must be defined at
different addresses. Based on the example of configuring parcels in the first station, the data from
Master to Station1 was located at 4x0001 to 4x0010. It makes sense to use the next 10 free
words, 4x0011 to 4x0020. Select the first blank parcel (polled) and edit to allow this.

The Parcel Properties screen makes the unused variable obvious via the colour coding. The light
blue area on the source station indicates that the range 4x0001 to 4x0010 is being used and that
4x0011 to 4x0020 is available. The same destination address is available. Select the address
4x00011 and the following screen will be displayed. Immediately, the highlighted area indicates the
source variables are being read from the new block of 10 words long. Accept this by pressing OK.

© 2007 Miri Technologies All rights reserved. V3.00 4-66


Chapter 4 - MiriMap2000+ Software

Select the next blank parcel (event) and edit in a similar manner (event and polled parcels have the
same source and destination addresses) to allow this.

The colour highlighting indicates the new allocation and on pressing OK, the parcels are shown as
follows:

Press OK then select the remote Station2 and edit the polled parcel from Station2 to the Master.

Select the empty parcel and edit.

© 2007 Miri Technologies All rights reserved. V3.00 4-67


Chapter 4 - MiriMap2000+ Software

From this Parcel Properties screen the source variables can remain the same but the destination
variables are highlighted in colour to show that another device is writing into that area (Station1).
Choose the next free variable (4x0021) and select it to mark the next block that the master will use
to store the variable data from this Station2.

Scroll down the destination variables to confirm the block size and then press OK to accept.

The parcels between the new Station2 and the Master station are no defined and an exact copy of
the Station1 ladder logic and data-log functions available, using unique memory locations at the
Master for transfer.
This process can be repeated to a theoretical total maximum of 2048 stations.

Each time a station object icon is copied and pasted a duplicate of the parcels are
created. Whilst it is possible to copy multiple stations and paste them into the map, then
edit the parcels, it is recommended to avoid confusion to copy stations one at a time to
ensure the correct parcels are edited.

© 2007 Miri Technologies All rights reserved. V3.00 4-68


Chapter 4 - MiriMap2000+ Software

Station Properties - AD2000 Series Type devices


The station type associated with AD2000 Series devices is shown below:

The settings differ between the model types of the AD2000 Series devices. Where these
differences are relevant, they are noted.

General
This section sets the general properties associated with the station for this type of device.

Station Name

A text description can be used to label the station in the map e.g. Pump Station 1, Well 44 and this
is displayed on the Map window and on any properties boxes for that station.

Identifier

The identifier is a unique number assigned to the station in the MiriMap2000+ configuration file. It is
automatically assigned by the software but can be changed by the user (e.g. Station Name Pump 1
can be 1, Station Name Pump 52 can be 52) but must be unique and no greater than 2048. If an
identifier is manually assigned and it is not unique a warning will be displayed, requiring the change
to be repeated with a unique number.
The first station identifier is always assigned automatically to be 1 but it does not have to be 1, the
user can choose a number scheme to suit their requirements. As new stations are added the
automatically assigned number will be the next lowest number available.

For systems that have less than 100 stations assigned, it is recommended to assign the
master station the ID of 100 with the remotes between at 1-99.
The choice of identifier numbers has a significance because the identifier is used for selection of
Link Status and Poll Select bits. Ensure that the number or word blocks used are assigned
correctly to use these if the number of identifiers is greater than 16. Using block numbers that are
widely different requires more complex parcel mapping to monitor the link healthy and poll select
bits internally to the AD2000 Series devices. Choosing identifiers on 16 point boundaries will
simplify this process.
‰ Link Status/Poll Select bit 1 of block 1 relates to identifier 1
‰ Link Status/Poll Select bit 2 of block 1 relates to identifier 2
‰ Link Status/Poll Select bit 16 of block 1 relates to identifier 16

© 2007 Miri Technologies All rights reserved. V3.00 4-69


Chapter 4 - MiriMap2000+ Software

‰ Link Status/Poll Select bit 1 of block 2 relates to identifier 17


‰ Link Status/Poll Select bit 1 of block 3 relates to identifier 33, and so on.
See Link/Poll Bits for further details on Link Status and Poll Select blocks.

Type

The type setting determines whether the unit is an AD2000 Series device or an external device
using another protocol, (e.g. a PLC). The types supported will be displayed in the drop down box.
In most cases this will be represented by the protocol that the device uses as in many cases the
same protocol will suit multiple PLC type units and third party devices.

AD2000 Model

This lists the AD2000 Series device type model. Ensure that the correct model is selected for the
hardware intended as ports and other features differ between models.

Description

This is a text box where further details about the station can be added to give more information or
to add notes or revision notes.

Variables

Selecting this button will open the variables Element Browser.


The AD2000 Series devices use a flat memory model with a maximum of 64k words (64 x 1024 x
16 bit words, i.e. 65535 16 bit words or 1,048,560 bits for use as user variables.
This memory is divided into different sections with a starting memory address and a length. Refer
to the glossary item on bits, bytes and words for further details for the memory formats described
below:
‰ Bit memory points can be stored in any memory location and are represented by the memory
location and the bit number (e.g. %MW1.1 is word location 1 bit number 1). Bit 1 (not 0) is
used to represent the first and least significant bit such that when only this bit is ON in this
first memory location a number 1 (Hex - 1h) is written to the variable. Bit 16 (not 15) is used
to represent the last and most significant bit such that when only this bit is ON in this last
memory location a number 32768 (Hex - 8000h) is written to the variable location.
‰ The memory references are preceded with the symbol %MW. This represents a Memory
Word address.
‰ Each %MW memory location from %MW1 to %MW51200 can be used to store a number
representing a 16 bit integer (signed or unsigned).
‰ Two of these %MW Memory Word addresses can be used to represent a %ML, Memory
Long address.
‰ Each %ML memory location can be used to store a number representing a 32 bit integer
(signed or unsigned).
‰ Each %ML memory location can be used to store a number representing a 32 single
precision floating point number.
‰ A section of memory is reserved for retentive memory. Unlike other memory locations this
memory is not cleared to zero on a transition form program to run mode on the AD2000
series device.
‰ A section of memory above %MW61440 is reserved for diagnostics and the hardware and
expansion I/O variables.
The memory map is illustrated in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 4-70


Chapter 4 - MiriMap2000+ Software

Figure 32 - AD2000 Series Variable Memory Map


These memory locations are termed “Variables” because they will contain the current real-time
value of the parameter assigned to that memory location which will vary each scan of the AD2000
Series device.
System Variables

Each AD2000 Series device has physical and diagnostic I/O memory vaiables assigned by default.
These cannot be changed.
The physical I/O points are located at the following addresses:
Table 18 - AD2000 Series Device Physical I/O Memory Allocations
Physical Address Variable Nickname
%MW65088 Digital Input
%MW65120 Digital Output
%MW65152 Analogue Input 1
%MW65153 Analogue Input 2
%MW65154 Analogue Input 3
%MW65155 Analogue Input 4
%MW65156 Analogue Input 5
%MW65157 Analogue Input 6
%MW65158 Analogue Input 7
%MW65159 Analogue Input 8
%MW65160 RD1-Temperature
%MW65161 RD2-RSSI
%MW65162 RD3-TX Power
%MW65216 Analogue Output 1
%MW65217 Analogue Output 2
%MW65218 Analogue Output 3
%MW65219 Analogue Output 4

The I/O Expansion modules can have up to a maximum of 8 word variables for data transfer.
These memory locations are reserved in the Variable memory locations as per the following table:
Table 19 - AD2000 Series Device I/O Expansion Memory Allocations
Physical Physical Physical
Address Nickname Address Nickname Address Nickname
%MW59136 [Expansion 01-1] %MW59232 [Expansion 13-1] %MW59328 [Expansion 25-1]
%MW59137 [Expansion 01-2] %MW59233 [Expansion 13-2] %MW59329 [Expansion 25-2]
%MW59138 [Expansion 01-3] %MW59234 [Expansion 13-3] %MW59330 [Expansion 25-3]

© 2007 Miri Technologies All rights reserved. V3.00 4-71


Chapter 4 - MiriMap2000+ Software

Physical Physical Physical


Address Nickname Address Nickname Address Nickname
%MW59139 [Expansion 01-4] %MW59235 [Expansion 13-4] %MW59331 [Expansion 25-4]
%MW59140 [Expansion 01-5] %MW59236 [Expansion 13-5] %MW59332 [Expansion 25-5]
%MW59141 [Expansion 01-6] %MW59237 [Expansion 13-6] %MW59333 [Expansion 25-6]
%MW59142 [Expansion 01-7] %MW59238 [Expansion 13-7] %MW59334 [Expansion 25-7]
%MW59143 [Expansion 01-8] %MW59239 [Expansion 13-8] %MW59335 [Expansion 25-8]
%MW59144 [Expansion 02-1] %MW59240 [Expansion 14-1] %MW59336 [Expansion 26-1]
%MW59145 [Expansion 02-2] %MW59241 [Expansion 14-2] %MW59337 [Expansion 26-2]
%MW59146 [Expansion 02-3] %MW59242 [Expansion 14-3] %MW59338 [Expansion 26-3]
%MW59147 [Expansion 02-4] %MW59243 [Expansion 14-4] %MW59339 [Expansion 26-4]
%MW59148 [Expansion 02-5] %MW59244 [Expansion 14-5] %MW59340 [Expansion 26-5]
%MW59149 [Expansion 02-6] %MW59245 [Expansion 14-6] %MW59341 [Expansion 26-6]
%MW59150 [Expansion 02-7] %MW59246 [Expansion 14-7] %MW59342 [Expansion 26-7]
%MW59151 [Expansion 02-8] %MW59247 [Expansion 14-8] %MW59343 [Expansion 26-8]
%MW59152 [Expansion 03-1] %MW59248 [Expansion 15-1] %MW59344 [Expansion 27-1]
%MW59153 [Expansion 03-2] %MW59249 [Expansion 15-2] %MW59345 [Expansion 27-2]
%MW59154 [Expansion 03-3] %MW59250 [Expansion 15-3] %MW59346 [Expansion 27-3]
%MW59155 [Expansion 03-4] %MW59251 [Expansion 15-4] %MW59347 [Expansion 27-4]
%MW59156 [Expansion 03-5] %MW59252 [Expansion 15-5] %MW59348 [Expansion 27-5]
%MW59157 [Expansion 03-6] %MW59253 [Expansion 15-6] %MW59349 [Expansion 27-6]
%MW59158 [Expansion 03-7] %MW59254 [Expansion 15-7] %MW59350 [Expansion 27-7]
%MW59159 [Expansion 03-8] %MW59255 [Expansion 15-8] %MW59351 [Expansion 27-8]
%MW59160 [Expansion 04-1] %MW59256 [Expansion 16-1] %MW59352 [Expansion 28-1]
%MW59161 [Expansion 04-2] %MW59257 [Expansion 16-2] %MW59353 [Expansion 28-2]
%MW59162 [Expansion 04-3] %MW59258 [Expansion 16-3] %MW59354 [Expansion 28-3]
%MW59163 [Expansion 04-4] %MW59259 [Expansion 16-4] %MW59355 [Expansion 28-4]
%MW59164 [Expansion 04-5] %MW59260 [Expansion 16-5] %MW59356 [Expansion 28-5]
%MW59165 [Expansion 04-6] %MW59261 [Expansion 16-6] %MW59357 [Expansion 28-6]
%MW59166 [Expansion 04-7] %MW59262 [Expansion 16-7] %MW59358 [Expansion 28-7]
%MW59167 [Expansion 04-8] %MW59263 [Expansion 16-8] %MW59359 [Expansion 28-8]
%MW59168 [Expansion 05-1] %MW59264 [Expansion 17-1] %MW59360 [Expansion 29-1]
%MW59169 [Expansion 05-2] %MW59265 [Expansion 17-2] %MW59361 [Expansion 29-2]
%MW59170 [Expansion 05-3] %MW59266 [Expansion 17-3] %MW59362 [Expansion 29-3]
%MW59171 [Expansion 05-4] %MW59267 [Expansion 17-4] %MW59363 [Expansion 29-4]
%MW59172 [Expansion 05-5] %MW59268 [Expansion 17-5] %MW59364 [Expansion 29-5]
%MW59173 [Expansion 05-6] %MW59269 [Expansion 17-6] %MW59365 [Expansion 29-6]
%MW59174 [Expansion 05-7] %MW59270 [Expansion 17-7] %MW59366 [Expansion 29-7]
%MW59175 [Expansion 05-8] %MW59271 [Expansion 17-8] %MW59367 [Expansion 29-8]
%MW59176 [Expansion 06-1] %MW59272 [Expansion 18-1] %MW59368 [Expansion 30-1]
%MW59177 [Expansion 06-2] %MW59273 [Expansion 18-2] %MW59369 [Expansion 30-2]
%MW59178 [Expansion 06-3] %MW59274 [Expansion 18-3] %MW59370 [Expansion 30-3]
%MW59179 [Expansion 06-4] %MW59275 [Expansion 18-4] %MW59371 [Expansion 30-4]
%MW59180 [Expansion 06-5] %MW59276 [Expansion 18-5] %MW59372 [Expansion 30-5]
%MW59181 [Expansion 06-6] %MW59277 [Expansion 18-6] %MW59373 [Expansion 30-6]
%MW59182 [Expansion 06-7] %MW59278 [Expansion 18-7] %MW59374 [Expansion 30-7]
%MW59183 [Expansion 06-8] %MW59279 [Expansion 18-8] %MW59375 [Expansion 30-8]
%MW59184 [Expansion 07-1] %MW59280 [Expansion 19-1] %MW59376 [Expansion 31-1]
%MW59185 [Expansion 07-2] %MW59281 [Expansion 19-2] %MW59377 [Expansion 31-2]
%MW59186 [Expansion 07-3] %MW59282 [Expansion 19-3] %MW59378 [Expansion 31-3]
%MW59187 [Expansion 07-4] %MW59283 [Expansion 19-4] %MW59379 [Expansion 31-4]
%MW59188 [Expansion 07-5] %MW59284 [Expansion 19-5] %MW59380 [Expansion 31-5]
%MW59189 [Expansion 07-6] %MW59285 [Expansion 19-6] %MW59381 [Expansion 31-6]
%MW59190 [Expansion 07-7] %MW59286 [Expansion 19-7] %MW59382 [Expansion 31-7]
%MW59191 [Expansion 07-8] %MW59287 [Expansion 19-8] %MW59383 [Expansion 31-8]
%MW59192 [Expansion 08-1] %MW59288 [Expansion 20-1] %MW59384 [Expansion 32-1]
%MW59193 [Expansion 08-2] %MW59289 [Expansion 20-2] %MW59385 [Expansion 32-2]
%MW59194 [Expansion 08-3] %MW59290 [Expansion 20-3] %MW59386 [Expansion 32-3]
%MW59195 [Expansion 08-4] %MW59291 [Expansion 20-4] %MW59387 [Expansion 32-4]

© 2007 Miri Technologies All rights reserved. V3.00 4-72


Chapter 4 - MiriMap2000+ Software

Physical Physical Physical


Address Nickname Address Nickname Address Nickname
%MW59196 [Expansion 08-5] %MW59292 [Expansion 20-5] %MW59388 [Expansion 32-5]
%MW59197 [Expansion 08-6] %MW59293 [Expansion 20-6] %MW59389 [Expansion 32-6]
%MW59198 [Expansion 08-7] %MW59294 [Expansion 20-7] %MW59390 [Expansion 32-7]
%MW59199 [Expansion 08-8] %MW59295 [Expansion 20-8] %MW59391 [Expansion 32-8]
%MW59200 [Expansion 09-1] %MW59296 [Expansion 21-1]
%MW59201 [Expansion 09-2] %MW59297 [Expansion 21-2]
%MW59202 [Expansion 09-3] %MW59298 [Expansion 21-3]
%MW59203 [Expansion 09-4] %MW59299 [Expansion 21-4]
%MW59204 [Expansion 09-5] %MW59300 [Expansion 21-5]
%MW59205 [Expansion 09-6] %MW59301 [Expansion 21-6]
%MW59206 [Expansion 09-7] %MW59302 [Expansion 21-7]
%MW59207 [Expansion 09-8] %MW59303 [Expansion 21-8]
%MW59208 [Expansion 10-1] %MW59304 [Expansion 22-1]
%MW59209 [Expansion 10-2] %MW59305 [Expansion 22-2]
%MW59210 [Expansion 10-3] %MW59306 [Expansion 22-3]
%MW59211 [Expansion 10-4] %MW59307 [Expansion 22-4]
%MW59212 [Expansion 10-5] %MW59308 [Expansion 22-5]
%MW59213 [Expansion 10-6] %MW59309 [Expansion 22-6]
%MW59214 [Expansion 10-7] %MW59310 [Expansion 22-7]
%MW59215 [Expansion 10-8] %MW59311 [Expansion 22-8]
%MW59216 [Expansion 11-1] %MW59312 [Expansion 23-1]
%MW59217 [Expansion 11-2] %MW59313 [Expansion 23-2]
%MW59218 [Expansion 11-3] %MW59314 [Expansion 23-3]
%MW59219 [Expansion 11-4] %MW59315 [Expansion 23-4]
%MW59220 [Expansion 11-5] %MW59316 [Expansion 23-5]
%MW59221 [Expansion 11-6] %MW59317 [Expansion 23-6]
%MW59222 [Expansion 11-7] %MW59318 [Expansion 23-7]
%MW59223 [Expansion 11-8] %MW59319 [Expansion 23-8]
%MW59224 [Expansion 12-1] %MW59320 [Expansion 24-1]
%MW59225 [Expansion 12-2] %MW59321 [Expansion 24-2]
%MW59226 [Expansion 12-3] %MW59322 [Expansion 24-3]
%MW59227 [Expansion 12-4] %MW59323 [Expansion 24-4]
%MW59228 [Expansion 12-5] %MW59324 [Expansion 24-5]
%MW59229 [Expansion 12-6] %MW59325 [Expansion 24-6]
%MW59230 [Expansion 12-7] %MW59326 [Expansion 24-7]
%MW59231 [Expansion 12-8] %MW59327 [Expansion 24-8]

There are several internal diagnostic variables available and these are listed in the following table:
Table 20 - AD2000 Series Device Diagnostic Variables Memory Allocations
Physical Physical
Address Nickname Address Nickname
%MW65272 [Last PLC Scan] %MW65072 [PCMCIA_Diag01]
%MW65273 [Ave PLC Scan] %MW65073 [PCMCIA_Diag02]
%MW65274 [Min PLC Scan] %MW65074 [PCMCIA_Diag03]
%MW65275 [Max PLC Scan] %MW65075 [PCMCIA_Diag04]
%MW65276 [Log Count] %MW65076 [PCMCIA_Diag05]
%MW65277 [Broadcast Backoff Time] %MW65077 [PCMCIA_Diag06]
%MW65278 [Broadcast Slot Var] %MW65078 [PCMCIA_Diag07]
%MW65030 [Port Error Code Port1] %MW65079 [PCMCIA_Diag08]
%MW65031 [Port Error Code Port2] %MW65080 [PCMCIA_Diag09]
%MW65032 [Port Error Code Port3] %MW65081 [PCMCIA_Diag10]
%MW65033 [Port Error Code Port4] %MW65082 [PCMCIA_Diag11]
%MW65034 [Port Error Code Port5] %MW65083 [PCMCIA_Diag12]
%MW65036 [Port Dialup Status Port1] %MW65084 [PLC System Read Coil 1]
%MW65037 [Port Dialup Status Port2] %MW65084.01 {First Scan Coil}
%MW65038 [Port Dialup Status Port3] %MW65084.02 {Second Coil}
%MW65039 [Port Dialup Status Port4] %MW65084.03 {Minute Coil}

© 2007 Miri Technologies All rights reserved. V3.00 4-73


Chapter 4 - MiriMap2000+ Software

Physical Physical
Address Nickname Address Nickname
%MW65040 [Port Dialup Status Port5] %MW65084.04 {Hour Coil}
%MW65042 [Port TX ID Port1] %MW65084.05 {Date Coil}
%MW65043 [Port TX ID Port2] %MW65084.06 {Month Coil}
%MW65044 [Port TX ID Port3] %MW65084.07 {Year Coil}
%MW65045 [Port TX ID Port4] %MW65084.08 {Log Coil}
%MW65046 [Port TX ID Port5] %MW65084.09 {Clock Fault}
%MW65048 [Port RX ID Port1] %MW65084.10 {Event Fault}
%MW65049 [Port RX ID Port2] %MW65084.11 {Datalog Full}
%MW65050 [Port RX ID Port3] %MW65084.12 {Broadcast Time Sent}
%MW65051 [Port RX ID Port4] %MW65084.13 {SBD SentOK}
%MW65052 [Port RX ID Port5] %MW65085 [PLC System Read Coil 2]
%MW65054 [Port Retries Port1] %MW65086 [PLC System Write Coil 1]
%MW65055 [Port Retries Port2] %MW65086.01 {Radio Off Coil}
%MW65056 [Port Retries Port3] %MW65086.02 {Reboot Unit Coil}
%MW65057 [Port Retries Port4] %MW65086.03 {Sleep Coil}
%MW65058 [Port Retries Port5] %MW65086.04 {Broadcast Time Coil}
%MW65060 [Port Link Fails Port1] %MW65086.05 {Force Poll Coil}
%MW65061 [Port Link Fails Port2] %MW65087 [PLC System Write Coil 2]
%MW65062 [Port Link Fails Port3] %MW65264 [Time Second]
%MW65063 [Port Link Fails Port4] %MW65265 [Time Minute]
%MW65064 [Port Link Fails Port5] %MW65266 [Time Hour]
%MW65066 [Messages RX Port1] %MW65267 [Time Date]
%MW65067 [Messages RX Port2] %MW65268 [Time Month]
%MW65068 [Messages RX Port3] %MW65269 [Time Day]
%MW65069 [Messages RX Port4] %MW65270 [Time Year]
%MW65070 [Messages RX Port5] %MW65248 [Alarm Second]
%MW65252 [Bad Packets Port1] %MW65249 [Alarm Minute]
%MW65253 [Bad Packets Port2] %MW65250 [Alarm Hour]
%MW65254 [Bad Packets Port3] %MW65251 [Alarm Date]
%MW65255 [Bad Packets Port4] %MW65279 [Log Percent]
%MW65256 [Bad Packets Port5] %MW65280 [Current Station ID]
%MW65258 [Poll Remain Time Port1] %ML32641 [Seconds Since Midnight]
%MW65259 [Poll Remain Time Port2]
%MW65260 [Poll Remain Time Port3]
%MW65261 [Poll Remain Time Port4]
%MW65262 [Poll Remain Time Port5]

User Defined Variables

The user is left to assign and label with nicknames all the memory in the region %MW1 to
%MW61429. Refer to the tables detailing the memory locations for physical, expansion I/O and
diagnostics.
‰ AD2000 Series Device Physical I/O Memory Allocations
‰ AD2000 Series Device I/O Expansion Memory Allocations
‰ AD2000 Series Device Diagnostic Variables Memory Allocations
All other memory locations are available for the user to assign to their system requirements. The
purpose of this is to allow maximum flexibility in allocation different memory types. In many PLC
type devices the user has to work within the fixed confines of the manufacturers memory
allocations. In the AD2000 Series devices the only constraint is the maximum memory available
which is 60k words or 61440 x 16 bit words. One advantage in doing this is the ability to mimic the
memory mapping the user may be familiar with. For example, someone used to Modbus based
PLCs can allocate memory has Holding Register memory (type 4x), or another user more familiar
with Allen Bradley/Rockwell PLCs can allocate memory as Integer files (N7 etc.).
The Nickname is a label to an actual memory location. The base memory location will always be
%MW which represents a single 16 bit word. Refer to the memory map diagram for an illustration.

© 2007 Miri Technologies All rights reserved. V3.00 4-74


Chapter 4 - MiriMap2000+ Software

To create a Variable, select the station, open the General properties tab and press the Variables
button. This opens the Element Browser shown below:

On the left hand side of the screen, the details of the selected variable are shown. In the centre the
view options for the variables are indicated via check boxes.
16 Bits - when checked will show only %MW 16 bit word allocations
32 Bits - when checked will also show %ML 32 bit word allocations
Expansion Variables - will display the expansion I/O word allocations and are identified by the
form [Expansion XX-Y] where XX is the I/O module ID address and Y the channel number (1-8).
Hardware I/O - when checked will show the hardware I/O memory locations as detailed in the table
AD2000 Series Device Physical I/O Memory Allocations.
Sort By Nickname - when checked will display the variables in an alpha-numeric sort based on the
assigned variable nickname. If not checked, the sort is based on the physical memory address.
These are as shown in the following diagrams:

© 2007 Miri Technologies All rights reserved. V3.00 4-75


Chapter 4 - MiriMap2000+ Software

12 Bit Analogue inputs


When checked will present the digital conversion of the analogue inputs and internal radio
diagnostic variables based on a 12 bit resolution, i.e. 0-4095 bits for minimum to maximum range. If
not checked these are represented by 0-65520 bits. This is useful for some PLC/HMI products that
do not support signed integers (e.g. Allen Bradley/Rockwell PLCs) where any number greater than
32767 not represented correctly due to fact that the most significant bit in the word is being used as
a sign bit.

Create Variable

Selecting this button opens the Create Variable screen as shown in the following diagram:

Retentive Vars

Selecting this button opens the Create Variable screen for the retentive memory area as shown in
the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 4-76


Chapter 4 - MiriMap2000+ Software

The retentive memory starts at %MW51201, or %ML25601 if 32 bit memory locations are to be
used. Retentive memory will retain the value written to the variable whilst power is turned off the
AD2000 series device and when the device is placed in mode. This is essential for timers and
counters that must retain their values at all times.

Assign Bits

Selecting this button opens the Assign Bits screen as shown in the following diagram:

This utility allows bit memory locations to be labeled with individual nicknames
Select each row for the bit positions and edit the Bit Name and Descriptions as required. Copy
and Paste functions are available in the form by selecting the required column or columns, pressing
Esc button so they are highlighted in grey then pressing CTRL+C. The copied variables can then
be pasted (CTRL+V) into another row and edited to be unique.

© 2007 Miri Technologies All rights reserved. V3.00 4-77


Chapter 4 - MiriMap2000+ Software

The Bit Names must be unique.

The maximum number of characters for the bit name is 30 plus the {} descriptors which are
automatically added around the name - making the total size 32 chars. The field widths are fixed in
the entry fields. The description maximum width is 128 characters.

Delete

If a variable assignments are to be deleted, select the required variables in the Element Browser
Variable list and press the Delete button.
Confirm the option is to be performed by answering Yes to the prompt.

If a variable assignment is being used in ladder logic, it cannot be deleted. A second


prompt will warn of this and list the ladder logic rung position. Locate this and delete or
modify the ladder logic first.

If this operation is completed and warnings about ladder logic usage display and the user
wishes to restore all the variables to the state prior to the deletion process, press Cancel and exit
the Element browser.

Modify

To edit individual memory variable assignments, select the variable and press the Modify button to
open the Modify Variable screen.

© 2007 Miri Technologies All rights reserved. V3.00 4-78


Chapter 4 - MiriMap2000+ Software

Scaling data can be entered here and the variable name and descriptor can also be modified.
‰ The Raw Low value is the bit equivalent for no signal at the input (e.g. 0),
‰ The Raw High the bit equivalent for a full scale signal at the input (e.g. 4095 bits, 65520 bits)
‰ The Display Low is the scaled value equivalent to no signal at the input (e.g. 0)
‰ The Display High is the scaled value equivalent to full scale at the input (e.g. 100)
‰ The Decimals entry specifies the number of decimal points to display in the scaled value
(e.g. 2)
‰ The Units entry specifies the units associated with the scaled variable (e.g. %, mm etc.)

Memory Allocation

Selecting this button will open the memory allocation page which is also available via the main
menu Display - Memory Allocation option, allowing all currently allocated memory variables to be
viewed.

Text Messages

Selecting this button opens the edit screen as shown in the following diagram to add, edit or delete
text messages. This is required when using the data-logging or SMS messaging features and is
used to build the messages.

Only a maximum of 250 messages can be used per station.


Select the Edit Message button to open the following text message creation form:

© 2007 Miri Technologies All rights reserved. V3.00 4-79


Chapter 4 - MiriMap2000+ Software

With the Nicknames check box checked, the elements are displayed by their variable
nickname. Without this checked the elements are displayed by their variable physical address.
Enter the required text, ensuring that for SMS messages the maximum number of characters per
message (defined by the SMS service provider, typically 160 characters) is not exceeded. They will
be truncated if this is limit is exceeded. The characters are displayed in the top right hand corner of
the text entry screen to assists in this process. There is no limit to the length of text messages used
with data-logging, however, the longer the messages the more memory is used and thus the
quicker the memory will fill thus reducing the length of time before the memory wraps around and
older records are lost.
The values of internal memory variables can be inserted into the text messages. To do this, select
the required variable from the drop-down Variable box and then select the Insert button.

The text message must be formatted if variables are inserted. The syntax for this
formatting is described below.
The format of the variable to be sent is important and is determined by using the following format:
%YZ###### (%MWaaaaa)
where the options for YZ are:
D for signed word
U for unsigned word
LD for signed long
LU for unsigned long
F for float.
##### to format for display
(%Mwaaaaa) is the Element ID for the physical address in the AD2000 Series device.
‰ The characters above are not case sensitive so you can use D or d, %MW or %mw etc.
‰ There MUST be a space before and after the brackets in the address i.e.
The message_%YZ######_(%MWaaaaa)_for a 16 bit word
The message_%YZ######_(%MLaaaaa)_for a 32 bit word
is in this format where the underscore _ indicates a space (do not type the _ underscore just
enter a space when writing the text message).
‰ The preceding zeros can be omitted, i.e. you can type (%MW1) rather than (%MW00001)
The example below illustrates this:

© 2007 Miri Technologies All rights reserved. V3.00 4-80


Chapter 4 - MiriMap2000+ Software

In this example, the value of the memory location %MW00001 is a signed 16 bit word with a
maximum of 5 digits and to be sent correctly requires the following format:
%D###### (%MW00001)
Multiple values can be sent in a single message, using the following format:
The value is %ld######## (%ML11) and the other value is %f##.# (%ML21) and the word is
%d### (%MW1)
This displays the actual value as a signed long at %ML11, a float at %ML21 and a signed word at
%MW1.
It is the responsibility of the programmer to define the correct format in the Ladder Logic.
To enter the percent character % to appear in a message you must enter it twice, i.e. %% to
prevent the interface reporting errors and to distinguish between the variable memory address
identifier %MW, e.g.
The value is %ld######## (%ML11) and the other value is %f##.# (%ML21) and the tank level
is %d### (%MW1) %% full
Produces a message (where #### is the actual value in the AD2000 Series device):
The value is ######## and the other value is ##.# and the tank level is ### % full
Once the messages have been created the parcels must be assigned. These would normally be
event parcels unless a periodic polling regime is employed. A continuously polled port will
result in continuous messages being sent and may result in system errors or excessive
service provider costs.
To delete a message, select the required message number and press the Delete Msg button.
Text messages can be exported or imported form simple Comma Separated Variable (.CSV) text
files using the Import Msgs and the Export Msgs buttons.. This allows other software packages
such as Excel to be used to edit the text messages.

As with all import facilities, it is recommended that an initial message be created first using
MiriMap2000+ utility, then it should be exported for further editing so that the correct format is
obtained.

Password

When using the SMS features, enter a 4 digit numerical password to secure the SMS messages.
With this enables, any SMS messages must have the password included before data can be read
or written to the AD2000 Series device.

© 2007 Miri Technologies All rights reserved. V3.00 4-81


Chapter 4 - MiriMap2000+ Software

Options

There are several additional options that can be set per station.
Log Flash Enabled

This should be checked to ensure data-logging will be enabled. Default is ON.


Log Incoming SMS

This should be checked to automatically log every received SMS message when using GSM
enabled AD2000 series devices. Default is ON.
Log Outgoing SMS

This should be checked to automatically log every transmitted SMS message when using GSM
enabled AD2000 series devices. Default is ON.

Phone Details

When using GSM or dialup enabled AD2000 Series devices, several phone number related
parameters are available.
IDD Number

This is the International Direct Dialing for the country in which the AD2000 Series device is
installed. It should only be set when the dialling is across international borders (e.g. 61– Australia,
60 - Malaysia, 1 - USA, 44 - UK, 64 - New Zealand etc. - consult your local white pages or
telecommunications carrier for details on other countries).
Primary (Data) Number

This is the first phone number to be dialled. If only the primary phone number is defined (i.e. no
secondary) then the retries (if specified) will repeat to that number.
For dialup systems when retries occur and a secondary number is specified each retry attempt will
toggle between the primary and secondary numbers. For example, if the primary number is dialled
and fails to connect the secondary number is dialled next. If that fails to connect then the retries are
attempted. First there is a time delay (as specified in the Dial Again Time). For the first retry, the
primary number is dialled again and if that fails the secondary is dialled again. This repeats until the
number of retries has been exceeded. If continuous retries are selected then this toggling retries
forever, until a connection is made. In the case of event parcels in such a scenario, the event buffer
will overflow and further events will be lost. It is advised that continuous retries be used on point to
point systems only.
Secondary Phone or SMS Num

The secondary backup number to dial if the first fails to connect.


Modify Call Table

Select this button to display the Modify Call table screen.

This allows the order of the primary and secondary number to be swapped.

© 2007 Miri Technologies All rights reserved. V3.00 4-82


Chapter 4 - MiriMap2000+ Software

Pulse Options

The AD2000 Series devices can count high speed digital pulses up to a maximum of 5kHz. In order
for the pulses to be enabled ensure these check boxes are on.

The hardware requires the jumper settings indicated to be adjusted as well. The jumper
numbers and positions are different between the AD2000 and AD2006.
Pulse on Input 1

Check this to enable high speed pulse counting on Digital Input 1. The ladder logic High Speed
Counter and High Speed Rate function blocks must be used in conjunction with these inputs.
Pulse on Input 2

Check this to enable high speed pulse counting on Digital Input 2 (AD2006 only). The ladder logic
High Speed Counter and High Speed Rate function blocks must be used in conjunction with these
inputs.

Ports
Each AD2000 Series device has several communication ports available for connecting them across
wireless and wired networks. The ports tab is used to configure the settings associated with each
port for correct operation.

The default settings for the ports should always be used. They have been adjusted and
tested to operate with typical hardware and software applications.
The AD2000 has up to 3 ports available. Refer to the hardware section Which Port is Which for
their physical position on the hardware device.

The AD2006 has up to 5 ports available. Refer to the hardware section Which Port is Which for
their physical position on the hardware.

© 2007 Miri Technologies All rights reserved. V3.00 4-83


Chapter 4 - MiriMap2000+ Software

Each port is selected by a menu tab and the settings accepted by pressing the Apply button once
they have been adjusted.
There are 4 areas to the ports properties forms and for some of the interface options available
these will display setting that may require adjustment.

‰ 1 - General settings is common to all ports and allows the general protocol and interface
operational parameters to be set.
‰ 2 - Protocol Options is protocol specific.
‰ 3 - Comms is common to all ports and allows adjustment of the communications properties.
‰ 4 - Interface Options is interface specific.

Port General Settings

Protocol

This field presents a drop down property box to select the various protocols available for the port.
Select the arrow on the right hand side of the property box to display all the available options.
Position the mouse cursor over the required option and select.

© 2007 Miri Technologies All rights reserved. V3.00 4-84


Chapter 4 - MiriMap2000+ Software

Interface

This field presents a drop down property box to select the various physical interfaces available for
the port. Select the arrow on the right hand side of the property box to display all the available
options. Position the mouse cursor over the required option and select. For example, on the Port1
(INT/EXT) port, selection of an internal or external radio is available. All wireless module options
are typically assigned to this port. Hardware settings and jumpers may be required as well as the
software setting made here.
Polling

This field presents a property box to select the various polling methods available for the port. Select
the arrow on the right hand side of the property box to display all the available options. Position the
mouse cursor over the required option and select. Refer to the section on Data Gathering
Techniques to understand these options.
Poll Period

When periodic polling is selected, enter the polling period in the entry fields, assigning periods of
days, hours, minutes or seconds or any combination.
Link Failure Timeout

This is only relevant when the station is set to No poll. Enter the period after which a link has been
determined as failed in the entry fields for periods of days, hours, minutes or seconds or any
combination.
The station Link Healthy bit (which is internal to the unit based on the identifier number) is set to
ON whenever it receives a valid message for itself (i.e. for its assigned station identifier number). If
the polling station stops sending messages (for whatever reason e.g. if the slave radio has failed
etc.) the slave unit will never receive a valid message. It can only determine that the link has failed
based on a timeout and this setting allows the user to enter a suitable timeout value. Each time a
valid message is received the timeout timer is reset. If the fields are all set to 0 this ensures that the
timeout timer never starts so the link is always healthy (after receiving at least one valid message).
Note that this is for the link healthy bit for the slave station. At the polling master the same bit is set
in the polling Master based on the number of retries and failures.
Telephone Timeout

This is only relevant when the station is set to use dialup modems. Enter the period after which a
phone link has been determined as failed in these entry fields for periods of days, hours, minutes or
seconds or any combination. The modem will be re-initialised after this timeout period. Do not set
this to zero otherwise the line may never hang up and excessive call charges could result.

Port Protocol Options

These options will different depending on the protocol and interface settings for the port.
Packet

This is the packet mode used on the interface and is either Binary or ASCII.

Port Communications Options

Baud Rate

This field presents a property box to select the various baud rates available for the port. Select the
arrow on the right hand side of the property box to display all the available options. Position the
mouse cursor over the required option and right click to select. Hardware setting may also be
required (e.g. changing the internal/external radio baud rate between 1200, 24000 and 4800 baud
requires jumper changes as well.

© 2007 Miri Technologies All rights reserved. V3.00 4-85


Chapter 4 - MiriMap2000+ Software

Parity

This field presents a property box to select the various parity settings rates available for the port.
Select the arrow on the right hand side of the property box to display all the available options.
Position the mouse cursor over the required option and right click to select.
Stop Bits

This field presents a property box to select the various stop bit options available for the port. Select
the arrow on the right hand side of the property box to display all the available options. Position the
mouse cursor over the required option and right click to select.
Data Bits

This field presents a property box to select the various data bits formats available for the port.
Select the arrow on the right hand side of the property box to display all the available options.
Position the mouse cursor over the required option and right click to select.
Key Up Time (ms)

This is the time delay before data is sent after initiating a parcel transmission. It is used to ensure
radio transmitters are actually transmitting before sending data. Typical values for the internal
radios are 60msec and for external radios 250msec. This value must be longer than what may be
termed the "radio rise time" or "transmitter turn on" value. Check the radio specifications for this.
Key Down Time (ms)

This is the time delay after data is sent on parcel transmission. It is used to ensure radio
transmitters are actually off before proceeding to the next transmission. Typical values for the
internal radios are 20msec. Check the radio specifications for details on this parameter.
Reply Timeout (ms)

When a parcel is transmitted a certain time must elapse to allow the reply acknowledgment to
come back. In repeater or store and forward based systems this reply time will get longer the more
repeaters or store and forward stations there are. It also depends on the baud rate and the radios
used. Typical values for this setting will be 1000 millisecs but the parameter can be adjusted
accordingly. For direct RS232 serial links this can be reduced. Each retry on failed
acknowledgments to transmitted messages will be delayed by this reply timeout period and thus
can extend the polling time. Adjusting the reply timeout to be too short may result is reply
messages being missed (because you are not waiting long enough) and premature retires being
sent which will cause collisions with the acknowledgment parcels.
Idle Chars

This field is used to detect the end of a packet. The value which is entered in this field is based on
the number of characters that the port waits for after the last character before it is considered to be
the end of the packet. This figure is converted to actual time in milliseconds within the AD2000 unit.
Num Tries

When the port is set to either Continuous or Periodic polling the Num Tries field sets the number of
retries attempted when a parcel does not get a reply acknowledgement within the time set in the
Reply Timeout period. Valid entries allowed are 0-255.
If you have events triggered at a station set to No poll and they do not get responded to by the
receiving station, the event parcel will be sent again up to the number of retries set by the Num
Tries field. No repeat of this as defined in the Num Failures field is performed as in polled parcels.
This minimizes events choking the system.
Num Failures

When the port is set to either Continuous or Periodic polling the Num Failures field sets the number
of times the polling cycle is repeated with retries when a parcel does not get a reply
acknowledgement. Valid entries allowed are 0-255.

© 2007 Miri Technologies All rights reserved. V3.00 4-86


Chapter 4 - MiriMap2000+ Software

For example, if a polled station does not reply and the Num Tries field is set to 3, three retries will
be attempted on that polling cycle. If no reply is received after the three retries, the polling cycle
continues to poll other stations in the system. In the next polling sequence these retries will be
attempted again if no reply is received. This process will continue up to the number of times
specified in the Num Failures field. After that the link healthy bit for that station will be set OFF.
CTS Handshake

Checking this will enable Clear To Send handshaking for RS232 serial communications. This NOT
available on Port 1 (INT/EXT) port.
RTS During TX

Checking this will enable the RTS Request To Send pin to enable transmitter control for RS232
serial communication links to radio modems. This is NOT available on Port 1 (INT/EXT) port. It is
required for I/O Expansion modules where the M232-485 converter is used to ensure correct
operation of the data cable link between the AD2000 Series device and the I/O Expansion
modules.
Radio Type

For viewing scaled values on the Watcher the calculations for Radio Diagnostics RD-1, RD-2 and
RD-3 differ for 400MHz and 900MHz radio types. Adjust this option when 900MHz radio types are
used.

Port Interface Options

Some interface options have additional parameters that have to be set for the port to function
correctly.
GPRS Modem

The GPRS modem interface settings are a follows:

IP Address - The static private IP address of the SIM card obtained from the telecom service
provider. This is essential to ensure the parcels are routed to the correct device.
IP Port - The TCP or UDP port being used. Typically this must be an unreserved number, any
number above 10000.
UDP - Set this on if UDP framing is to be used . UDP will reduce the byte count on transmissions
by about 20 bytes and thus can reduce data costs if they are based on byte counting.
TCP - Set this on if TCP framing is to be used. TCP is the most common framing.
GPRS Server Address (APN) - The Access Point Name assigned by the telecom service provider.
This is essential to ensure attachment to the correct GPRS network.
GPRS Username - Some telecom service providers require a username to gain access to the
network. If none is provided, leave blank.
GPRS Password - Some telecom service providers require a password to gain access to the
network. If none is provided, leave blank.
Continuous - Set this on for point to point connections. The interface will attempt to re-establish
any detached network connections.
Number Retries - Set this for the number of retries the interface will attempt to make a connection.

© 2007 Miri Technologies All rights reserved. V3.00 4-87


Chapter 4 - MiriMap2000+ Software

Caller ID - Used to ensure correct connections on dialup and GPRS when multiple device can
access the same network. The default settings are based on the station identifier number and
should be accepted to avoid problems however, the caller ID can be any combination of alpha-
numeric characters and/or the character '_' (underscore).
Some HMI products support this method of remote station identification on dialup and GPRS
networks. By using this Caller ID, the HMI will receive a unique caller ID for each AD2000 Series
device.
Dial Again Time - The delay period in seconds between timeout retries.
Send caller ID on Connect - This will ensure that the Caller ID character is sent to the remote
station prior to any parcels. This ensures correct connections when multiple device can access the
same network. Some software HMI products do not support caller ID and thus this can be turned
off.
Receive caller ID on Connect - This will ensure that the Caller ID character is expected to
precede any parcels on a connection. This ensures correct connections when multiple device can
access the same network. Some software HMI products do not support caller ID and thus this can
be turned off.
Send time on Connect - Use this on Master polling systems where an AD2000 series device is
the polling master. On each connection the time form the Master real time clock will be sent to the
remote and the remote clock will be updated.
Ethernet

The GPRS modem interface settings are a follows.


IP Address - The static private IP address of the SIM card obtained from the telecom service
provider. This is essential to ensure the parcels are routed to the correct device.
IP Port - The TCP or UDP port being used. Typically this must be an unreserved number, any
number above 10000.
UDP - Set this on if UDP framing is to be used . UDP will reduce the byte count on transmissions
by about 20 bytes and thus can reduce data costs if they are based on byte counting.
TCP - Set this on if TCP framing is to be used. TCP is the most common framing.

Refer to the section on setting up Ethernet for an AD2000 and Ethernet for an AD2006 for further
details.

Parcels
A “Parcel” is the term used in the mapping process to determine how many variables are
transferred between the two sites, via two ports which are connected via a physical link. One site is
determined the Source, the other the Destination. The Source is where the data is being sent
From and the Destination is where the data is being sent To.
There are two types of parcel, Polled and Event. System can be Polled only, Polled with Events
and Event only. Polling parcels are processed by the initiating device which has been determined
the Polling Master. Typically there should only be one polling Master. On some networks it is
possible to have multiple polling masters but due consideration of the network topology and the
possibility for collisions must be considered.
Event based parcels have to be triggered by some condition to be sent. See the glossary item on
Report By Exception systems. This is determined in Ladder Logic. It can be a change of state of a
single bit, a cross over on an analogue set-point or any change in several variables or bits.

© 2007 Miri Technologies All rights reserved. V3.00 4-88


Chapter 4 - MiriMap2000+ Software

In most systems event parcels will operate well in periodically polled systems where there is
sufficient silent time on the network to allow the events to be sent. In systems that are continuously
polling, especially on half duplex radio links, the probability of collisions is high and thus event
parcels may not be able to get across the network.
In systems that have many events triggered by regularly changing variables, extreme collision
conditions will exist. It may be more predictive and responsive system if it were made a polling
system.
Triggering event parcels at the Polling Master to send data to remotes (typically for sending control
bit commands and set-points) is a recommended method to increase overall system response. Any
event parcel will be sent immediately after the current polled parcel has been processed. The poll
sequence re-commences after the event parcel has been sent and thus results in faster system
control and feedback than by sending all parcels to remote using polling only.

Polled Parcels

Polled parcels are sent in sequence based on their numerical order. Once all parcels have been
processed the sequence repeats. This is immediate when the Polling is set to Continuous and
waits until the next poll time period has elapsed when the Polling is set to Periodic Poll. To
create follow the steps below:
‰ Step 1 - Choose Source Station
‰ Step 2 - Choose Source memory Variable
‰ Step 3 - Choose Destination Station
‰ Step 4 - Choose Destination memory Variable
‰ Step 5 - Choose Length (i.e. number of variables to send in a single parcel)
‰ Step 6 - Choose Parcel Type as “Polled”
‰ Step 7 - Choose Source Port

Parcels are built on the basis of defining a source station and a starting memory location, with
a length and then determining the source port. Parcels are always defined at the station where
the parcels are being sent from. This is despite the fact that when the system is running, the
parcels are controlled by the Polling Master device (in this example the Master). This is done to
ensure that the correct source and destination stations are set each time. (This process becomes
more obvious when event parcels are being configured).

The memory variables have to be created prior to parcels being defined.


To create a new parcel, select the Source station, open the Parcels tab and press the New button.
The Parcel Properties form opens.

© 2007 Miri Technologies All rights reserved. V3.00 4-89


Chapter 4 - MiriMap2000+ Software

The Source station cannot be adjusted since it is already the selected station. The Source
Variable has to be determined and in this example the first address available in the list nickname
4x00001 (variable address %MW1) is selected). The Destination station is Station 1. Select this
on the right hand column from the Station drop down box. The Destination Variable has to be
determined and in this example the first address available in the list nickname InBox00001
(variable address %MW1) is selected. Define the parcel length (memory variable block length) by
typing 10 into the Number of 16 bit Words entry box. Finally define the Source Port as being
Port 1, the radio port. The screen is then displayed as follows:

The red highlighted variables indicate those that are being used in the parcel. This warns the user
of parcels already assigned to prevent memory areas being over-written.

When creating parcels it is very important that the correct Source port be chosen. This
is where the parcel data will be sent and a physical link from this port to one of the same
interface type and protocol must also be defined. Refer to the section in this manual where
an example map is built for further information.

For parcels that are denote type “Polled”, the Port must be setup as either
“Continuous” or Periodic Poll” at ONE of the ports for the parcels to be processed. Leaving
them at “No Poll” will result in only event parcels being processed.
Press OK. The following screen shows the newly created parcel.

© 2007 Miri Technologies All rights reserved. V3.00 4-90


Chapter 4 - MiriMap2000+ Software

To view the properties by variable address, rather than nickname, uncheck the option Display
Nicknames on the bottom right hand corner of this screen.

Exchange Parcels

These are a special arrangement that can be configured at the Master polling AD2000 Series
device to “pair” a write polled type parcel with a read poll type parcel. Every parcel, read or write is
sent from the source station to the destination station. The data is transferred and an
acknowledgement is sent back to the source station to confirm the parcel was received correctly.
For a basic write and read parcel transaction there will be 4 parcels sent across the
communications link as follows:
‰ Transaction #1>Master to Slave Write parcel
‰ Transaction #2<Slave to Master Acknowledgement of the Write parcel
‰ Transaction #3>Master to Slave Read parcel
‰ Transaction #4<Slave to Master Acknowledgement of the Read parcel
On a radio based system this will incur some additional time delays as the radios key their
transmitters up to send the data. In a large point to multi-point system it will lengthen the time it
takes to process all remote slaves in the system.
The exchange parcel mechanism allows a Write parcel to be paired with a Read parcel so that the
acknowledgement of the Write is returned with the data for the read. This halves the polling time as
follows:
‰ Transaction #1>Master to Slave Write parcel
‰ Transaction #2<Slave to Master Acknowledgement of the Write parcel with the Read parcel
data
To enable Exchange parcels, there must be at least one write parcel and one read parcel between
each station.

It is recommended that all parcels be created for data transfer so that there is only one write
parcel and one read parcel. For example, create one 10 word parcel rather than 10 one word
parcels. This will ensure the full benefit of Exchange parcels is realized.
Creating Exchange Parcels

In the example below, there are 3 parcels. 2 polled (one write, one read) and an event parcel.

© 2007 Miri Technologies All rights reserved. V3.00 4-91


Chapter 4 - MiriMap2000+ Software

To half the time to transact the two polled parcels, pair the write parcel to the read. First select the
Exchange button (or press Alt+X). All polled parcels will be listed between the master and remotes.
Next, select the write parcel (in this example #1) and then select the read parcel so both are
highlighted:

Press Apply or OK.

The Parcels tab now displays the exchanged details in the Ex column. In the example it can be
seen that Parcel #1, the write is exchanged with parcel #3, the read.
Deleting Exchange Parcels

To delete individual exchange parcels, select the row for the parcel to be deleted. Double click the
parcel number with the mouse located on the Ex column. The prompt will appear:

Press Yes, the exchange is deleted.


To delete all exchange parcels, select the button Delete Exchanges, the prompt will appear:

Press Yes, all the exchanges are deleted.

© 2007 Miri Technologies All rights reserved. V3.00 4-92


Chapter 4 - MiriMap2000+ Software

Event Parcels

Event parcels are built in the same way as polled parcels. They have the same properties of source
and destination station IDs and memory variables. The Parcel type setting is different and they
require Ladder Logic to be written to create the trigger condition to send the parcel. To create
follow the steps below:
‰ Step 1 - Choose Source Station
‰ Step 2 - Choose Source memory Variable
‰ Step 3 - Choose Destination Station
‰ Step 4 - Choose Destination memory Variable
‰ Step 5 - Choose Length (i.e. number of variables to send in a single parcel)
‰ Step 6 - Choose Parcel Type as “Event”
‰ Step 7 - Choose Source Port
‰ Step 8 - Write Ladder Logic to create the trigger condition to send the parcel
‰ Step 9 - Use the Parcel Function Block to select the correct event parcel to trigger
Using the same example for the Polled parcels, an event parcel from the Master station to the
slave remote can be added, this is illustrated in the following diagram:

Parcels are built on the basis of defining a source station and a starting memory location, with
a length and then determining the source port. Parcels are always defined at the station where
the parcels are being sent from. This is despite the fact that when the system is running, the
parcels are controlled by the Polling Master device (in this example the Master). This is done to
ensure that the correct source and destination stations are set each time. (This process becomes
more obvious when event parcels are being configured).

The memory variables have to be created prior to parcels being defined.


To create an event parcel, select the Source station, open the Parcels tab.
It is often useful to have an event version of a polled parcel. This is typical in Periodic Polled
systems where the polled parcel is not being processed continuously. To use this utility, select a
polled parcel, press the Copy button and accept the prompt to create a parcel with the same
parameters. Otherwise press the New button and the Parcel Properties form opens.

© 2007 Miri Technologies All rights reserved. V3.00 4-93


Chapter 4 - MiriMap2000+ Software

The Source station cannot be adjusted since it is already the selected station. The Source
Variable has to be determined and in this example the first address available in the list nickname
4x00001 (variable address %MW1) is selected). The Destination station is Station 1. Select this
on the right hand column from the Station drop down box. The Destination Variable has to be
determined and in this example the first address available in the list nickname InBox00001
(variable address %MW1) is selected. Define the parcel length (memory variable block length) by
typing 10 into the Number of 16 bit Words entry box. In the Parcel Type check the Event type
to ensure the parcel is not sent on the polling cycle. Finally define the Source Port as being Port
1, the radio port. The screen is then displayed as follows:

The grey highlights the start memory variable, the blue highlights the 10 words in the source block,
the red highlights the highlights the 10 words in the destination block (and the green is indicating
that other parcels and ladder logic is being mapped to these blocks).

When creating parcels it is very important that the correct Source port be chosen. This
is where the parcel data will be sent and a physical link from this port to one of the same
interface type and protocol must also be defined. Refer to the section in this manual where
an example map is built for further information.
Press OK. The following screen shows the newly created parcel.

To view the properties by variable address, rather than nickname, uncheck the option Display
Nicknames on the bottom right hand corner of this screen.

© 2007 Miri Technologies All rights reserved. V3.00 4-94


Chapter 4 - MiriMap2000+ Software

To trigger the event the Ladder Logic has to be written.


Select the station icon with the mouse and enter the Ladder Logic edit screen.

‰ Locate the Ladder Logic toolbar icon , Menu Option Toggle Ladder Logic, Press
CTRL+D or right click and select PLC Ladder Logic option.
For full details on the Ladder Logic process and functions and how to edit in this mode, refer to the
chapter on Ladder Logic. For the purpose of this example, a step by step guide will illustrate the
basic methods used.
The Ladder Logic interface must be in edit mode to make any changes. Right click the mouse key
and select Edit Mode or press Ctrl+E or highlight the tool bar icon .

The edit area will now be shaded black. Then select the Function Block toolbar option icon and
the following screen should display:

Scroll down until the Change Detect CHD Function Block is selected and press OK showing:

In this example, the trigger will be any bit change (on to off and off to on) of any of the 10 words in
the parcel block. This allows digital changes to bit packed words to Select Input V, locate the
Variable required (in this case a variable with nickname 4x00001, memory location %MW1). Select
DV, check the Constant check box and enter 1 into the form. Select N check the Constant check
box and enter 10 into the form. Ensure that Delta is checked at the top right hand corner to ensure
rising and falling digital states trigger the event.
Press OK.
Position the mouse cursor to the next right hand column. Scroll down until the Parcel Function
Block is selected and press OK showing:

© 2007 Miri Technologies All rights reserved. V3.00 4-95


Chapter 4 - MiriMap2000+ Software

Select the parcel number to be used. In this example there is only one, however in larger system all
event parcels available in the station will be available and careful selection of the desired parcel is
required. Press Select and the following logic should be seen.

Leave the Ladder Logic screen to get back to the map window by menu option PLC Ladder Logic
(or press Ctrl+D or select the icon ). Answer Yes to jumping back the main screen from edit
mode if this was the case.
Save the project file.
Compile and write the configuration to the hardware for the changes to be enabled.

Event LOG Parcels

Event SMS Parcels

Compile
The Compile Properties tab allows a completed map to be compiled ready for writing to the
AD2000 Series device hardware.
Where compile errors are detected, the Download Map button will remain shaded, ensuring that an
incorrect map cannot be loaded into the unit.
The Compile tab is illustrated in the diagram below:

© 2007 Miri Technologies All rights reserved. V3.00 4-96


Chapter 4 - MiriMap2000+ Software

Write Map (Transmit To)

To verify the correct software configuration, select the required station icon in the map.

An important issue should be understood at this stage. Due to the remote connectivity
capabilities in networked AD2000 series devices, the correct station in the MiriMap2000+
configuration file must be chosen prior to any communications commence to ensure the correct
device is written to.
Consider the point to multi-point map as follows:

Selecting the Master (highlighted in red) sets the station identifier number of the AD2000 Series
device that MiriMap2000+ will request prior to any communications. If the communication link from
the PC running MiriMap2000+ to the station is directly connected to this station then a local
connection will be established. No remote connection is required.
However, if any of the other stations are selected (highlighted in red) and the communication link
from the PC running MiriMap2000+ is still directly connected to the Master station, this indicates
that a remote connection is required. The initial station identifier request will be routed via the local
connection onto the wireless connection and all communications, if successful, will be via the route
until another station identifier is selected in MiriMap2000+.

© 2007 Miri Technologies All rights reserved. V3.00 4-97


Chapter 4 - MiriMap2000+ Software

Open the Compile tab. Press the Compile button. If the map has been configured with no major
errors the area for Compilation Messages will look similar to the following diagram.

Now connect the communications cable to the AD2000 Series device. For an AD2006 this can be a
USB2.0 cable, for the AD2000 this needs to be an RS232 cable (set to Baud rate - 38.4k, Parity -
None, Stop bits - 1, Data bits - 8). USB to RS232 converters can be used, however, to identify the
ports assigned to these, ensure that the Project Comms Port Wizard is selected. To locate the
correct programming port on the AD2000 Series device hardware, refer to the section on default
programming ports. Select the Write Map (Transmit To) button. The Communication Port selector
window will appear. Choose the correct port for the connected USB, Ethernet or COM port.

Press OK. The identifier number of the connected hardware is verified first. If this is different from
the identifier number defined in the map a warning prompt will appear as follows:

© 2007 Miri Technologies All rights reserved. V3.00 4-98


Chapter 4 - MiriMap2000+ Software

To write to the locally connected device choose the default first option “Use the local station and
connect to it” and press OK. The second option is only valid if a remote connection is required. If a
remote unit is to be connected to choose the option “Find the station via the network and connect
to it.” This will route the data requests from the MiriMap2000+ software application through the
connected wired port and out onto the wireless connection.
On connection to the correct station (determined when the station identifier numbers match) the
next process continues automatically.
The revision status of the firmware installed in the connected AD2000 Series device is verified first.
If there are differences between the MiriMap2000+ application firmware release version and the
version installed on the hardware, the firmware update prompt will appear. This is essential to
ensure that all the functions used in the software configuration will work correctly with the
hardware.

If the firmware is up to date, these files do not need to be written. A shorter list is displayed
showing only the new configuration files that will be written.

Accept this and press Yes.


The progress of the firmware file writing is displayed.

© 2007 Miri Technologies All rights reserved. V3.00 4-99


Chapter 4 - MiriMap2000+ Software

During this file writing process, there can be long delays as sectors on the EEPROM
Flash memory chip are being erased. These can be several seconds long and are normal.
Please do not press cancel.
On completion a message prompt will display indicating the connected station name, the name of
the file that was written and its location on the PC it was written from, the date the file was saved to
the PC and the time it was written to the AD2000 Series device. Details of the firmware file version
follow this.

The hardware has now been updated. Press OK and repeat for the other Station 1.

For radio based systems the internal radio may require the installed frequencies to be set
before the two devices will communicate. To verify these are correct refer to the section of
programming the internal radios.

Get Clock

Selecting this button will read the real time clock for the AD2000 Series device selected in the
Network Map Window. A working communications connection to the AD2000 Series device must
be available. For an AD2006 this can be a USB2.0 cable, for the AD2000 this needs to be an
RS232 cable (set to Baud rate - 38.4k, Parity - None, Stop bits - 1, Data bits - 8). USB to RS232
converters can be used, however, to identify the ports assigned to these, ensure that the Project
Comms Port Wizard is selected. To locate the correct programming port on the AD2000 Series
device hardware, refer to the section on default programming ports.
This process can only be completed via a port configured for the Miri2000 protocol.

Set Clock

Selecting this button will synchronise the real time clock for the AD2000 Series device selected in
the Network Map Window to the attached PC clock time. A working communications connection to
the AD2000 Series device must be available. For an AD2006 this can be a USB2.0 cable, for the
AD2000 this needs to be an RS232 cable (set to Baud rate - 38.4k, Parity - None, Stop bits - 1,
Data bits - 8). USB to RS232 converters can be used, however, to identify the ports assigned to
these, ensure that the Project Comms Port Wizard is selected. To locate the correct programming
port on the AD2000 Series device hardware, refer to the section on default programming ports.
An option to broadcast the PC time to all slave AD2000 Series devices that can receive the
broadcast message is available (this applies to radio based systems). The prompt "Synchronise
time on all units?" will appear each time that the set clock option is chosen. If the "Yes" default
option is chosen, the time set command is sent to all units and the local clocks at each receiving
unit will be updated. If the "No" option is chosen, only the local connected unit clock will be
updated. Note that the broadcast command sent to update all the clocks will not result in a reply
from any of the remote units and the time set will be subject to the delay time to transport the
broadcast message (in the order of up to 1 second).
This process can only be completed via a port configured for the Miri2000 protocol.

Clear Memory

Select this button to clear all variable memory in the first 60k words of physical memory in the
connected AD2000 Series device. See the variable memory map for details. A working
communications connection to the AD2000 Series device must be available.

© 2007 Miri Technologies All rights reserved. V3.00 4-100


Chapter 4 - MiriMap2000+ Software

This clears the retentive memory area as well! If this retentive memory is to be
retained, clear memory manually using a watcher table.

Radio Settings

This applies to the SR type internal radio units only.


Read New Settings from the Internal Radio

Selecting this button will display a blank Program Radio form for the AD2000 Series device elected
in the Network Map Window. A working communications connection to the AD2000 Series device
must be available. For an AD2006 this can be a USB2.0 cable, for the AD2000 this needs to be an
RS232 cable (set to Baud rate - 38.4k, Parity - None, Stop bits - 1, Data bits - 8). USB to RS232
converters can be used, however, to identify the ports assigned to these, ensure that the Project
Comms Port Wizard is selected. To locate the correct programming port on the AD2000 Series
device hardware, refer to the section on default programming ports.

This process must be performed with the AD2000 Series device in RUN mode. It does
not work in program mode. See Mode Switch for further detail.
Initially the data fields are empty. Select the Read Radio button and the radio data settings for the
selected station are read from the AD2000 Series device and displayed as shown in the following
diagram:

The settings are not read from the radio in this process but from internal memory on the
AD2000 series device. These internal memory values are read on an initial start of the AD2000
Series device (power-up or in a transition from program to run).
The parameters on the right-hand side can be changed and written back to the radio when the
Write Radio button is selected.

Please note that there are several radio types available for the internal radio option. The types
allow various frequencies to be programmed in several bands. The correct radio type must be
installed for the frequency band required and they cannot be programmed outside these fixed
bands.
See the section of Technical Specifications for details.
If the type of radio installed does not suit the band required a radio replacement is required.
Contact Miri Technologies for further information on this.

© 2007 Miri Technologies All rights reserved. V3.00 4-101


Chapter 4 - MiriMap2000+ Software

Write New Settings to the Internal Radio

Prior to writing the data to the radio a warning as follows will be displayed. The user must read and
accept this before proceeding.

If accepted, another warning is displayed as follows:

This is to make users aware of the fact that whilst it is possible to change the frequency of a
remotely connected AD2000 Series device, once accepted, the user will no longer be able to
communicate with the remote radio (having just changed the frequency). A connection timeout will
occur and the connection will have to be cancelled. The only way to verify that the new remote
frequency is correct is to change the frequency of the locally connected radio to match the new
frequency or use another radio tuned to that frequency and physically swap the radios over in the
local AD2000 Series device. This would only have to be done if multiple remote radios are to be
changed.
Saving Radio Settings to the Map File

Saving frequency settings is also possible at this screen. To save any settings to the map file for
the current project the following steps must be taken, noting that the displayed values shown in this
form were the last values saved to disk in this map.
‰ To verify or update press the Read Radio button.
‰ After reading radio parameters, to Save the new radio parameters to the map file you MUST
follow the next four steps:
‰ Step 1 - Press the Save button, then
‰ Step 2 - Press the Close button, then
‰ Step 3 - Press the OK button on the main station Properties form. (If you press Cancel the
data will not be saved to file).
‰ Step 4 - Ensure that you save the file before quitting the programming software.

This feature can only be used if the Internal Radio option is fitted in the factory. It does not
work with external radios and radio modems.

© 2007 Miri Technologies All rights reserved. V3.00 4-102


Chapter 4 - MiriMap2000+ Software

Using pre-defined Frequency and Band Plan settings

Some countries have specific pre-defined band plans for radio frequencies and power output.
Where these have been defined, they are available via the Select Country and Select Channel drop
down boxes. Where several channels are available for use, please verify that the channel chosen
is the correct assignment for the system that the AD2000 Series device is to be used on. You must
also verify that the power setting is correct since manual adjustments made after this pre-defined
selection will over-ride the default values.
Radio Power Settings Look-up table

In advanced mode fine power adjustments to radio power settings are possible. The radio power
settings are set in units of milliwatts via the TX Power Level (mW) box. However, the actual values
cannot be set to 1mW resolution (i.e. exactly between 0 and 5000mW) as the radio power setting is
programmed based on a look-up table. consisting of 11 rows of 16 steps. The table is shown in the
following table.
Table 21 - Radio Power Settings

For example to set to radio power to 1 Watt, if the value 1000mW was written into the TX Power
Level (in milliwatts - mW) box the actual value written to the radio will be 990mW. This explains
why on writing 1000mW, when read back the value is 990mW. The actual effect of the 10mW
difference in terms of transmitted power and resultant signal strength at the receiving radio is
minimal and should not be a cause of concern.
The use of settings 90-9F and A0-AF in the last 2 rows is not recommended. This is for the
Advanced Mode setting for radios only.

Firmware Version

This will read back the firmware version strings from the station selected in the Map window. A
working communications connection to the AD2000 Series device must be available.
Please be patient during the process, it can take several seconds as each sector of the AD2000
firmware flash chip is located and read to determine the version data.
Ensure that there is a physical connection to the AD2000 unit from which you wish to read the
firmware data.

Map Info

This option reads configuration map information stored in the connected AD2000 Series device. A
working communications connection to the AD2000 Series device must be available. The data
returned will indicate the MiriMap2000+ map file name that is currently loaded into the unit, the
date that file was created (the last time and date the map file was saved to disk) and the time and
date the map was downloaded to the unit. This is useful to verify that the correct map has been
loaded and to determine when changes have been made.

© 2007 Miri Technologies All rights reserved. V3.00 4-103


Chapter 4 - MiriMap2000+ Software

Connected To

This option reads configuration map and device identifier information stored in the connected
AD2000 Series device. A working communications connection to the AD2000 Series device must
be available. This is useful to determine which identifier number has been loaded to an AD2000
Series device.

Station Properties - I/O Expansion Type devices


The station type associated with AD2000 Series devices is shown below:

The I/O Expansion modules have to be configured in the Mirimap2000+ map file to allow correct
links and parcels to be determined for data transfer. All the I/O Expansion module status points are
mapped to fixed internal memory locations in the AD2000 Series device they are connected to.
IO Expansion modules can only be configured to connect to an AD2000 Series device. Although
the IO Expansion modules support the Modbus protocol as well, this is for use with other Modbus
master devise or on an AD2000 Series device configured as a Modbus master. This software
interface explained in this manual is only for use with the default Miri2000 protocol. The steps to
transfer the IO Expansion data to this AD2000 are:
‰ Step 1 - Create the IO Expansion module station in the map
‰ Step 2 - Create a link between the IO Expansion module station and the AD2000 Series
device that the data from the expansion modules is to be transferred between. Ensure that
this is defined for the correct port on the AD2000 Series device for correct operation and that
the AD2000 Series device interface is also set to IO Expansion (this ensures default port
settings are made for correct operation).

© 2007 Miri Technologies All rights reserved. V3.00 4-104


Chapter 4 - MiriMap2000+ Software

Default settings are: Protocol - AD2000, Interface - IO Expansion, Baud rate - 38.4K,
Parity None, Stop Bits - 0, Data Bits - 0. RTS During Tx - ON.

Note that on an AD2000 there is no on-board RS485 port so the interface setting is
RS232 - Miri2000 and an external RS232 to RS485 converter is required (available
from Miri technologies (Part NumberM232-485).
‰ Step 3 - Configure the order of the IO Expansion modules in the set-up form in the IO
Expansion station.
‰ Step 4 - Set the IO Expansion modules addressing via the hardware switches to match this
order.

General
This section sets the general properties associated with the station for this type of device.

Station Name

Add a suitable description for the I/O Expansion modules to clearly identify them in the Network
Map Window.

© 2007 Miri Technologies All rights reserved. V3.00 4-105


Chapter 4 - MiriMap2000+ Software

Type

When any station is first created in MiriMap2000+ it defaults to the AD2000 type. This must be
changed to IO Expansion by selecting the type name from the drop down box on the General -
Type form as shown in the following diagram:

Description

This is a text box where further details about the I/O Expansion modules or station can be added to
give more information or to add notes or revision notes.

Setup Expansion
Select this button to set up the I/O Expansion modules. If no physical link has been created, a
request to create one is prompted:

Select the station that the I/O expansion modules are going to be connected to. Press OK.

An AD2000 type station must be created first so that the IO Expansion type station can be
connected to it. See the section on AD2000 Series Type devices for further details on setting up
this type of station.
The blank IO Expansion Parcels form will open.

Select each row, which represents the ID numbers for the IO Expansion modules. Double click or
press Properties to open the IO Unit Parcel Properties form:

© 2007 Miri Technologies All rights reserved. V3.00 4-106


Chapter 4 - MiriMap2000+ Software

Add a suitable name if required (e.g. Panel name) then check the required Expansion Type to
match the hardware to be placed at ID=1. Note the hardware DIP switch settings and if possible set
the hardware now. Press OK.
Repeat this process for all I/O Expansion modules.

It is highly recommended to start at 1 and add module progressively and leave no


gaps.
As the modules are added the table is extended up to the total of 32 addresses (the maximum
number of IO Expansion modules possible on any single AD2000 Series device port). This is
shown below:

Parcel creation for the IO Expansion modules is automatic.


The memory locations are available from memory variable %MW59136 and this is labelled
[Expansion 01-1]. There are 8 integers memory location per IO Expansion address. All memory
variables for the IO Expansion modules are allocated in a contiguous block which is 8 times 32
words long. This allows each “slot” to accommodate the maximum number of “channels” which is 8
(to accommodate the 8 channel analogue input module). The maximum number of IO Expansion
modules that can be addressed is 32. For digital IO Expansion modules, only the first memory
variable for each “slot” is used, with all 16 digital points in the single integer memory location.
The memory addressing blocks are detailed in the section on system variables. To view these in
any station, ensure that the Expansion Variables option is checked to make them visible.

Should the IO Expansion module IO status be required in Ladder Logic or for data transfer
across ports further programming is required to configure the memory. It is advisable to transfer all
data across a radio network in contiguous blocks with minimal wastage so use Ladder Logic Move
function block to ensure this for efficient data transfer along with any other memory variables that
are required to be transmitted across the network.
If you change the order of the IO Modules in the future the memory variables will have to be re-
mapped to suit the new order and any Ladder Logic may need to be changed. It is not
recommended to change the I/O Expansion module order once changed.

© 2007 Miri Technologies All rights reserved. V3.00 4-107


Chapter 4 - MiriMap2000+ Software

IO Expansion Hardware DIP Switch Settings


The hardware devices must be set to the correct DIP switch settings for baud rate (38400 is the
default), protocol (the default is Miri2000 but Modbus RTU is available) and each module must
have a unique device ID address. These settings are illustrated as shown below:

Figure 33 - IO Expansion Hardware DIP Switch Settings

© 2007 Miri Technologies All rights reserved. V3.00 4-108


Chapter 4 - MiriMap2000+ Software

IO Expansion Wiring Details


The following RS485 and power wiring requirements must be met for correct operation.

Figure 34 - IO Expansion Wiring Details

© 2007 Miri Technologies All rights reserved. V3.00 4-109


Chapter 4 - MiriMap2000+ Software

IO Expansion Module Terminal Details and Specifications


The various modules have the following terminal details and specifications.

Up to 32 I/O Expansion modules can be supported on one AD2000 Series Device port
This is subject to the use of correct RS485 cabling and termination.

16 point low voltage digital input module - Part Number M16-LN

Figure 35 - M16-LN 16 Point Low Voltage Digital Input Module - General Arrangement

Figure 36 - M16-LN 16 Point Low Voltage Digital Input Module - Wiring Schematic
The various specifications for this module are shown in the following table:
Table 22 - M16-LN 16 Point Low Voltage Digital Input Module - Specifications
M16-LN 16 Point Low Voltage Digital Input Module
Dimensions WxLxH 57 x 157 x 50mm
Inputs per module 16 opto-isolated
Input voltage range 10-50 Voltage AC or DC
Input impedance 4k7 ohms
Commons per module 2 separate groups of 8
Isolation 3.5kV
Module supply voltage 10-30VDC
Module power drain No inputs driven - 200mW

© 2007 Miri Technologies All rights reserved. V3.00 4-110


Chapter 4 - MiriMap2000+ Software

16 point high voltage digital input module - Part Number M16-HN

Figure 37 - M16-HN 16 Point High Voltage Digital Input Module - General Arrangement

Figure 38 - M16-HN 16 Point High Voltage Digital Input Module - Wiring Schematic
The various specifications for this module are shown in the following table:
Table 23 - M16-HN High Voltage Digital Input Module - Specifications
M16-HN 16 Point High Voltage Digital Input Module
Dimensions WxLxH 57 x 157 x 50mm
Inputs per module 16 opto-isolated
Input voltage range 70-130 Voltage AC or DC
Input impedance 27k ohms
Commons per module 2 separate groups of 8
Isolation 3.5kV
Module supply voltage 10-30VDC
Module power drain No inputs driven - 200mW
All inputs driven - 1.2W

© 2007 Miri Technologies All rights reserved. V3.00 4-111


Chapter 4 - MiriMap2000+ Software

16 point relay output module - Part Number M16-TR

Figure 39 - M16-TR 16 Point Relay Output Module - General Arrangement

Figure 40 - M16-TR 16 Point Relay Output Module - Wiring Schematic


The various specifications for this module are shown in the following table:
Table 24 - M16-TR 16 Point Relay Output Module - Specifications
M16-TR 16 Point Relay Output Module
Dimensions WxLxH 57 x 157 x 50mm
Output current capability 2A@30VDC or 240VAC
Commons per module 2 separate groups of 8
Total output capability 10A per common
Isolation 3.5kV
Module supply voltage 10-30VDC
Module power drain No inputs driven - 200mW
All inputs driven -1.2W

© 2007 Miri Technologies All rights reserved. V3.00 4-112


Chapter 4 - MiriMap2000+ Software

8 channel analog input module - Part Number M8-AD

Figure 41 - M8-AD 8 Channel Analogue Input Module - General Arrangement

Figure 42 - M8-AD 8 Channel Analogue Input Module - Wiring Schematic


The various specifications for this module are shown in the following table:
Table 25 - M8-AD 8 Channel Analogue Input Module - Specifications
M8-AD 8 Point Analogue Input Module
Dimensions W x L x H 57 x 157 x 50mm
Inputs per module 8 Channels
Input current range 0-20mA or 4-20mA
Input voltage range 0-5V or 1-5V
Input impedance 250 ohms (current mode)
Resolution 12 bits
Accuracy 0.1%
Linearity 0.1%
Module supply current 10 - 30VDC
Module power drain Idle 200mW

© 2007 Miri Technologies All rights reserved. V3.00 4-113


Chapter 4 - MiriMap2000+ Software

Station Properties - Other Protocol Type devices


There are several protocols supported by the AD2000 Series devices which have Master mode
support. This mode is where the AD200 Series device port is initiating the data requests (i.e. the
polling). This requires a station type icon to build the parcels between.

General
This section sets the general properties associated with the station for this type of device.

Station Name

A text description can be used to label the station in the map e.g. PLC 1, VSD 44 etc. and this is
displayed on the Map window and on any properties boxes for that station.

Identifier

The identifier is a unique number assigned to the station in the MiriMap2000+ configuration file. It is
automatically assigned by the software but can be changed by the user (e.g. Station Name Pump 1
can be 1, Station Name Pump 52 can be 52) but must be unique and no greater than 2048. If an
identifier is manually assigned and it is not unique a warning will be displayed, requiring the change
to be repeated with a unique number.
The first station identifier is always assigned automatically to be 1 but it does not have to be 1, the
user can choose a number scheme to suit their requirements. As new stations are added the
automatically assigned number will be the next lowest number available.

For systems that have less than 100 stations assigned, it is recommended to assign the Other
Protocol Type devices the identifier to be 101 and onwards, where the remotes between at 1-99.
Thus any Other Protocol Type device connected to AD2000 Series device identifier ID=1 can be
101, AD2000 Series device identifier ID=10 can be 110 and so on to AD2000 Series device
identifier ID=99 where the Other Protocol Type device can be 199.
The choice of identifier numbers has a significance because the identifier is used for selection of
Link Status and Poll Select bits. Ensure that the number or word blocks used are assigned
correctly to use these if the number of identifiers is greater than 16. Using block numbers that are
widely different requires more complex parcel mapping to monitor the link healthy and poll select
bits internally to the AD2000 Series devices. Choosing identifiers on 16 point boundaries will
simplify this process.
‰ Link Status/Poll Select bit 1 of block 1 relates to identifier 1

© 2007 Miri Technologies All rights reserved. V3.00 4-114


Chapter 4 - MiriMap2000+ Software

‰ Link Status/Poll Select bit 2 of block 1 relates to identifier 2


‰ Link Status/Poll Select bit 16 of block 1 relates to identifier 16
‰ Link Status/Poll Select bit 1 of block 2 relates to identifier 17
‰ Link Status/Poll Select bit 1 of block 3 relates to identifier 33, and so on.
See Link/Poll Bits for further details on Link Status and Poll Select blocks.

For Other Protocol Type devices, ensure that the correct port is assigned for these Link/Poll
bits to get the correct status points.

Type

The type setting determines what protocol the Other Protocol Type unit is using. The types
supported will be displayed in the drop down box. In most cases this will be represented by the
protocol that the device uses as in many cases the same protocol will suit multiple PLC type units
and third party devices.

PLC Address

Most protocols support multi-drop addressing and this field allows the identifier number associated
with that PLC address to be assigned. It is the address the parcels will be sent to across the
physical link and thus must match the setting in the connected device (which has to be set via other
software or user interface on that device. Consult the user manuals for the Other Protocol Type
device).

Description

This is a text box where further details about the station can be added to give more information or
to add notes or revision notes.

Phone Details

When using GSM or dialup enabled AD2000 Series devices, several phone number related
parameters are available to allow connection to the Other Protocol Type device. These are only
supported if these units support dialup type connections.
IDD Number

This is the International Direct Dialing for the country in which the AD2000 Series device is
installed. It should only be set when the dialling is across international borders (e.g. 61– Australia,
60 - Malaysia, 1 - USA, 44 - UK, 64 - New Zealand etc. - consult your local white pages or
telecommunications carrier for details on other countries).
Primary (Data) Number

The first phone number to dial. If the primary phone number only is defined (i.e. no secondary) then
the retries (if specified) will repeat to that number.
For dialup systems when retries occur and a secondary number is specified each retry attempt will
toggle between the primary and secondary numbers. For example, if the primary number is dialled
and fails to connect the secondary number is dialled next. If that fails to connect then the retries are
attempted. First there is a time delay (as specified in the Dial Again Time). For the first retry, the
primary number is dialled again and if that fails the secondary is dialled again. This repeats until the
number of retries has been exceeded. If continuous retries are selected then this toggling retries
forever, until a connection is made. In the case of event parcels in such a scenario, the event buffer
will overflow and further events will be lost. It is advised that continuous retries be used on point to
point systems only.
Secondary Phone or SMS Num

The secondary backup number to dial if the first fails to connect.

© 2007 Miri Technologies All rights reserved. V3.00 4-115


Chapter 4 - MiriMap2000+ Software

Modify Call Table

Select this button to display the Modify Call table screen.

This allows the order of the primary and secondary number to be swapped.

Station Properties - SMS Type devices


There AD2000 Series devices support the sending and receiving of SMS messages. This requires
an SMS station type icon to build the parcels between and to define the phone numbers for the
SMS devices.

General
This section sets the general properties associated with the station for this type of device.

Station Name

A text description can be used to label the station in the map e.g. PLC 1, VSD 44 etc. and this is
displayed on the Map window and on any properties boxes for that station.

Type

The type setting determines that device is to use the SMS Type facilities. This must be set to SMS
Message.

Description

This is a text box where further details about the station can be added to give more information or
to add notes or revision notes.

© 2007 Miri Technologies All rights reserved. V3.00 4-116


Chapter 4 - MiriMap2000+ Software

SMS Setup

The service provider details are set by pressing the SMS Setup button and by adjusting the
parameters as illustrated in the following diagram:

The Baud Rate, Parity, Stop Bits, Data Bits must match the service provider's requirements. The
Idle characters can be adjusted but normally the default value of 10 is suitable.
The Password is the service provider access password.
The Max Length is the maximum number of characters (a, B, C, 1, % etc.) that the service
provider will permit per message. This is normally 160 characters. If messages are longer than this,
the AD2000 will truncate the message at 160 characters. It is advisable to be aware of this and limit
all messages to be less than the maximum.

Setup SMS Phones

Selecting this button will open a menu to allow all the remote SMS type devices to be defined.

Add

Select this button to create a new SMS number,


Properties

Select a number then this button to edit existing details.


Delete

Select a number then this button to remove a number from the list.
Each SMS Station Information form has the following entries.

SMS Name

Enter a suitable descriptor text to easily identify the SMS user.

© 2007 Miri Technologies All rights reserved. V3.00 4-117


Chapter 4 - MiriMap2000+ Software

Phone Number

Enter the SMS number assigned to the SIM card for this SMS user.
Provider Num

Enter the service provider SMS service centre number here. This is not always required for SMS
services.
Description

This is a text box where further details about the station can be added to give more information or
to add notes or revision notes.

© 2007 Miri Technologies All rights reserved. V3.00 4-118


Chapter 4 - MiriMap2000+ Software

AD2006 - Ethernet Port Set-up


The AD2006 devices have an in-built Ethernet port which can be used to connect to other Ethernet
enabled devices. Prior to use the port must be configured correctly. A utility software packages is
installed at the same time as MiriMap2000+ to allow maximum flexibility in the set-up of the
Ethernet port. Accessing the utility is via the Port Properties menu on each AD2006 device. Please
note, this option is only available to AD2006 devices, not the AD2000. To use the AD2000 with
Ethernet a PCMCIA Ethernet card must be used. See the section on AD2000 Ethernet port set-up
via PCMCIA cards for further details.

There are different firmware options available for the AD2006 XPort Ethernet device. Read the
section on updating XPort firmware for details to identify which firmware is installed and on how to
install different firmware if required.

Device Installer Configuration Utility


First locate the AD2006 in the MiriMap2000+ project file that is to be set-up. Select the station icon,

then double click to get to the Station Properties tab. Select the Ports tab, Port5,

Ensure the Interface option is set to Ethernet, then press the Setup Ethernet button. The
Ethernet port configuration utility called DeviceInstaller will start in a separate window to the
MiriMap2000+ application.

© 2007 Miri Technologies All rights reserved. V3.00 4-119


Chapter 4 - MiriMap2000+ Software

Please note that versions will change from time to time, however, any version from 4.1.0.9 and
upwards will work. Do not use earlier versions.
An initial search for devices is made and those present are displayed. The Ethernet port device in
the AD2006 is known as an XPort-IAP device.

This search is based on the MAC address (Hardware Address) of the Ethernet XPort device.

The units are shipped with an initial IP address of 169.254.45.127 or 0.0.0.0. DHCP Servers
will issue IP addresses to devices as they connect to the network. If there is a DHCP Server
present on the network that the AD2006 is connected to this initial address may be changed to an
IP in the DHCP range.
If not the user must manually set the network address of the PC that MiriMap2000+ is installed on
to the range 169.254.45.xxx, adjust the IP of XPort to one in the required range and then reset the
PC back to the previous range. An example illustrates this.
The AD2006 has an IP address assigned by the factory default of 169.254.45.127. The PC that
MiriMap2000+ is installed on has an IP address of 220.1.1.235 because it is on a fixed IP network
that uses addresses in the range 220.1.1.2 to 220.1.1.254. The two IP addresses cannot connect
to each other. To change the AD2006 Ethernet port IP address to one in the range 220.1.1.2 to
220.1.1.254, the PC LAN settings must first be changed as a temporary measure, to the range
169.254.45.2 to 169.254.45.254 but not 169.254.45.127 (IP addresses must be unique on the
same network).

DO NOT ASSIGN IP ADDRESSES WITH 0 OR 255 IN THE LAST OCTET, e.g.


xxx.xxx.xxx.0 and xxx.xxx.xxx.255. This is because on networks with the subnet mask
255.255.255.0 (typical of most networks), addresses that end with 255 or 0 cannot be used
as host addresses, because an address that ends in 255 is the broadcast address and one
that ends in 0 is the network number.
This is done via Windows networking. Locate Control Panel (Start - Control Panel) and then
Network Connections. Select the LAN connection that is being used to connect to the AD2006.
Right click on the icon and select Properties.

Select the option Internet Protocol (TCP/IP)

© 2007 Miri Technologies All rights reserved. V3.00 4-120


Chapter 4 - MiriMap2000+ Software

Press Properties.

At this stage, write down the current settings so they can be restored.
If a DHCP server is being used, the automatic settings similar in format as below will be shown.

If a fixed IP address is being used, the parameters will be similar to the following:

© 2007 Miri Technologies All rights reserved. V3.00 4-121


Chapter 4 - MiriMap2000+ Software

To allow programming of the AD2006 Ethernet port which is at IP address 169.254.45.127, adjust
the IP Address field to 169.254.45.128. Press OK, Press Close and the new IP address will be
assigned.

Return to the DeviceInstaller and press the Search icon and note that the PC LAN network
setting should have changed and the XPort device can be seen and is Online.

Open the menu items until the device is shown and select the IP addressed unit.

Select the Telnet Configuration tab and press the Connect button.

Press Enter within 3 seconds. If the delay is too long and the screen goes grey then press connect
again. A telnet session to the XPort Ethernet device on the AD2006 is now open.

© 2007 Miri Technologies All rights reserved. V3.00 4-122


Chapter 4 - MiriMap2000+ Software

Please note that the first screen displayed is for the Modbus TCP/IP firmware. The second screen
is displayed when the AD2006 XPort Ethernet device has been set up to support the Miri2000
protocol.

© 2007 Miri Technologies All rights reserved. V3.00 4-123


Chapter 4 - MiriMap2000+ Software

The menu options for Modbus TCP/IP and the Miri2000 protocol differ due to the different options
available for each protocol. In most cases only a few parameters need to be changed for
successful connection.
In this exercise only one parameter need be changed, the IP address.
For the Modbus TCP/IP setup Press 1. For the Miri2000 protocol setup Press 0.
The Line IP Address (169) appears. Key in 220 then press Enter
The Line IP Address (254) appears. Key in 1 then press Enter
The Line IP Address (45) appears. Key in 1 then press Enter
The Line IP Address (127) appears. Key in 222 (or any unique number between 2 and 254 which is
not already assigned on your network) then press Enter.

DO NOT ASSIGN IP ADDRESSES WITH 0 OR 255 IN THE LAST OCTET, e.g.


xxx.xxx.xxx.0 and xxx.xxx.xxx.255. This is because on networks with the subnet mask
255.255.255.0 (typical of most networks), addresses that end with 255 or 0 cannot be used
as host addresses, because an address that ends in 255 is the broadcast address and one
that ends in 0 is the network number.
Accept all other options by pressing Enter three times.
Press S to save the changes. At this point the XPort Ethernet port reboots and is now assigned the
new IP address 220.1.1.XXX. Now repeat the earlier procedure to reset the PC LAN settings and
the XPort will now carry a unique IP address on the same LAN.
At any time changes can be ignored by pressing 8 or Q, depending on the menu options to quit
without saving the changes. This will leave the unit unchanged.

To verify that the device is available a PING can be isused from the Device Installer. Press F4 or
select Tools - Ping on the main menu:

Type in the IP address and press the Ping button. If the device is connected correctly it will respond
with a series of replies and times, unless there is a problem causing the device not to respond
resulting in a series of timeouts.

© 2007 Miri Technologies All rights reserved. V3.00 4-124


Chapter 4 - MiriMap2000+ Software

Check the procedure above was completed, check the cabling, the router and the AD2006 power.
On the AD2000 Ethernet port the left hand LED should be green if connected and the right hand
port should be flashing orange as LAN traffic is present.

Close the Device Installer program.


Return to the AD20006 Port 5 properties tab and write in the values for IP address and IP port,
ensuring the correct mode UDP or TCP is checked (typically TCP is used, further settings in the
XPort Ethernet device on the AD2006 are required for UDP operation).

When the AD2000 Series device power is reset or it goes from program to run mode, these
parameters are read (the TX, Tx and lnk LEDs will flash in sequence for a few seconds). The
parameters can then be read via a serial, USB2.0 or Ethernet program connection to verify the
actual unit settings. To do this, press the Read XPort button.

Please note that the IP settings cannot be set from within MiriMap2000+, press the Setup Ethernet
button to launch the Device Installer utility to perform adjustments.

© 2007 Miri Technologies All rights reserved. V3.00 4-125


Chapter 4 - MiriMap2000+ Software

AD2006 XPort Ethernet Firmware Update


Unless otherwise stated at the time of order, the AD2006 devices are shipped to support Modbus
TCP/IP on the Ethernet port. To support connection to the AD2006 using the Miri2000 protocol,
different firmware must be loaded into the AD2006 Ethernet port. To distinguish the version
installed follow the instructions and identify the firmware version numbers via a Telnet session (see
instructions on using the Device Installer Configuration Utility). The version number is displayed on
the first few lines displayed via the Telnet session.
For Modbus protocol support the firmware is as follows:
Modbus/TCP to RTU Bridge - Software version 02.2 (040728) XPTEX
For Miri2000 protocol support the firmware is as follows:
AES library version 1.8.2.1 - Software version 01.8 (040806) XPTEXE
To update the firmware, use the Device Installer configuration utility to locate the correct IP address
of the device to be upgraded.

It is important the correct device is chosen at this stage, to prevent loading the
firmware to the wrong device. To be sure disconnect all other XPort devices.

Select the Upgrade button. This prompts a step by step Wizard to guide the upgrade process. The
first step allows a previous installation file to be loaded. If this is the first time the upgrade has been
processed, ignore this option and choose the option to create a custom installation by specifying
individual files (the typical option).

Press Next to proceed to step 2.

© 2007 Miri Technologies All rights reserved. V3.00 4-126


Chapter 4 - MiriMap2000+ Software

Press Browse to locate the file required. The firmware files are located in a sub-folder under the
MiriMap2000+ Ver 3.00 installation.
By default this is: \Program Files\Miri Map 2000+ Ver3 (Check if different)
The sub-folders and firmware files are:
For Miri2000 on Ethernet: \Lantronix\Miri2000\xpt03_180_iap.rom
For Modbus on Ethernet: \Lantronix\Modbus\Amxp0230.rom
Choose the correct file and then press Next to go to step 3.

Since there is only one file, select the first option (No other files to install, typical) and press Next.

At this stage the process can be saved for future installations. Typically, choose Next and proceed
to the firmware write process.

© 2007 Miri Technologies All rights reserved. V3.00 4-127


Chapter 4 - MiriMap2000+ Software

If the XPort device is still connected to the LAN, the file will be written and then the unit re-boots to
enable the new files. The write process takes a few seconds, the reboot about 30 seconds. Wait
until the two processes have completed successfully and are highlighted in green as Succeeded.
Press Close and then proceed to the Telnet session to set the device up from the default settings.

AD2006 XPort Ethernet Default Settings

The following settings have to be made from the factory default settings which are found on a new
device or one which has had the firmware upgraded. These must be set to ensure correct
operation of the XPort Ethernet port with the AD2006.
Modbus

Change 2) Serial & Mode Settings, serial Interface from 9600, 8, N, 1, RS232 to:
115200, 8, N, 1, RS232.
Full option listing For Modbus:
Modbus/TCP to RTU Bridge
MAC address 00204A840B38
Software version 02.3 (050420) XPTEX
Press Enter to go into Setup Mode
Model: Device Server Plus+! (Firmware Code:XA)
Modbus/TCP to RTU Bridge Setup
1) Network/IP Settings:
IP Address ................. 220.1.1.104 (** This IP will match the system requirements)
Default Gateway ............ --- not set ---
Netmask .................... 255.255.255.000
2) Serial & Mode Settings:
Protocol ................... Modbus/RTU,Slave(s) attached
Serial Interface ........... 115200,8,N,1,RS232
3) Modem/Configurable Pin Settings:
CP1 ...... Not Used
CP2 ...... Not Used
CP3 ...... Not Used
4) Advanced Modbus Protocol settings:
Slave Addr/Unit Id Source .. Modbus/TCP header
Modbus Serial Broadcasts ... Disabled (Id=0 auto-mapped to 1)
MB/TCP Exception Codes ..... Yes (return 00AH and 00BH)

© 2007 Miri Technologies All rights reserved. V3.00 4-128


Chapter 4 - MiriMap2000+ Software

Char, Message Timeout ...... 00050msec, 05000msec

D)efault settings, S)ave, Q)uit without save


Select Command or parameter set (1..4) to change:

Miri2000:

Change Channel 1, serial Interface from Baud rate 9600, I/F Mode 4C, Flow 00 Baud rate to
230400, I/F Mode 4C, Flow 00, Connect Mode C0.
Full option listing for Miri2000 (Standard Tunnelling):
MAC address 00204A840B38
Software version 01.8 (040806) XPTEXE
AES library version 1.8.2.1
Press Enter to go into Setup Mode
*** basic parameters
Hardware: Ethernet TPI
IP addr 220.1.1.104, no gateway set,netmask 255.255.255.000
(** This IP will match the system requirements)
*** Security
SNMP is enabled
SNMP Community Name:
Telnet Setup is enabled
TFTP Download is enabled
Port 77FEh is enabled
Web Server is enabled
ECHO is disabled
Enhanced Password is disabled
Port 77F0h is enabled

*** Channel 1
Baudrate 230400, I/F Mode 4C, Flow 00
Port 10001
Remote IP Adr: --- none ---, Port 00000
Connect Mode : C0
Disconn Mode : 00
Flush Mode : 00

*** Expert
TCP Keepalive : 45s
ARP cache timeout: 600s
High CPU performance: disabled
Monitor Mode @ bootup : enabled
HTTP Port Number : 80
SMTP Port Number : 25
*************** E-mail *****************
Mail server: 0.0.0.0
Unit :
Domain :
Recipient 1:

© 2007 Miri Technologies All rights reserved. V3.00 4-129


Chapter 4 - MiriMap2000+ Software

Recipient 2:
*** Trigger 1
Serial Sequence: 00,00
CP1: X
CP2: X
CP3: X
Message :
Priority: L
Min. notification interval: 1 s
Re-notification interval : 0 s
*** Trigger 2
Serial Sequence: 00,00
CP1: X
CP2: X
CP3: X
Message :
Priority: L
Min. notification interval: 1 s
Re-notification interval : 0 s

*** Trigger 3
Serial Sequence: 00,00
CP1: X
CP2: X
CP3: X
Message :
Priority: L
Min. notification interval: 1 s
Re-notification interval : 0 s

Change Setup:
0 Server
1 Channel 1
3 E-mail
5 Expert
6 Security
7 Factory defaults
8 Exit without save
9 Save and exit Your choice ?

© 2007 Miri Technologies All rights reserved. V3.00 4-130


Chapter 4 - MiriMap2000+ Software

AD2000 - Ethernet Port Set-up


The AD2000 uses the PCMCIA port to enable Ethernet communications to the device. Not all
PCMCIA Ethernet cards will operate with the AD2000 PCMCIA slot and firmware drivers so the
only recommended type to use is available from Miri Technologies, part number ETH-2907195-
CF1 and described as PCMCIA Ethernet Card ruggedized & adaptor (for AD2000 type 1 module
only). Contact Miri Technologies for pricing and availability. It is recommended that if Ethernet
communications is to be a significant component in the interface between the installed system and
any PLC/HMI or SCADA software control and monitoring system that the AD2006 product be used
rather than the AD2000.
First locate the AD2000 in the MiriMap2000+ project file that is to be set-up. Select the station icon,

then double click to get to the Station Properties tab. Select the Ports tab.

Ensure that the Interface option is set to Ethernet. Enter the settings for IP address, port and mode
in the section Interface Options IP Address.
These settings are loaded to the PCMCIA card when the configuration files is compiled and written
to the AD2000. No further adjustments are required for this card to operate.

© 2007 Miri Technologies All rights reserved. V3.00 4-131


Chapter 4 - MiriMap2000+ Software

Dialup System Set-up


The AD2000 Series products can be used in conjunction with public wired PSTN (Public Switched
Telephone Network) dialup systems. The following sections describe the set-up required.
An example configuration is available in the Examples folder of the MiriMap2000+ installation,
called Dialup Point To Multi-Point Example System.mmf and this can be used as an aid to the
following illustrations in this manual.

Dialup System Configuration Arrangements


Dialup systems can be configured as follows:
‰ AD2000 Series device to device
‰ MiriMap2000+ to AD2000 Series devices
‰ HMI/SCADA software to AD2000 Series device
The following diagrams illustrate these system configurations.

Figure 43 - Dialup System Arrangement - AD2000 Series Device to Device


This system uses the PSTN wired telephone network to connect the remote AD2000 Series
devices to a central monitoring site. The data transactions use parcels, either periodically polled
parcels or event triggered parcels, or a combination of both. Data-logging can also be enabled at
the remote sites and retrieved via the data-log scheduler.
It is possible to use the in-built routing of data parcels to make the connection from the central PC
via the Master AD2000 Series device, however, if the polling cycle is frequent, this may lengthen or
interrupt the poll cycle.
A separate modem link could be used to remain independent of the polling cycle and thus a direct
connection to each remote is possible. Some control of this connection would be required to ensure
that the Master AD2000 Series device is not attempting to connect to the remote station at the
same time as the scheduled connection.

© 2007 Miri Technologies All rights reserved. V3.00 4-132


Chapter 4 - MiriMap2000+ Software

Figure 44 - Dialup System Arrangement - MiriMap2000+ to AD2000 Series Device


This system uses the PSTN wired telephone network to connect the central monitoring site to the
remote. This connection relies on the central monitoring site to have MiriMap2000+ installed to use
the in-built scheduler to handle all data-log retrieval as there is no Master AD2000 Series device to
handle the polling. By inference, this means that the remote sites have data-logging enabled and
configured to supply suitable data with the time stamp applied at the remote site. Further
discussion on the scheduled reading of such data is available in the section on the Scheduler.
Remote monitoring and re-configuration of the memory variables and ladder logic would also be
possible in such a connection.

Figure 45 - Dialup System Arrangement - HMI to AD2000 Series Device

© 2007 Miri Technologies All rights reserved. V3.00 4-133


Chapter 4 - MiriMap2000+ Software

This system uses the PSTN wired telephone network to connect the central monitoring site to the
remote. This connection relies on the central monitoring site to have an HMI software package
installed to retrieve data. By inference, this means that the remote sites have data-logging enabled
and configured to supply suitable data with the time stamp applied at the remote site. That also
requires the HMI software to handle the data in different ways.
The first method would be to use the scheduler to gather the data and store in CSV file format. The
HMI package would then need to be configured to read these files as they are created and transfer
the data to the internal or external databases (e.g. ODBC, SQL. MS Access etc.) for further HMI
processing. This requires development by the integrator. Further discussion on the scheduled
reading of such data is available in the section on the Scheduler.
The second method would be to use an HMI package that supports the Miri2000 protocol for readin
of AD2000 Series connections for real-time and data-log data via direct serial and Ethernet
connections as well as via PSTN and GSM dial-up and GPRS.
The third method would be to write such a protocol driver to support the required commands. A
document is available from Miri Technologies support detailing the Miri2000 protocol and is
available for such development.

AD2000 Series Device Dialup Port Configuration


This dialup interface is available on several ports by selecting the Interface option on the Ports
Properties page for each AD2000 Series device.

Only ports supporting the RS232 hardware interface can use the dialup interface. The USB 2.0
port on an AD2006 is for programming only and does not support a dialup connection via USB type
modems.
The dialup connection on an AD2000 Series device can be a Master or Slave mode connection. In
a Master mode connection, typically the link will be periodically polled. If the dialup link is on a
private line then a continuously connected link is then possible. Any interruption to the link will
result in an attempt to reconnect. In slave mode, the units will respond to any dialup command that
uses the RING parameter.

Master Mode Dialup

The following settings are required to enable an AD2000 Series device to run in Master mode.

© 2007 Miri Technologies All rights reserved. V3.00 4-134


Chapter 4 - MiriMap2000+ Software

The major issues to ensure correct connections are:


‰ The Interface should be set to Dialup.
‰ The polling should be Periodic Polling for Point to Multi-point systems and only
Continuous if a Point to Point system is required.
‰ The Baud rate should match the modem port baud rate and this should be 38.4K, None, 1, 8
by default.
‰ The Reply Timeout (ms) should be 4000 (to allow for the potential long replies, noting that
this may need to be longer on slow links)
‰ The Modem Initialization string is ATH&FL1&D3&C1T%C0X0&Q5&K0E0
‰ The Interface Options field Number Retries is the setting that adjusts the number of
attempts to get a connection if the first attempt fails. The default is 0. Do not confuse with the
Comms Num Tries setting which is the number of retries attempted to send a failed parcel
once connected.
‰ The Interface Options field Dial Again Time (secs) is the time delay between the above
retry dial attempts. This should be long if event parcels are used to allow them to get access
to the line.
‰ A unique Caller ID is required. By default, MiriMap2000+ will derive this from the station
identifier number and this should be used. If changes are made to this, they must be made to
all stations and compiled and written to each station prior to use so that the caller ID entries
are up to date and match.
‰ Send Caller ID on Connect and Receive caller ID on Connect options must be checked.
‰ The Send Time on Connect is an option for the Master only, if the real time clock on each
remote is to be updated on each connection (with the time in the Master AD2000 Series
device).

Slave Mode Dialup

The following settings are required to enable an AD2000 Series device to run in Slave mode.

The major issues to ensure correct connections are:


‰ The Interface should be set to Dialup.

© 2007 Miri Technologies All rights reserved. V3.00 4-135


Chapter 4 - MiriMap2000+ Software

‰ The polling should be No Poll.


‰ The Baud rate should match the modem port baud rate and this should be 38.4K, None, 1, 8
by default.
‰ The Reply Timeout (ms) should be 4000 (to allow for the potential long replies, note this
may need to be longer on slow links). This would only be applicable on event parcels sent
from the slave.
‰ The Modem Initialization string is ATH&FL1&D3&C1T%C0X0&Q5&K0E0
‰ A unique Caller ID is required. By default, MiriMap2000+ will derive this from the station
identifier number and this should be used. If changes are made to this, they must be made to
all stations and compiled and written to each station prior to use so that the caller ID entries
are up to date and match.
‰ Send Caller ID on Connect and Receive caller ID on Connect options must be checked.
‰ The Send Time on Connect is an option for the Master only.

MiriMap2000+ Dialup Configuration


MiriMap2000+ can connect direct to an AD2000 Series device using a dialup modem attached to a
serial COM port on the same PC. This can be used when a dialup connection is required to a
remote AD2000 series device to run a Watcher chart, view Ladder logic online or to remotely re-
configure a device.
Refer to the section Serial Port - Modem Type for details on how to setup the different modem
types.

HMI/SCADA Dialup Configuration


Most HMI and SCADA software packages will support dialup connections to the AD2000 Series
devices. Not all will support the Miri2000 protocol and thus typically the Modbus protocol can be
used. It is beyond the scope of this manual to provide help guides for specific HMI or SCADA
products but the general points below should aid the set-up process.
‰ Use the Slave Mode Dialup settings on the AD2000 Series device.
‰ Match the modem port baud rate at the HMI/SCADA end to the AD2000 Series device end
and these should be 38.4K, None, 1, 8 by default.
‰ Use Caller IDs only if supported in the HMI/SCADA and ensure the entry in the HMI/SCADA
software matches the setting exactly. If not supported uncheck these settings in the AD2000
Series port settings.
‰ If remote connections are periodic and there are event parcels triggering in the interval
between dialup connections, it is advisable to use a separate dialup modem for the events to
dial into the HMI/SCADA. This will minimize the occurrence of the polling dialup line being
busy when events are triggered and thus event messages (typically “important” alarms)
being missed or delayed.
‰ It is recommended to use HMI/SCADA packages that support reading the AD2000 Series
data-log data records. This allows regular data-log profiling of local variables to occur (e.g. a
local analog variable can be scaled and logged every minute but read every hour, giving 60
samples per connection so the variable profile in that hour can be realized at the
HMI/SCADA).

© 2007 Miri Technologies All rights reserved. V3.00 4-136


Chapter 4 - MiriMap2000+ Software

GSM and SMS System Set-up


The AD2000 Series products can be used in conjunction with public wireless GSM (Global System
for Mobiles) and SMS (Short Message Service) systems. The following sections describe the set-
up of the AD2000 Series devices that is required.

For data transfer between AD2000 Series devices using parcels data enabled GSM SIM cards
are required supporting Circuit Switched Data (CSD) services. Typically these come with a
separate data number along with the usual voice number, however some carriers provide both
voice and data services assigned to the same number. Verify this with the GSM service provider.
For SMS only usage, voice based GSM cards can be used.
An example configuration is available in the Examples folder of the MiriMap2000+ installation,
called AD2006 to AD2000 GSM and SMS Example.mmf and this can be used as an aid to the
following illustrations in this manual.

Important Ladder Logic requirements for GSM Internal Modems

If the internal GSM modem module is used in the AD2000 Series devices, an internal
power reset capability is available to reset the modem in the event of modem lock-ups or
network errors. To enable this some one of the digital outputs must used.
‰ For an AD2000 this is fixed at Digital Output 4. It is NORMALLY OFF and turns ON
when resetting.
‰ For an AD2006 this is fixed at Digital Output 8. It is NORMALLY ON and turns OFF
when resetting.
Please note that only the AD2000 Rev 5 PCB boards and above can house the GSM modem
module internally, all earlier versions have to use the modem externally. All AD2006 devices
can house the GSM modem module internally.
AD2000 Rev 4 PCB boards require an additional internal link for carrier detect for the
internal modem to operate correctly. Refer to technical support for details.

© 2007 Miri Technologies All rights reserved. V3.00 4-137


Chapter 4 - MiriMap2000+ Software

Typical GSM/SMS System Configurations


GSM/SMS systems can be configured as follows:
‰ AD2000 Series device to device using Circuit Switched Data (CSD) connections or using
SMS connections
‰ MiriMap2000+ to AD2000 Series devices using Circuit Switched Data (CSD) connections
‰ HMI/SCADA software to AD2000 Series device using Circuit Switched Data (CSD)
connections
The following diagrams illustrate these system configurations.

Figure 46 - GSM System Arrangement - AD2000 Series Device to Device


This system uses the GSM mobile network to connect the remote AD2000 Series devices to a
central monitoring site. The data transactions use parcels, either periodically polled parcels or
event triggered parcels, or a combination of both. Data-logging can also be enabled at the remote
sites and retrieved via the data-log scheduler.
It is possible to use the in-built routing of data parcels to make the connection from the central PC
via the Master AD2000 Series device, however, if the polling cycle is frequent, this may lengthen or
interrupt the poll cycle.
A separate modem link could be used to remain independent of the polling cycle and thus a direct
connection to each remote is possible. Some control of this connection would be required to ensure
that the Master AD2000 Series device is not attempting to connect to the remote station at the
same time as the scheduled connection.

© 2007 Miri Technologies All rights reserved. V3.00 4-138


Chapter 4 - MiriMap2000+ Software

Figure 47 - GSM System Arrangement - MiriMap2000+ to AD2000 Series Device


This system uses the GSM mobile telephone network to connect the central monitoring site to the
remote. This connection relies on the central monitoring site to have MiriMap2000+ installed to use
the in-built scheduler to handle all data-log retrieval as there is no Master AD2000 Series device to
handle the polling. By inference, this means that the remote sites have data-logging enabled and
configured to supply suitable data with the time stamp applied at the remote site. Further
discussion on the scheduled reading of such data is available in the section on the Scheduler.
Remote monitoring and re-configuration of the memory variables and ladder logic would also be
possible in such a connection.

Figure 48 - GSM System Arrangement - HMI to AD2000 Series Device

© 2007 Miri Technologies All rights reserved. V3.00 4-139


Chapter 4 - MiriMap2000+ Software

This system uses the GSM mobile telephone network to connect the central monitoring site to the
remote. This connection relies on the central monitoring site to have an HMI software package
installed to retrieve data. By inference, this means that the remote sites have data-logging enabled
and configured to supply suitable data with the time stamp applied at the remote site. That also
requires the HMI software to handle the data in different ways.
The first method would be to use the scheduler to gather the data and store in CSV file format. The
HMI package would then need to be configured to read these files as they are created and transfer
the data to the internal or external databases (e.g. ODBC, SQL. MS Access etc.) for further HMI
processing. This requires development by the integrator. Further discussion on the scheduled
reading of such data is available in the section on the Scheduler.
The second method would be to use an HMI package that supports the Miri2000 protocol for
reading of AD2000 Series connections for real-time and data-log data via direct serial and Ethernet
connections as well as via PSTN and GSM dial-up and GPRS.
The third method would be to write such a protocol driver to support the required commands. A
document is available from Miri Technologies support detailing the Miri2000 protocol and is
available for such development.

AD2000 Series GSM Port Configuration


This GSM interface is available on several ports by selecting the Interface option on the Ports
Properties page for each AD2000 Series device and selecting GSM Modem.

By accepting the default settings, the link to supported modems will work correctly. To
ensure that the default settings are in use, change the interface to another type (e.g. RS232)
from the Interface drop down box, repeat this re-selecting the GSM Modem option from the
Interface drop down box.

Only ports supporting the RS232 hardware interface can use the GSM interface. The USB 2.0
port on an AD2006 is for programming only and does not support a GSM connection via USB type
GSM modems.
The GSM connection on an AD2000 Series device can be a Master or Slave mode connection. In a
Master mode connection, typically the link will be periodically polled. Continuously connected links
are possible but because the call charges are time based this could result in very high phone bills.
Any interruption to the link will result in an attempt to reconnect. In slave mode, the units will
respond to any GSM command that uses the RING parameter.

© 2007 Miri Technologies All rights reserved. V3.00 4-140


Chapter 4 - MiriMap2000+ Software

Master Mode GSM

The following settings are required to enable an AD2000 Series device to run in Master mode.

The major issues to ensure correct connections are:


‰ The Interface should be set to GSM Modem.
‰ The polling should be Periodic Polling for Point to Multi-point systems and only
Continuous if a Point to Point system is required (but note that GSM links are charged by
time and thus continuous links will result in very high call charges).
‰ The Baud rate should match the modem port baud rate and this should be 38.4K, None, 1, 8
by default.
‰ The Reply Timeout (ms) should be 4000 (to allow for the potential long replies, noting that
this may need to be longer on slow links)
‰ The Modem Initialization string is:
ATh&f&d2&c1x0e0
AT+wind=201
AT+creg=1
AT+cgclass="CC"
AT+cmee=1
AT+cmgf=1
AT+cmgd=1,1

Note that the last line must have a CTRL + Line Feed added so if adjusted from
the default settings press CTRL+Enter at the last character of the last line.

These are the settings for the supported Wavecom GSM engine. Other modems may
require different settings. For these modems choose the GSM Modems type “Other”.
‰ The Interface Options field Number Retries is the setting that adjusts the number of
attempts to get a connection if the first attempt fails. The default is 0. Do not confuse with the
Comms Num Tries setting which is the number of retries attempted to send a failed parcel
once connected.

© 2007 Miri Technologies All rights reserved. V3.00 4-141


Chapter 4 - MiriMap2000+ Software

‰ The Interface Options field Dial Again Time (secs) is the time delay between the above
retry dial attempts. This should be long if event parcels are used to allow them to get access
to the line.
‰ A unique Caller ID is required. By default, MiriMap2000+ will derive this from the station
identifier number and this should be used. If changes are made to this, they must be made to
all stations and compiled and written to each station prior to use so that the caller ID entries
are up to date and match.
‰ Send Caller ID on Connect and Receive caller ID on Connect options must be checked.
‰ The Send Time on Connect is an option for the Master only, if the real time clock on each
remote is to be updated on each connection (with the time in the Master AD2000 Series
device).

Slave Mode GSM

The following settings are required to enable an AD2000 Series device to run in Slave mode.

The major issues to ensure correct connections are:


‰ The Interface should be set to GSM Modem.
‰ The polling should be No Poll.
‰ The Baud rate should match the modem port baud rate and this should be 38.4K, None, 1, 8
by default.
‰ The Reply Timeout (ms) should be 4000 (to allow for the potential long replies, note this
may need to be longer on slow links). This would only be applicable on event parcels sent
from the slave.
‰ The Modem Initialization string is:
ATh&f&d2&c1x0e0
AT+wind=201
AT+creg=1
AT+cgclass="CC"
AT+cmee=1
AT+cmgf=1
AT+cmgd=1,1

© 2007 Miri Technologies All rights reserved. V3.00 4-142


Chapter 4 - MiriMap2000+ Software

Note that the last line must have a CTRL + Line Feed added so if adjusted from
the default settings press CTRL+Enter at the last character of the last line.

These are the settings for the supported Wavecom GSM engine. Other modems may
require different settings. For these modems choose the GSM Modems type “Other”.
‰ A unique Caller ID is required. By default, MiriMap2000+ will derive this from the station
identifier number and this should be used. If changes are made to this, they must be made to
all stations and compiled and written to each station prior to use so that the caller ID entries
are up to date and match.
‰ Send Caller ID on Connect and Receive caller ID on Connect options must be checked.
‰ The Send Time on Connect is an option for the Master only.

MiriMap2000+ GSM Configuration


MiriMap2000+ can connect direct to an AD2000 Series device using a GSM modem attached to a
serial COM port on the same PC. This can be used when a GSM connection is required to a
remote AD2000 series device to run a Watcher chart, view Ladder logic online or to remotely re-
configure a device.
Refer to the section Serial Port - Modem Type for details on how to setup the different modem
types.

HMI/SCADA GSM Configuration


Most HMI and SCADA software packages will support dialup connections to the AD2000 Series
devices. Not all will support the Miri2000 protocol and thus typically the Modbus protocol can be
used. It is beyond the scope of this manual to provide help guides for specific HMI or SCADA
products but the general points below should aid the set-up process.
‰ Use the Slave Mode GSM settings on the AD2000 Series device.
‰ Match the modem port baud rate at the HMI/SCADA end to the AD2000 Series device end
and these should be 38.4K, None, 1, 8 by default.
‰ Use Caller IDs only if supported in the HMI/SCADA and ensure the entry in the HMI/SCADA
software matches the setting exactly. If not supported uncheck these settings in the AD2000
Series port settings.
‰ If remote connections are periodic and there are event parcels triggering in the interval
between dialup connections, it is advisable to use a separate dialup modem for the events to
dial into the HMI/SCADA. This will minimize the occurrence of the polling dialup line being
busy when events are triggered and thus event messages (typically “important” alarms)
being missed or delayed.
It is recommended to use HMI/SCADA packages that support reading the AD2000 Series data-log
data records. This allows regular data-log profiling of local variables to occur (e.g. a local analog
variable can be scaled and logged every minute but read every hour, giving 60 samples per
connection so the variable profile in that hour can be realized at the HMI/SCADA).

Using SMS messages on GSM enabled AD2000 Series devices


The AD2000 Series devices support a convenient method of sending data via the Short Messaging
Service (SMS) when using GSM modems. This allows data to be processed as listed below:
‰ Between AD2000 Series devices
‰ To SMS capable hand-phones from an AD2000 Series device
‰ From an AD2000 Series device to SMS capable hand-phones
Users with knowledge of the system can also use short syntax message formats to write to the
AD2000 Series devices to, for example, turn outputs on (e.g. start pumps, close valves etc.).

© 2007 Miri Technologies All rights reserved. V3.00 4-143


Chapter 4 - MiriMap2000+ Software

SMS messaging does not provide a guaranteed form of delivery and due to potential
delays or losses in message delivery is not suitable for time critical alarming systems.
Messages are passed via the GSM network service provider server and thus any errors can result
in lost messages. At peak periods of network usage, messages can take from several minutes up
to hours to be delivered.
However, for normal system usage messages do typically get delivered in a few seconds and if the
above limitations are considered acceptable using SMS does provide a cheap alarming system.
The advantage is that the alarm is sent directly from the remote station, not via some intermediate
SCADA/HMI packages or server.
A typical system layout using SMS and GSM modems is shown in the following diagram:

Figure 49 - Typical SMS System Arrangement


Here the GSM network is used to gather data via the normal means of data parcels to a Master
AD2000 Series device. This would be on a periodic poll basis with events. Intermediate alarms can
also be triggered and sent directly from the remote units to various user hand-phones using SMS
messaging. The Master AD2000 Series device could still be connected to an HMI/SCADA package
or the MiriMap2000+ software package.
SMS messages can be sent from any source location to any destination location in the network,
AD2000 Series based or mobile phone based. These need to be GSM enabled and able to receive
SMS messages.
Data parcels are sent between AD2000 Series devices and these must be data enabled for Circuit
Switched Data (CSD) services.
It is also quite possible to use SMS messages only as the means of reading or writing data
variables between AD2000 Series devices. To achieve this, the full extent of the message syntax is
used and this is discussed in the section on SMS message syntax.

© 2007 Miri Technologies All rights reserved. V3.00 4-144


Chapter 4 - MiriMap2000+ Software

SMS Message Syntax


To send messages via SMS, a simple message syntax has been developed. This will allow reading
and writing to/from the AD2000 memory variables.
The format of the message is:
#pppp;!{"..."XYYaaaaa?bb:ddddd,}/
Where:
# Ensure this is added at the start of any message between two AD2000 Series
devices that use PIN numbers and result in a reply message to the originating
AD2000 Series unit. This # will add the sending station PIN number to the message
so that the reply is sent with the correct PIN number.
pppp This is the pin
; This is the pin separator
! This indicates that there is no header in response
"..." This is text to insert in response
X This is W for Write, R for Read.
YY Format is D for signed word (e.g. for variable memory type %MW)
Format U for unsigned word (e.g. for variable memory type %MW)
Format F for float (e.g. for variable memory type %ML51 storing a floating point
number)
Format LD for signed long (e.g. for variable memory type %ML51 storing a 32 bit
signed long integer number)
Format LU for unsigned long (e.g. for variable memory type %ML51 storing a 32 bit
unsigned long integer number)
aaaaa This is the address in decimal (e.g. 101 for %MW101, 51 for %ML51)
? This is the bit field separator
bb This is the bit field (1-16)
: This is the data separator for write or read command
ddddd This is the value in decimal to write or number of values to read if bit field specified
this can only be 0 (off) or 1 (on)
, This indicates more is to come (don't append to last item)
/ This indicates respond to write as well as read

SMS Message Examples - Hand-phone to AD2000 Series Devices

The simplest request to send is to read one or more memory variables from an AD2000 Series
device. The raw data is stored in a format in memory and is typically 16 bit unsigned integer. If
further data formatting has been performed via Ladder Logic then the user must ensure that the
correct format code YY is used. For send SMS messages between AD2000 Series devices refer to
the section SMS Message Examples - Between AD2000 Series Devices.

The length of the response message with data must be within the maximum SMS
message length (typically 160 characters including spaces). All characters above this limit
are lost.

For read messages the reply will be sent with a header containing the date and time at
the replying device along with the station ID number and then the data. This header can be
turned off in the text message menu form in MiriMap2000+ via General - Text Messages.

© 2007 Miri Technologies All rights reserved. V3.00 4-145


Chapter 4 - MiriMap2000+ Software

PIN Number security

Each AD2000 Series device can have a 4 digit PIN number added to add basic security. This is
entered in the General tab of each station in the Password entry box.

The password is hidden with ****. When assigning passwords it is imperative that the
user records all the passwords that have been entered into each station. These are not
stored in external files in the MiriMap2000+ application thus it is the user’s responsibility to
keep any records safe and secure. If passwords are lost, they can be reset by entering new
numbers into the Password entry box. If this is done, ensure that all AD2000 Series devices
are updated with the new map detail.

PIN number password security should only be required when giving access to writing directly
to AD2000 Series devices from hand phones. For AD2000 Series to AD2000 Series links using
SMS, the messages are hidden from general view and thus there would be little gained from using
PIN numbers.
Reading bits

To read bit 1 of the physical inputs


RD65088?1
(When using PIN numbers use pppp;RD65088?1 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
To read bit 16 of the physical inputs
RD65088?16
(When using PIN numbers use pppp;RD65088?16 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
To read bit 12 of the memory variable %MW1
RD1?12
(When using PIN numbers use pppp;RD1?12 where pppp is the 4 digit PIN of the AD2000 Series
device the message is being sent to).
Reading 16 bit integers

To read 1 x 16 bit memory variable at %MW1 in signed integer format send:


RD1

© 2007 Miri Technologies All rights reserved. V3.00 4-146


Chapter 4 - MiriMap2000+ Software

(When using PIN numbers use pppp;RD1 where pppp is the 4 digit PIN of the AD2000 Series
device the message is being sent to).
To read 10 x 16 bit memory variables starting at %MW100 in signed integer format send:
RD100:10
(When using PIN numbers use pppp;RD100:10 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
To read 1 x 16 bit memory variable at %MW1 in unsigned integer format send:
RU1
(When using PIN numbers use pppp;RU1 where pppp is the 4 digit PIN of the AD2000 Series
device the message is being sent to).
To read 10 x 16 bit memory variables starting at %MW100 in unsigned integer format send:
RU100:10
(When using PIN numbers use pppp;RU100:10 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
Reading 32 bit integers

To read 1 x 32 bit memory variable at %ML61 in signed long integer format send:
RLD61
(When using PIN numbers use pppp;RLD61 where pppp is the 4 digit PIN of the AD2000 Series
device the message is being sent to).
To read 10 x 32 bit memory variables starting at %ML101 in signed long integer format send:
RLD101:10
(When using PIN numbers use pppp;RLD101:10 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
To read 1 x 32 bit memory variable at %ML61 in unsigned long integer format send:
RLU61
(When using PIN numbers use pppp;RLU61 where pppp is the 4 digit PIN of the AD2000 Series
device the message is being sent to).
To read 10 x 32 bit memory variables starting at %ML101 in unsigned long integer format send:
RLU101:10
(When using PIN numbers use pppp;RLU101:10 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
Reading floating point numbers

To read 1 x 32 bit memory variable at %ML51 in floating point format send:


RF51
(When using PIN numbers use pppp;RF51 where pppp is the 4 digit PIN of the AD2000 Series
device the message is being sent to).
To read 10 x 32 bit memory variables starting at %ML100 in floating point format send:
RF100:10
(When using PIN numbers use pppp;RF100:10 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
Writing Bits

To write bit 1 of the physical outputs (i.e. Digital Output1) ON

© 2007 Miri Technologies All rights reserved. V3.00 4-147


Chapter 4 - MiriMap2000+ Software

WD65120?1:1
(When using PIN numbers use pppp;WD65120?1:1 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
To write bit 1 of the physical outputs (i.e. Digital Output1) OFF
WD65120?1:0
(When using PIN numbers use pppp;WD65120?1:0 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
Writing 16 bit integers

Another typical requirement is to send a message which writes specific values to one or more
memory variables in an AD2000 Series device from a hand-phone. The values sent have to be in
the correct format to correctly write into the memory variable of the AD2000 Series device. This
format is typically 16 bit unsigned integer. If further data formatting has been performed via Ladder
Logic then the user must ensure that the correct format code YY is used.
Writing memory variables from a hand-phone:
To write 1 x 16 bit memory variable at %MW1 in signed integer format send:
WD1:10
(e.g. writing a value of 10 to %MW1).
(When using PIN numbers use pppp;WD1:10 where pppp is the 4 digit PIN of the AD2000 Series
device the message is being sent to).
To write 10 x 16 bit memory variables starting at %MW100 in signed integer format send:
WD100:10,11,12,13,14,-1,-2,-3,-4,-5
(e.g. writing values of 10,11,12,13,14,-1,-2,-3,-4,-5 respectively to %MW100 through to 109)
(When using PIN numbers use pppp;WD100:10,11,12,13,14,-1,-2,-3,-4,-5 where pppp is the 4
digit PIN of the AD2000 Series device the message is being sent to).
To write 1 x 16 bit memory variable at %MW1 in unsigned integer format send:
WU1:65535 (e.g. writing a value of 65535 to %MW1).
(When using PIN numbers use pppp; WU1:65535 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
To write 10 x 16 bit memory variables starting at %MW100 in unsigned integer format send:
WU100:10,11,12,13,14,15,40000,50000,60000,65535
(e.g. writing values of 10,11,12,13,14,15,40000,50000,60000,65535 respectively to %MW100
through to 109).
(When using PIN numbers use pppp;WU100:10,11,12,13,14,15,40000,50000,60000,65535 where
pppp is the 4 digit PIN of the AD2000 Series device the message is being sent to).
To write a value of 2048 to the physical analog output 1 (i.e. Analog Output1).
WD65216:2048
(When using PIN numbers use pppp;WD65216:2048 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
Writing 32 bit integers

To write 1 x 32 bit memory variable at %ML61 in signed long integer format send:
WLD61:-999999
(e.g. writing a value of -999999 to %ML61).
(When using PIN numbers use pppp;WLD61:-999999 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).

© 2007 Miri Technologies All rights reserved. V3.00 4-148


Chapter 4 - MiriMap2000+ Software

To write 5 x 32 bit memory variables starting at %ML101 in signed long integer format send:
WLD101:-111111,-222222,333333,444444,555555
(e.g. writing values of -111111,-222222,333333,444444,555555 respectively to %MW101 through
to 105).
(When using PIN numbers use pppp;WLD61:-999999 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
To write 1 x 32 bit memory variable at %ML61 in unsigned long integer format send:
WLU61:999999
(e.g. writing a value of 999999 to %ML61).
(When using PIN numbers use pppp;WLU61:999999 where pppp is the 4 digit PIN of the AD2000
Series device the message is being sent to).
To write 5 x 32 bit memory variables starting at %ML101 in unsigned long integer format send:
WLU101: 111111, 222222,333333,444444,555555
(e.g. writing values of 111111,222222,333333,444444,555555 respectively to %MW101 through to
105).
(When using PIN numbers use pppp;WLU101: 111111, 222222,333333,444444,555555
where pppp is the 4 digit PIN of the AD2000 Series device the message is being sent to).
Writing floating point numbers

To write 1 x 32 bit memory variable at %ML51 in floating point format send:


WF51:1234.123456
(e.g. writing a value of 1234.123456 as a floating point number to %ML61).
(When using PIN numbers use pppp;WF51:1234.123456 where pppp is the 4 digit PIN of the
AD2000 Series device the message is being sent to).
To write 5 x 32 bit memory variables starting at %ML100 in floating point format send:
WF100:10.1,12.2,12345.123456,13.14,999999.89
(e.g. writing values of 10.1,12.2,12345.123456,13.14,999999.89 respectively to %MW101 through
to 105).
(When using PIN numbers use pppp; WF100:10.1,12.2,12345.123456,13.14,999999.89 where
pppp is the 4 digit PIN of the AD2000 Series device the message is being sent to).

© 2007 Miri Technologies All rights reserved. V3.00 4-149


Chapter 4 - MiriMap2000+ Software

SMS Message Examples - Between AD2000 Series Devices

Where there is no Circuit Switched Data (CSD) service available SMS can be used to read or write
data between AD2000 Series devices. Be aware that with SMS messaging to consider the
limitations of possible delays in any messages sent as well as the effect of lost messages via the
network provider. The same syntax is used as direct messaging from hand-phones, however, the
structure has to be refined to fully utilize the features. Some examples follow to illustrate this.
Reading 16 bit integers between AD2000 Series devices

To read 10 x 16 bit memory variables from %MW1 in unsigned integer format from a remote
AD2000 series device send:
!"WU1:"RU1:10/
(When using PIN numbers use #pppp;!"WU1:"RU1:10/ where pppp is the 4 digit PIN of the
AD2000 Series device the message is being sent to and # ensures that the sending station PIN
number is sent so it can be added to the reply so that the reply message is not rejected).
‰ This message is constructed to initially exclude any header using the ! character. This is
necessary because the raw command syntax is required at the AD2000 Series device. Any
header would render an error at that unit.
‰ The “WU1:” embeds the text WD1: to send in the reply.
‰ The RU1 sets the read request to read 16 bit unsigned integer values starting at %MW1.
‰ The :10 sets the number of variables to 10.
‰ The / indicates to write after the read, thus sending a write command
WD1:A,B,C,D,E,F,G,H,I,J where A to J are the actual values read from %MW1-10 from the
remote device.
The SMS message !"WU1:"RU1:10/ above results in the following commands being sent.
The out-going message (with no PIN): !"WU1:"RU1:10/
The in-coming reply (with no PIN): WU1:0,0,0,0,0,0,0,0,0,0
The same SMS message #2222;!"WU1:"RU1:10/ using a PIN number results in the following
commands being sent.
The out-going message (with PIN): "1111;"2222;!"WU1:"RU1:10/
The in-coming reply (with PIN): 1111;WU1:0,0,0,0,0,0,0,0,0,0
Where the sending station PIN is 1111, receiving station PIN is 2222.
Reading floating point numbers between AD2000 Series devices

To read 10 x floating memory variables from %ML51 from a remote AD2000 series device send:
!"WF51:"RF51:10/
(When using PIN numbers use #pppp;!"WF51:"RF51:10 where pppp is the 4 digit PIN of the
AD2000 Series device the message is being sent to and # ensures that the sending station PIN
number is sent so it can be added to the reply so that the reply message is not rejected).
‰ This message is constructed to initially exclude any header using the ! character. This is
necessary because the raw command syntax is required at the AD2000 Series device. Any
header would render an error at that unit.
‰ The "WF51:" embeds the text WD51: to send in the reply.
‰ The RF51 sets the read request to read 16 bit unsigned integer values starting at %ML51.
‰ The :10 sets the number of variables to 10.
‰ The / indicates to write after the read, thus sending a write command
WD1:A,B,C,D,E,F,G,H,I,J where A to J are the actual values read from %MW1-10 from the
remote device.

© 2007 Miri Technologies All rights reserved. V3.00 4-150


Chapter 4 - MiriMap2000+ Software

The SMS message !"WF51:"RF51:10/ above results in the following commands being sent.
The out-going message (with no PIN): !"WF51:"RF51:10/
The in-coming reply (with no PIN):
WF51:123.456779,11.330000,1693.970215,50000.339844,999999.125000,67892.765625,999999
872.000000,6042.975586,5689.542969,456789.093750
The same SMS message #2222;!"WF51:"RF51:10/ above using a PIN number in the following
commands being sent.
The out-going message (with PIN):
"1111;"2222;!"WF51:"RF51:10/
The in-coming reply (with PIN):
1111;WF51:123.567802,43684656.000000,5667.987793,3693.794189,99999.023437,1465900.50
0000,1567905.000000,46890.441406,2468.985352,24689.974609
Where the sending station PIN is 1111, receiving station PIN is 2222.

Reading 32 bit integer numbers between AD2000 Series devices

To read 10 x 32 bit integer variables from %ML61 in unsigned format from a remote AD2000 series
device send:
!"WLU61:"RLU61:10/
(When using PIN numbers use #pppp;!"WLU61:"RLU61:10 where pppp is the 4 digit PIN of the
AD2000 Series device the message is being sent to and # ensures that the sending station PIN
number is sent so it can be added to the reply so that the reply message is not rejected).
‰ This message is constructed to initially exclude any header using the ! character. This is
necessary because the raw command syntax is required at the AD2000 Series device. Any
header would render an error at that unit.
‰ The "WLU61:" embeds the text WLU61: to send in the reply.
‰ The RLU51 sets the read request to read 16 bit unsigned integer values starting at %ML61.
‰ The :10 sets the number of variables to 10.
‰ The / indicates to write after the read, thus sending a write command
WD1:A,B,C,D,E,F,G,H,I,J where A to J are the actual values read from %MW1-10 from the
remote device.
The SMS message !"WLU61:"RLU61:10/ above results in the following commands being sent.
The out-going message (with no PIN): !"WLU61:"RLU61:10/
The in-coming reply (with no PIN):
WLU61:111111,22222,333333,4444,5555555,66666,777,8888,999999,0
The same SMS message #2222; !"WLU61:"RLU61:10/ above using a PIN number in the following
commands being sent.
The out-going message (with PIN):
"1111;"2222;!"WLU61:"RLU61:10/
The in-coming reply (with PIN):
1111;WLU61:4294967295,222222222,333333333,4294967295,555555555,66666666,777777777,
88888888,99999999,0
Where the sending station PIN is 1111, receiving station PIN is 2222.

© 2007 Miri Technologies All rights reserved. V3.00 4-151


Chapter 4 - MiriMap2000+ Software

Writing 16 bit integers between AD2000 Series devices from embedded variables

To write 10 x 16 bit memory variables from %MW memory variables in signed integer format from a
remote AD2000 series device send:
!WD1:%d##### (%mw000201), %d##### (%mw000202), %d##### (%mw000203), %d#####
(%mw000204), %d##### (%mw000205), %d##### (%mw000206), %d##### (%mw000207),
%d##### (%mw000208), %d##### (%mw000209), %d##### (%mw000210)
When using PIN numbers use:
pppp;!WD1:%d##### (%mw000201), %d##### (%mw000202), %d##### (%mw000203),
%d##### (%mw000204), %d##### (%mw000205), %d##### (%mw000206), %d#####
(%mw000207), %d##### (%mw000208), %d##### (%mw000209), %d##### (%mw000210)
where pppp is the 4 digit PIN of the AD2000 Series device the message is being sent to (and note
NO # as there is no reply required to a write).
‰ This message is constructed to initially exclude any header using the ! character. This is
necessary because the raw command syntax is required at the AD2000 Series device. Any
header would render an error at that unit.
‰ The WD1 sets the write request to write 16 bit signed integer values in the destination station
starting at %MW1.
‰ The :%d##### reserves 5 character spacing in the message for the embedded variable in
signed integer format.
‰ (%mw000201) sets the current %MW memory variable to read the data from %MW201.
‰ , suggests more data variable are to come.
‰ (%mw000202) to (%mw000210) sets the current %MW memory variable to read the data
from %MW202 to %MW210.
The SMS message above results in the following commands being sent.
The out-going message (with no PIN):
WD1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Note no reply is required, it is a single write command.
The same SMS message above using a PIN number results in the following commands being sent.
The out-going message (with PIN):
2222;WD1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Note no reply is required, it is a single write command.
Where the sending station PIN is 1111, receiving station PIN is 2222.

© 2007 Miri Technologies All rights reserved. V3.00 4-152


Chapter 4 - MiriMap2000+ Software

GSM CMEE Errors


These are also available and listed below:

© 2007 Miri Technologies All rights reserved. V3.00 4-153


Chapter 4 - MiriMap2000+ Software

© 2007 Miri Technologies All rights reserved. V3.00 4-154


Chapter 4 - MiriMap2000+ Software

GPRS System Set-up


The AD2000 Series products can be used in conjunction with public wireless GPRS (General
Packet Radio Systems) systems. The following sections describe the set-up required.
An example configuration is available in the Examples folder of the MiriMap2000+ installation,
called GPRS Point To Multi-Point Example System.mmf and this can be used as an aid to the
following illustrations in this manual.

Important requirements for GPRS Internal Modems

If the internal GPRS modem module is used in the AD2000 Series devices, an internal
power reset capability is available to reset the modem in the event of modem lock-ups or
network errors. To enable this some one of the digital outputs must used.
‰ For an AD2000 this is fixed at Digital Output 4. It is NORMALLY OFF and turns ON
when resetting.
‰ For an AD2006 this is fixed at Digital Output 8. It is NORMALLY ON and turns OFF
when resetting.
Please note that only the AD2000 Rev 5 PCB boards and above can house the GSM modem
module internally, all earlier versions have to use the modem externally. All AD2006 devices
can house the GSM modem module internally.
AD2000 Rev 4 PCB boards require an additional internal link for carrier detect for the
internal modem to operate correctly. Refer to technical support for details.

Typical GPRS System Configurations


GPRS systems can be configured as follows:
‰ AD2000 Series device to device using GPRS network enabled connections
‰ MiriMap2000+ to AD2000 Series devices using GPRS network connections
‰ HMI/SCADA software to AD2000 Series device using GPRS network connections
The following diagrams illustrate these system configurations.

© 2007 Miri Technologies All rights reserved. V3.00 4-155


Chapter 4 - MiriMap2000+ Software

Figure 50 - GPRS System Arrangement - AD2000 Series Device to Device


This system uses the GPRS mobile network to connect the remote AD2000 Series devices to a
central monitoring site. The data transactions use parcels, either periodically polled parcels or
event triggered parcels, or a combination of both. Data-logging can also be enabled at the remote
sites and retrieved via the data-log scheduler.
It is possible to use the in-built routing of data parcels to make the connection from the central PC
via the Master AD2000 Series device, however, if the polling cycle is frequent, this may lengthen or
interrupt the poll cycle.
A separate modem link could be used to remain independent of the polling cycle and thus a direct
connection to each remote is possible. Some control of this connection would be required to ensure
that the Master AD2000 Series device is not attempting to connect to the remote station at the
same time as the scheduled connection.

Figure 51 - GPRS System Arrangement - MiriMap2000+ to AD2000 Series Device


This system uses the GPRS mobile telephone network to connect the central monitoring site to the
remote. This connection relies on the central monitoring site to have MiriMap2000+ installed to use
the in-built scheduler to handle all data-log retrieval as there is no Master AD2000 Series device to
handle the polling. By inference, this means that the remote sites have data-logging enabled and
configured to supply suitable data with the time stamp applied at the remote site. Further
discussion on the scheduled reading of such data is available in the section on the Scheduler.
Remote monitoring and re-configuration of the memory variables and ladder logic would also be
possible in such a connection.

© 2007 Miri Technologies All rights reserved. V3.00 4-156


Chapter 4 - MiriMap2000+ Software

Figure 52 - GPRS System Arrangement - HMI to AD2000 Series Device


This system uses the GPRS mobile telephone network to connect the central monitoring site to the
remote. This connection relies on the central monitoring site to have an HMI software package
installed to retrieve data. By inference, this means that the remote sites have data-logging enabled
and configured to supply suitable data with the time stamp applied at the remote site. That also
requires the HMI software to handle the data in different ways.
The first method would be to use the scheduler to gather the data and store in CSV file format. The
HMI package would then need to be configured to read these files as they are created and transfer
the data to the internal or external databases (e.g. ODBC, SQL. MS Access etc.) for further HMI
processing. This requires development by the integrator. Further discussion on the scheduled
reading of such data is available in the section on the Scheduler.
The second method would be to use an HMI package that supports the Miri2000 protocol for
reading of AD2000 Series connections for real-time and data-log data via direct serial and Ethernet
connections as well as via PSTN and GSM dial-up and GPRS.
The third method would be to write such a protocol driver to support the required commands. A
document is available from Miri Technologies support detailing the Miri2000 protocol and is
available for such development.

AD2000 Series GPRS Port Configuration


This GPRS interface is available on several ports by selecting the Interface option on the Ports
Properties page for each AD2000 Series device and selecting GPRS Modem.

By accepting the default settings, the link to supported modems will work correctly. To
ensure that the default settings are in use, change the interface to another type (e.g. RS232)
from the Interface drop down box, repeat this re-selecting the GPRS Modem option from the
Interface drop down box.

Only ports supporting the RS232 hardware interface can use the GPRS interface. The USB 2.0
port on an AD2006 is for programming only and does not support a GPRS connection via USB
type GPRS modems.

© 2007 Miri Technologies All rights reserved. V3.00 4-157


Chapter 4 - MiriMap2000+ Software

The GPRS connection on an AD2000 Series device can be a Master or Slave mode connection. In
a Master mode connection, typically the link will be periodically polled. Continuously connected
links are possible but verify the data charges as this could result in very high data bills. Any
interruption to the link will result in an attempt to reconnect. In slave mode, the units will respond to
any session requests to the assigned IP address.

© 2007 Miri Technologies All rights reserved. V3.00 4-158


Chapter 4 - MiriMap2000+ Software

Master Mode GPRS

The following settings are required to enable an AD2000 Series device to run in Master mode.

The major issues to ensure correct connections are:


‰ The Interface should be set to GPRS Modem.
‰ The polling should be Periodic Polling for Point to Multi-point systems and only
Continuous if a Point to Point system is required.
‰ The Baud rate should match the modem port baud rate and this should be 38.4K, None, 1, 8
by default.
‰ The Reply Timeout (ms) should be 10000 (to allow for the potential long replies, noting that
this may need to be longer on slow links)
‰ The Interface Options field IP Address is the private fixed IP address of the SIM card
inserted in the GPRS modem to be connected to this port. The user must ensure this is
correct before completing this entry.
‰ The Interface Options field IP Port is a user assigned port number inserted in the GPRS
modem to be connected to this port. The user can choose this number (typically it must be
above 10001) but ensure all AD2000 Series devices on the same system and network share
the same port number.
‰ The Interface Options fields UDP or TCP is a user assigned mode setting inserted in the
GPRS modem to be connected to this port. The user can choose this (typically it will be TCP
but UDP uses fewer characters so will produce lower data bills) but ensure all AD2000
Series devices on the same system and network share the same mode.
‰ The Interface Options field GPRS Server Address (APN) Access Point Name is the network
operator assigned name. The user must ensure this is the correct entry before completing
this entry.
‰ The Interface Options field GPRS Username is necessary if the network operator requires
such security facilities. The user must ensure this is the correct entry for the SIM IP before
completing this entry.
‰ The Interface Options field GPRS Password is necessary if the network operator requires
such security facilities. The user must ensure this is the correct entry for the SIM IP before
completing this entry.
‰ The Modem Initialization string is:
ath&f&d2&c1x0e0
at+cgclass="B"

© 2007 Miri Technologies All rights reserved. V3.00 4-159


Chapter 4 - MiriMap2000+ Software

at+cfun=1
ate
at+cmee=1

Note that the last line must have a CTRL + Line Feed added so if adjusted from
the default settings press CTRL+Enter at the last character of the last line.

These are the settings for the supported Wavecom GPRS engine. Other modems may
require different settings. For these modems choose the GPRS Modems type “Other”.
‰ The Interface Options field Number Retries is the setting that adjusts the number of
attempts to get a connection if the first attempt fails. The default is 0. Do not confuse with the
Comms Num Tries setting which is the number of retries attempted to send a failed parcel
once connected.
‰ The Interface Options field Dial Again Time (secs) is the time delay between the above
retry dial attempts. This should be long if event parcels are used to allow them to get access
to the line.
‰ A unique Caller ID is required. By default, MiriMap2000+ will derive this from the station
identifier number and this should be used. If changes are made to this, they must be made to
all stations and compiled and written to each station prior to use so that the caller ID entries
are up to date and match.
‰ Send Caller ID on Connect and Receive caller ID on Connect options must be checked.
‰ The Send Time on Connect is an option for the Master only, if the real time clock on each
remote is to be updated on each connection (with the time in the Master AD2000 Series
device).
‰ The Protocol Options field the Packet mode can be set to ASCII or Binary. All devices must
share the same mode and Binary is the most efficient.
‰ The Protocol Options field %MW starting address for GPRS data is the memory area that
the GPRS diagnostics from the modem are to be stored in the AD2000 Series device. See
the section on GPRS Diagnostics for details.

Slave Mode GPRS

The following settings are required to enable an AD2000 Series device to run in Slave mode.

The major issues to ensure correct connections are:


‰ The Interface should be set to GPRS Modem.

© 2007 Miri Technologies All rights reserved. V3.00 4-160


Chapter 4 - MiriMap2000+ Software

‰ The polling should be No Poll.


‰ The Baud rate should match the modem port baud rate and this should be 38.4K, None, 1, 8
by default.
‰ The Reply Timeout (ms) should be 4000 (to allow for the potential long replies, note this
may need to be longer on slow links). This would only be applicable on event parcels sent
from the slave.
‰ The Interface Options field IP Address is the private fixed IP address of the SIM card
inserted in the GPRS modem to be connected to this port. The user must ensure this is
correct before completing this entry.
‰ The Interface Options field IP Port is a user assigned port number inserted in the GPRS
modem to be connected to this port. The user can choose this number (typically it must be
above 10001) but ensure all AD2000 Series devices on the same system and network share
the same port number.
‰ The Interface Options fields UDP or TCP is a user assigned mode setting inserted in the
GPRS modem to be connected to this port. The user can choose this (typically it will be TCP
but UDP uses fewer characters so will produce lower data bills) but ensure all AD2000
Series devices on the same system and network share the same mode.
‰ The Interface Options field GPRS Server Address (APN) Access Point Name is the network
operator assigned name. The user must ensure this is the correct entry before completing
this entry.
‰ The Interface Options field GPRS Username is necessary if the network operator requires
such security facilities. The user must ensure this is the correct entry for the SIM IP before
completing this entry.
‰ The Interface Options field GPRS Password is necessary if the network operator requires
such security facilities. The user must ensure this is the correct entry for the SIM IP before
completing this entry.
‰ The Modem Initialization string is:
ath&f&d2&c1x0e0
at+cgclass="B"
at+cfun=1
ate
at+cmee=1

Note that the last line must have a CTRL + Line Feed added so if adjusted from
the default settings press CTRL+Enter at the last character of the last line.

These are the settings for the supported Wavecom GPRS engine. Other modems may
require different settings. For these modems choose the GSM Modems type “Other”.
‰ A unique Caller ID is required. By default, MiriMap2000+ will derive this from the station
identifier number and this should be used. If changes are made to this, they must be made to
all stations and compiled and written to each station prior to use so that the caller ID entries
are up to date and match.
‰ Send Caller ID on Connect and Receive caller ID on Connect options must be checked.
‰ The Send Time on Connect is an option for the Master only.
‰ The Protocol Options field the Packet mode can be set to ASCII or Binary. All devices must
share the same mode and Binary is the most efficient.
‰ The Protocol Options field %MW starting address for GPRS data is the memory area that
the GPRS diagnostics from the modem are to be stored in the AD2000 Series device. See
the section on GPRS Diagnostics for details.

© 2007 Miri Technologies All rights reserved. V3.00 4-161


Chapter 4 - MiriMap2000+ Software

MiriMap2000+ GPRS Configuration


MiriMap2000+ can connect direct to an AD2000 Series device using a GPRS modem attached to a
serial COM port on the same PC. This can be used when a GPRS connection is required to a
remote AD2000 series device to run a Watcher chart, view Ladder logic online or to remotely re-
configure a device.
Refer to the section Serial Port - Modem Type for details on how to setup the different modem
types.

HMI/SCADA GPRS Configuration


Most HMI and SCADA software packages will support dialup connections to the AD2000 Series
devices. Not all will support the Miri2000 protocol and thus typically the Modbus protocol can be
used. It is beyond the scope of this manual to provide help guides for specific HMI or SCADA
products but the general points below should aid the set-up process.
‰ Use the Slave Mode GPRS settings on the AD2000 Series device.
‰ Match the modem port baud rate at the HMI/SCADA end to the AD2000 Series device end
and these should be 38.4K, None, 1, 8 by default.
‰ Use Caller IDs only if supported in the HMI/SCADA and ensure the entry in the HMI/SCADA
software matches the setting exactly. If not supported uncheck these settings in the AD2000
Series port settings.
‰ If remote connections are periodic and there are event parcels triggering in the interval
between dialup connections, it is advisable to use a separate dialup modem for the events to
dial into the HMI/SCADA. This will minimize the occurrence of the polling dialup line being
busy when events are triggered and thus event messages (typically “important” alarms)
being missed or delayed.
It is recommended to use HMI/SCADA packages that support reading the AD2000 Series data-log
data records. This allows regular data-log profiling of local variables to occur (e.g. a local analog
variable can be scaled and logged every minute but read every hour, giving 60 samples per
connection so the variable profile in that hour can be realized at the HMI/SCADA).

GPRS Diagnostics
The GPRS modems serve certain network diagnostics to the AD2000 Series device and these are
repeated to the internal memory at the address defined in the Protocol Options field %MW starting
address for GPRS data port set-up screen.
‰ GPRS_CREG_RESP_mode –

‰ GPRS_CREG_RESP_stat –

‰ GPRS_CGREG_RESP_n –

© 2007 Miri Technologies All rights reserved. V3.00 4-162


Chapter 4 - MiriMap2000+ Software

‰ GPRS_CGREG_RESP_stat –

‰ GPRS_CSQ_RESP_rssi –

This equates to the 4 bar signal strength indicator seen on most mobiles. 0 = lower bar, 1 = second
lowest bar, 30 the next bar and 31 and above the highest bar indicating good signal strength.
‰ GPRS_CSQ_RESP_ber –

‰ GPRS_WIND_RESP_ind –

‰ GPRS_WIND_RESP_level -

© 2007 Miri Technologies All rights reserved. V3.00 4-163


Chapter 4 - MiriMap2000+ Software

GPRS CMEE Errors


These are also available and listed below:

© 2007 Miri Technologies All rights reserved. V3.00 4-164


Chapter 4 - MiriMap2000+ Software

© 2007 Miri Technologies All rights reserved. V3.00 4-165


Chapter 5 - Ladder Logic Functions

Chapter 5 - Ladder Logic Functions


The AD2000 Series devices have a Ladder Logic interface to allow programmable logic functions
to be performed on the internal variables and field I/O variables (i.e. digital and analogue inputs
and outputs). This allows the AD2000 Series devices to be used in similar applications to devices
commonly referred to as PLCs (i.e. Programmable Logic Controllers). The choice of the familiar
Ladder Logic language as an interface has been made to provide an easy to understand graphical
interface, consistent with the graphical methods already used in the MiriMap2000+ Configuration
Software.

The PLC functions of the AD2000 Series Devices


A PLC (i.e. Programmable Logic Controller) is a device that was invented to replace the necessary
sequential relay circuits for machine control. The PLC works by looking at its inputs and depending
upon their state, turning on/off its outputs. The user enters PLC the program via the MiriMap2000+
software package using the Ladder Logic interface. Quick access is via the icon.
PLCs are used in many "real world" applications. PLCs are used extensively in industry and
several manufacturers have products on the market. The AD2000 Series products are not
designed to replace these PLCs, however, in many cases they provide a cost effective and
practical alternative to using such PLCs and offer RTU features not commonly supported in PLC
type products such as data-logging events to memory with an accurate time stamp. Via the
supported serial protocol communications drivers, the AD200 Series devices also allow PLCs to be
connected using a range of communications methods for which the PLCs were not specifically
designed (e.g. radio modem, dialup modem and GSM/GPRS modem).
Data-logging capability is also added to the AD2000 Series products, a facility not found on PLCs.
Combining the two capabilities provides unique solutions for the user using a single product and
software package. The data-logging of variables and conditions has been added into the Ladder
Logic utility in MiriMap2000+.
Familiarity throughout the industry with the graphical programming language known as Ladder
Logics (sometimes referred to as Relay Ladder Logic diagrams) meant it was an ideal
programming method for the AD2000 Series product internal logic processing. The growing trend
to provide such programming support along the lines of the IEC61131-3 standard also meant that a
similar interface to other packages could be developed.
When should you use a Ladder Logic programming interface? Let's assume that when a circuit
input turns on (it could be in any industrial process) we want to turn a solenoid on for 5 seconds
and then turn it off regardless of how long the switch is on for. We can do this with a simple
external timer. But what if the process included 4 or more switches and solenoids? We would need
4 or more external timers. What if the process also needed to count how many times the switches
individually turned on? We need a lot of external counters. The AD2000 Series devices already
have the I/O there it makes sense to utilise the internal processing of the units to operate those
timers and counters. The use of Ladder Logic programming extends the use of the AD2000 Series
devices beyond just telemetry applications. In many applications, significant cost and space
savings are made by using just one compact AD2000 Series device, instead of discrete radios,
PLCs, modems and other controllers. The bigger the process the more of a need there is for a PLC
and the AD2000 Series devices allow maximum flexibility in application configuration.

The internal operations of the AD2000 Series PLC functions


The AD2000 Series devices PLC functions run a Scan routine in the same CPU that runs the rest
of the device processing but ordered in a higher priority using a Real Time Operating System
(RTOS) which maintains several internal state machines The internal PLC memory receives real-
time updates from the appropriate circuits via the input/output terminals and any I/O Expansion
modules or serial/Ethernet connected devices. Consider the PLC to be a box full of hundreds or
thousands of separate relays, counters, timers and data storage locations. These counters, timers,
etc. don't "physically" exist but rather they are simulated and can be considered software counters,
timers etc. These internal relays are simulated through bit locations in variable memory locations.

© 2007 Miri Technologies All rights reserved. V3.00 5-1


Chapter 5 - Ladder Logic Functions

I/O - (Inputs/Outputs)
These are connected to the outside world. They physically exist and receive signals from switches,
sensors, etc. These are connected to the terminals on the AD2000 Series products and are
typically labelled as the Digital Inputs, Digital Outputs (relays or transistors), Analogue Inputs and
Analogue Outputs. On the AD2000 Series device casing labels these are indicated as follows:
‰ Digital Inputs - DIN
‰ Digital Output - DOT
‰ Analogue Input and Output - ALG. (The internal jumper settings and option boards
determine whether analogue outputs are installed and available. The lower terminal block is
coloured grey when the analogue output option is installed and the part number written on
the bottom of the AD2000 Series unit casing is of the format AD200xY-LA-ZZ), the A
implying Analogue outputs fitted (N otherwise).

Internal memory points


These do not receive signals from the outside world nor do they physically exist. They are
simulated relays and are what enable a PLC to eliminate external relays. There are also some
special relays that are dedicated to performing only one task. Some are always on while some are
always off. Some are on only once during power-on and are typically used for initializing data that
has been stored.

Counters
These again do not physically exist. They are simulated counters and they can be programmed to
count pulses. Typically these counters can count up and down. Since they are simulated they are
limited in their counting speed. There are also high-speed counters that are hardware based on the
AD2000 Series devices to enable the counting of pulse streams in the order of several kHz.

Timers
These also do not physically exist. They come in many varieties and increments. The most
common type is an on-delay type. Others include off-delay and use both retentive and non-
retentive memory.

Data storage
Typically there are many thousand memory registers assigned to simply store data. They are
usually used as temporary storage for maths or data manipulation. In the AD2000 Series devices
an area is allocated to store data when power is removed from the PLC. Upon power-up they will
still have the same contents as before the power was removed. These Non-Retentive memory
variables have to be defined separately from other memory.

PLC operation
A PLC works by continually scanning a program. Think of this scan cycle as consisting of 3
important steps. There are typically more than 3 but focussing on the important parts illustrates the
general process. Typically the others steps are checking the system and updating the current
internal counter and timer values.
‰ Step 1– check input status - First the PLC takes a look at each input to determine if it is on
or off. In other words, is the sensor connected to the first input on? How about the second
input? How about the third... It records this data into its memory to be used during the next
step.
‰ Step 2 - execute program - Next the PLC executes the program one instruction at a time.
For example the program said that if the first input was on then it should turn on the first
output. Since it already knows which inputs are on/off from the previous step it will be able to
decide whether the first output should be turned on based on the state of the first input. It will
store the execution results for use later during the next step.

© 2007 Miri Technologies All rights reserved. V3.00 5-2


Chapter 5 - Ladder Logic Functions

‰ Step 3 - update output status - Finally the PLC updates the status of the outputs. It updates
the outputs based on which inputs were on during the first step and the results of executing
your program during the second step. Based on the example in Step 2 it would now turn on
the first output because the first input was on and your program said to turn on the first
output when this condition is true.
After Step 3 the PLC goes back to Step 1 and repeats the steps continuously. One scan time is
defined as the time it takes to execute the 3 steps listed above. It is important to note that this can
time will vary depending on the complexity of the program, the function blocks used and the
program length.
The process of writing these many steps can include many hundreds of similar steps. As of Version
3.00 of MiriMap200+ the functionality of using sub-routines to break up long lines of ladder code
into manageable and readable sections is available. The logic still runs top to bottom but the code
is written into smaller sections, each run one after the other.

Editing Ladder Logic programs


The Ladder Logic programming interface can be started from the toolbar icon as shown . The
Ladder Logic interface will also open via the keystroke Ctrl+D or by selecting a station and pressing
the right mouse button and selecting the menu option PLC Ladder Logic. The initial interface form
is shown in the following diagram:

This is the main ladder diagram page called Ladder Main. Logic can be written on different pages
with user assigned names. This allows logic to be written clearly as to function and to be easier to
read and diagnose. Refer to the Sub-Routine Function Block section for details on how different
pages are assigned and used.

© 2007 Miri Technologies All rights reserved. V3.00 5-3


Chapter 5 - Ladder Logic Functions

Selecting Edit mode


To view logic the screen can be left as it is. To add, delete or edit items the Edit mode must be
enabled. To enable Edit mode select the toolbar icon or also via the keystroke Ctrl+E or by
pressing the right mouse button and selecting the menu option Edit mode.
When in edit mode the toolbar icon is depressed and the dark shaded select indication is available
as shown in the following diagram:

Inserting logic items on a rung


The logic is inserted from left to right on a line called a rung. Each rung is added one at a time, top
to bottom. The first rung is processed from left to right then the second and then the third and so
on. The first rung is always displayed for new programs. To add coils and function block logic to the
currently highlighted rung, the following methods can be used:

The toolbar menu

Select the desired item from the toolbar as shown below:

The individual icons are described in the following sections.

Toolbar Icon Function

Normally Open Contact - enables insertion of normally open contacts into the Ladder
Logic program interface

Normally Closed Contact - enables insertion of normally closed contacts into the Ladder
Logic program interface

Positive Transition Contact - enables insertion of positive transition-sensing contacts


into the Ladder Logic program interface

Negative Transition Contact - enables insertion of negative transition-sensing contacts


into the Ladder Logic program interface
Any Transition Contact - enables insertion of any (positive or negative) transition-
sensing contacts into the Ladder Logic program interface
Output Coil - enables insertion of output coils into the Ladder Logic program interface

Not Output Coil - enables insertion of not output coils into the Ladder Logic program
interface
Set Output Coil - enables insertion of set or latched coils into the Ladder Logic program
interface
Reset Output Coil - enables insertion of reset or unlatched coils into the Ladder Logic
program interface
Jump to - enables insertion of Jump coils into the Ladder Logic program interface

Call to - enables insertion of Call coils into the Ladder Logic program interface

Return from - enables insertion of Return coils into the Ladder Logic program interface

End - enables insertion of End coils into the Ladder Logic program interface

Function Block - enables insertion of Function Blocks from the choice available into the
Ladder Logic program interface

Online Mode - enable online updates to the Ladder Logic window

Edit Mode - This MUST be depressed to edit any Ladder Logic progam

© 2007 Miri Technologies All rights reserved. V3.00 5-4


Chapter 5 - Ladder Logic Functions

Toolbar Icon Function


Rung Line Insert delete - enables insertion and deletion of horizontal and vertical rung
lines into the Ladder Logic program interface

Menu selection

Select the main menu PLC menu option or right click the mouse button and choose the menu
options for Contacts, Coils and Function Blocks as shown in the diagram below:

Selecting the menu items with the mouse will make that element available for editing.

Keystroke selection

Direct selection of the most common elements is available via keystroke combinations of the
keyboard function keys (F2 - F4) and the Ctrl or the Shift key as described below:
‰ Normally Open Contact - F2
‰ Normally Closed Contact - F3

© 2007 Miri Technologies All rights reserved. V3.00 5-5


Chapter 5 - Ladder Logic Functions

‰ Positive Transition Contact - Ctrl+F2


‰ Negative Transition Contact - Ctrl+F3
‰ Any Transition Contact - Shift+F2
‰ Output Coil - F4
‰ Not Output Coil - Ctrl+F4
‰ Function Block - F7

How to edit the element of choice


Once the element type has been selected via the toolbar, menu or keystroke methods, the edit
element dialogue box as shown below will be displayed:

With the Nicknames check box checked the elements are displayed by their variable name
Nickname as defined for the Variables associated with the station concerned. Without this checked
the elements are displayed by their variable physical address for the station concerned.
For either a known variable address or nickname, the drop down selection box will display all
defined variables for the chosen station. With the Nicknames check box checked the elements can
be displayed quickly by typing in the first letter of the desired variable. For example to select Digital
Inputs, type D and the first variables with the first letter of the nickname starting with D will be
displayed, in ascending order. The keyboard cursor down arrow can be used to further define the
selection or the mouse can be used.
For bit based elements such as contacts and coils the required bit needs to be defined. Only valid
entries will result in the green tick being displayed.
The same edit form used for word variables can be used to select the bit based variables. The form
is shown below.

In this bit based mode, choose the required bit in the variable by writing in the desired bit number in
the word in the Bit box.
If the variables have been labeled to the bit level, then check the Bits Only box to display all bit
level nicknames and select the required bit based variable from the drop down box.

For further details on bit based labelling refer to the section on Assigning bits to variables.

Inserting logic elements


To insert new rungs or add rows and columns to existing rungs, first select the rung on which the
insert is to take place then choose one of the following options:
‰ press the keyboard Insert key
‰ click the right-hand mouse button and select the Insert option

© 2007 Miri Technologies All rights reserved. V3.00 5-6


Chapter 5 - Ladder Logic Functions

‰ select the main menu option PLC and choose the Insert option
The insert rung menu box as shown below will be displayed:

Choose the desired option in the section labelled What? to determine the insertion of a new rung,
row or column.
Choose the Where? option to insert before or after the currently selected position.

Deleting logic elements


Each logic element occupies a column in the rung. To delete a single element, set to Edit mode,
select the desired element for deletion (marked by the highlighted box around that element as
shown in the diagram below) and press the Delete key on the keyboard.

Deleting logic rungs


Set to Edit mode, select a rung element (marked by the highlighted box around that element as
shown in the diagram below) and choose one of the options:
‰ Press the Delete key on the keyboard twice, confirming the entire row deletion when
prompted.
‰ Press SHIFT+Right keyboard arrow → to select entire row, then press delete.
‰ Right click the mouse button, Edit Functions, Select Single Rung then press delete.
A warning screen prompts the user to accept the rung deletion or cancel it.

Alternatively, several rungs can be selected and deleted.


The Ladder Logic interface must be in edit mode first. First position the edit cursor marker on the
rung that is to be deleted as shown in the following example:
‰ Press the Shift key to enter the rung select mode then at the same time press the up, down,
left and right cursor arrow keyboard keys (i.e. ←↑↓→ depending on the required direction) to
highlight the entire rung (or rungs) , then press delete.
‰ Right click the mouse button, Edit Functions, Select Multiple Rungs, enter the rung numbers
in the prompt dialog box, then press delete.
A warning screen prompts the user to accept the rung deletion or cancel it.

© 2007 Miri Technologies All rights reserved. V3.00 5-7


Chapter 5 - Ladder Logic Functions

Inserting logic connect lines


Additional vertical or parallel connect lines are required to construct logic. The following rules are
required:
‰ Rung lines cannot be added above the rung, they must always be added below the currently
selected row.
‰ Rung lines cannot be drawn around function blocks.
To add a line (vertical or horizontal) at the desired location, there are three options:
‰ Press the Ctrl keyboard key and the up, down, left and right cursor arrow keyboard keys (i.e.
←↑↓→, depending on the required direction) at the same time. Each time the cursor arrow
key is pressed the line is created.
‰ Right click the mouse button to open the edit function menu, and choose Insert Wire option.

‰ Choose the toolbar option and select from the menu options shown below:

For example, to add a parallel normally open contact to the following rung,

Position the edit cursor to the right of the contact that you desire the parallel connection to be
created from. The vertical line must be added below the rung so press the Ctrl cursor and then
press the down cursor arrow once. The vertical line is then drawn as shown below:

© 2007 Miri Technologies All rights reserved. V3.00 5-8


Chapter 5 - Ladder Logic Functions

The contact of choice can then be inserted into the space left by positioning the edit cursor and
selecting the contact to complete the rung as below:

The insertion of parallel connect lines follows the same process with the horizontal cursor arrow
keys.

Deleting logic connect lines


The vertical or parallel connect lines required for constructing logic can be deleted in two ways.
‰ To delete a line (vertical or horizontal) at the desired location, press the Ctrl plus the Shift
keys and the up, down, left and right cursor arrow keys (i.e. ←↑↓→ depending on the
required direction) at the same time. Each time the cursor arrow key is pressed, the line is
deleted.

‰ Choose the toolbar option and select from the menu options shown below:

Copying and pasting rungs and logic sections


It is possible to select an element (e.g. coil, contact or function block) or an entire rung (or multiple
rungs) and copy them and paste them to a different area of the Ladder Logic within the same
station, another station or another instance of MiriMap2000+ (i.e. between two different maps each
open in separate MiriMap2000+ programs on the same PC).
The Ladder Logic interface must be in edit mode first. First position the edit cursor marker on the
rung that is to be copied as shown in the following example:

Press the Shift key to enter the rung select mode then at the same time press the up, down, left
and right cursor arrow keys (i.e. ←↑↓→, depending on the required direction) to highlight the entire
rung, as illustrated in the following diagram:

To copy the rung, press the Ctrl key and the C key at the same time.

© 2007 Miri Technologies All rights reserved. V3.00 5-9


Chapter 5 - Ladder Logic Functions

To paste the rung elsewhere, first position the edit cursor at the point where the rung is to be
placed (in the same station or in the Ladder Logic area of another station) and press the Ctrl key
and the V key at the same time. Leaving the edit cursor on the same rung that was copied will
result in the pasted rung being placed below the current rung.

This will duplicate the logic and variables assigned to the elements so they must then
be edited to perform unique operations on the new rung.

The option to paste variable details is also available. The options are shown in the following prompt
which appears each time you paste any logic.

‰ Leave Current Variables - Choose this to maintain the variable details (eg address and
nickname) of the station being pasted into.
‰ Merge with station variables taking precedent - Choose this to maintain the variable details
(e.g. address and nickname) of the station being pasted into if they exist.
‰ Merge with import variables taking precedent - Choose this to over-write the variable details
(e.g. address and nickname) of the station being pasted into if they exist.

Undo facility for copying and pasting rungs and logic sections
It is also possible to undo the copying and pasting of rungs and rung elements. Should you wish to
reverse a paste action press the Ctrl key and the Z key at the same time.

Finding a specific variable


When within the Ladder Logic interface, selecting this option CTRL+F (i.e. press the Ctrl key and
the F key at the same time) will open the Find dialogue box to locate Ladder logic variables

To search for bit variables only, check the Search Bits option. To search by nickname, check the
Nicknames option, otherwise memory addressing will be used. If multiple Ladder logic pages are in
use, check the Global Search option to search all defined pages.

© 2007 Miri Technologies All rights reserved. V3.00 5-10


Chapter 5 - Ladder Logic Functions

Find Next

When within the Ladder Logic interface, if the variable is used in several places, pressing this
option (or F3) will search through each instance of the variable in use in the Ladder logic after the
initial search has been started.

Find & replace a specific variable


When within the Ladder Logic interface the Ctrl+H keystroke combination (i.e. press the Ctrl key
and the H key at the same time) allows the user to find and replace a variable that matches the
criteria specified. The search criteria form for the Find & Replace is illustrated below:

The variable to be found is selected from the Find What drop down box and the replacement
variable is selected from the Replace With drop down box. The optional search parameters are
available to search through all rungs or only between certain rung numbers. If the Replace All
checkbox is ticked then all occurrences of the variable within the search parameters will be
replaced. If the Replace All checkbox is not ticked then all occurrences of the variable within the
search parameters will be replaced one by one with a user confirmation being displayed each time.
The choice to search for variables by nickname or physical memory location is available. To use
nicknames, ensure that the nicknames checkbox is ticked.
Select the Bit only option to restrict the search to bit variables.

Go To a specific rung number or label


When within the Ladder Logic interface the Ctrl+R keystroke combination (i.e. press the Ctrl key
and the R key at the same time) allows the user to position the edit cursor on a specific rung
number or a rung label (if the rung has been assigned a label). The search criteria form for the
Goto Rung is illustrated below:

Adding Example Ladder Logic Rungs


In the folder Examples there are several example rungs with pre-defined variable allocations for all
function blocks. To insert these into a new project, open the Ladder Logic editing window and
locate a rung number where the logic should be inserted.

‰ Locate the Ladder Logic toolbar icon , Menu Option Toggle Ladder Logic, Press
CTRL+D or right click and select PLC Ladder Logic option.

‰ Enter Edit Mode by selecting the toolbar icon or via the keystroke Ctrl+E or by pressing
the right mouse button and selecting the menu option Edit mode.

© 2007 Miri Technologies All rights reserved. V3.00 5-11


Chapter 5 - Ladder Logic Functions

The Examples folder is opened. Scroll to the desired rung example:

Select and press Open.


Scroll down the select the third Import Variable Option - Merge with Import variables taking
precedence:

The logic is inserted into the project.

The variables used in these example ladder logic rungs are in the range above %MW50000.
Please note that importing this ladder can overwrite existing memory variables in your project if
your project already has variables defined in the range above %MW50000. The memory
addressing of the imported logic should be adjusted to suit your application.

© 2007 Miri Technologies All rights reserved. V3.00 5-12


Chapter 5 - Ladder Logic Functions

Boolean Logic
The most basic use of the Ladder Logic interface is to allow various levels of complex Boolean
logic to be performed. This was the fundamental use of “relay ladder logic” (now termed Ladder
Logic in the IEC1131-3 standard) commonly used in the programming of PLCs and offering a visual
method of creating Boolean expressions. By satisfying the elements of the expression, power flows
through a coil at the output of a rung.
Simply put, the Ladder Logic symbolises a circuit with energised left and right power rails. If
conditions exist that allow contacts positioned along a rung of the ladder to close then the circuit is
complete and power flows to an output coil. By placing several contacts in series you can create an
"AND" condition in Boolean Logic. Conversely, an "OR" condition results from placing contacts in
parallel with each other. The ladder logic executes from top to bottom and from left to right.
Although the Ladder Logic interface does not draw the right power rail on the screen, the circuit
functions as if it were there.
This programming technique provides you with a variety of contacts and coils, thus giving you
considerable flexibility in creating intricate program logic. An example of this is shown in the
following diagram:

From this it can be seen that power flow will occur, reading from top to bottom then left to right, if:
Digital Input 1 OR Digital Input 4 OR Digital Input 5 AND Digital Input 2 AND Digital Input 3 are ON.
As a result of this power flow Digital Output 1 will be ON.

Normally Open Contact

This enables you to insert normally open contacts into the Ladder Logic program interface. The
Normally Open Contact tests for a TRUE condition of its associated Boolean (or Bit) variable. If the
variable is TRUE when scanned, the contact closes and passes a TRUE condition to the rest of the
rung. If the variable is FALSE when scanned, the contact remains open and passes a FALSE
condition to the rest of the rung.

Normally Closed Contact

This enables you to insert normally closed contacts into the Ladder Logic program interface. The
Normally Closed Contact tests for a FALSE condition of its associated Boolean (or Bit) variable. If
the variable is FALSE when scanned, the contact remains closed and passes a TRUE condition to
the rest of the rung. If the variable is TRUE when scanned, the contact opens and passes a FALSE
condition to the rest of the rung.

Positive Transition Contact

This enables you insert positive transition-sensing contacts into the Ladder Logic program
interface. The positive transition-sensing contact generates a pulse after receiving a FALSE to
TRUE transition of its associated Boolean (or Bit) variable. This pulse is valid for only one scan.
There can be no other contacts or function blocks inserted in a rung between this type of contact
and the left-hand power rail (i.e. to the left of the contact).

© 2007 Miri Technologies All rights reserved. V3.00 5-13


Chapter 5 - Ladder Logic Functions

Negative Transition Contact

This enables you to insert negative transition-sensing contacts into the Ladder Logic program
interface. The negative transition-sensing contact generates a pulse after receiving a TRUE to
FALSE transition of its associated Boolean (or Bit) variable. This pulse is valid for only one scan.
There can be no other contacts or function blocks inserted in a rung between this type of contact
and the left-hand power rail (i.e. to the left of the contact).

Any Transition Contact

This enables you to insert any (positive or negative) transition-sensing contacts into the Ladder
Logic program interface. The any transition contact generates a pulse after receiving a FALSE to
TRUE or a TRUE to FALSE transition of its associated Boolean (or Bit) variable. This pulse is valid
for only one scan. There can be no other contacts or function blocks inserted in a rung between
this type of contact and the left-hand power rail (i.e. to the left of the contact).

Output Coil

This enables you to insert output coils into the Ladder Logic program interface. The output coil
enables an output variable when the rung condition is TRUE. If the rung is TRUE when scanned,
the coil sets its associated Boolean (or Bit) variable to TRUE. This variable only remains enabled
as long as the rung is TRUE. If the rung is FALSE when scanned, the coil sets its variable to
FALSE.

Not Output Coil

This enables you to insert not output coils into the Ladder Logic program interface. The not output
coil enables an output variable when the rung condition is FALSE. If the rung is FALSE when
scanned, the coil sets its associated Boolean (or Bit) variable to FALSE. This variable only remains
enabled as long as the rung is FALSE. If the rung is TRUE when scanned, the coil sets its variable
to TRUE.

Set Output Coil

This enables you to insert set or latched coils into the Ladder Logic program interface. The set, or
latched coil enables an output variable when the rung condition is TRUE until a reset (unlatch) coil
is enabled. If the rung is TRUE when scanned, the coil will set its associated variable to TRUE.
This variable remains enabled until it is reset with the reset coil. If the rung is FALSE when
scanned, and the Set coil is not already TRUE, the coil will set its variable to FALSE.

Reset Output Coil

This enables you to insert reset or unlatched coils into the Ladder Logic program interface. The
Reset coil disables a Set coil variable when the rung condition is TRUE. If the rung is TRUE when
scanned, the coil resets its associated variable to FALSE and will cause the variable to remain
FALSE until a Set coil enables it. If the rung is FALSE when scanned, the coil maintains its
variable's previous condition.

© 2007 Miri Technologies All rights reserved. V3.00 5-14


Chapter 5 - Ladder Logic Functions

Timers and Counters Function Block Descriptions


Counter Up (CTU)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Counter Up function block enables an output after a preset number of transitions from FALSE
to TRUE or TRUE to FALSE to occur.
The CTU block increments the current value (CV) for every edge transition of the counter up
enable bit (CU) - thus a negative or positive transition bit must be used on the CU input (otherwise
the counter will increment every scan, much like a timer). The current value continues to increment
until it reaches the preset value (PV). At that point, the output bit (Q) is enabled and remains
enabled until the function block is reset by a true condition of the reset bit (R). While the reset bit is
true, the current value resets and remains at zero so it is advisable to use a transition bit for the
reset.

Inputs

CU is the Counter Up enable bit. As long as the reset bit is false, each false to true transition of this
bit increments the current value until the current value equals the preset value. The value of CU is
determined by the Boolean evaluation of elements placed between the left power rail and CU in the
function block. If you do not place any contacts on the rung before CU, the value of CU is always
true and will increment every scan acting like a timer.
R is the counter up reset bit. When this bit is true, the current value is set to zero and the output bit
is disabled. The value of R is determined by the Boolean evaluation of elements placed between
the left power rail and R. A connection must be made to R.
PV is the counter up preset value. You can assign this input variable a value or point it to a
currently assigned variable in the "Assign Function Block Inputs/Outputs" dialogue box. The range
of values this variable can assume is unsigned INT (WORD) or DINT (LONG) which are from 1 to
65,535 (FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT
(LONG) type variables.

Outputs

Q is the Counter Up output bit. This bit is enabled and passes power when the current value is
equal to the preset value.

© 2007 Miri Technologies All rights reserved. V3.00 5-15


Chapter 5 - Ladder Logic Functions

CV is the Counter Up current value. You must assign this output variable to any assigned variable
memory via a nickname or memory address in the "Assign Function Block Inputs/Outputs" dialogue
box. The value of this variable increments by one every time a false to true transition of the counter
up enable bit occurs until the current value equals the preset value. The current value retains its
value until the reset bit is true.

Example Code

A typical example of the function is shown in the following diagram:

Only one counter can be placed on a single rung.


Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Counter Up - CTU.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Counter Down (CTD)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

© 2007 Miri Technologies All rights reserved. V3.00 5-16


Chapter 5 - Ladder Logic Functions

The Counter Down function block enables an output after a preset number of transitions from
FALSE to TRUE or TRUE to FALSE to occur.
CTD will decrement the current value (CV) for every false to true transition of the counter down
enable bit (CD). The current value continues to decrement until it reaches zero. At this point, the
output bit (Q) is enabled and remains enabled until the function block is reset by a true condition of
the load bit (LD). When the load bit is true, the current value resets and remains at the integer
preset value (PV). It is advisable to use a transition bit for the load bit LD otherwise the bit can be
always on and thus the current value will never decrease.

Inputs

CD is the Counter Down enable bit. As long as the reset bit is false, each false to true transition of
this bit decrements the current value until the current value equals zero. The value of CD is
determined by the Boolean evaluation of elements placed between the left power rail. If no contacts
are placed on the rung before CD, the value of CD is always true, but a transition never occurs.
LD is the Counter Down load bit. When this bit is true, the current value is set to the preset value
and the output bit is disabled. The value of LD is determined by the Boolean evaluation of elements
placed between the left power rail and LD. If you do not place any contacts on the rung before LD
in a Ladder Logics program, the value of LD is always false.
PV is the counter down preset value. You can assign this input variable a value or point it to a
currently assigned variable in the "Assign Function Block Inputs/Outputs" dialogue box. The range
of values this variable can assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to
65,535 (FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT
(LONG) type variables.

Outputs

Q is the Counter Down output bit. This bit is enabled and passes power when the current value is
equal to zero.
CV is the Counter Down current value. You can assign this output a symbolic name or constant
value in the "Assign Function Block Symbolic Input/Output" dialogue box. The value of this variable
decrements by one every time a false to true transition of the counter down enable bit occurs until
the current value equals zero. The current value retains this value until the reset bit is true. Prior to
an initial loading of the preset value, CV has a value of zero.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-17


Chapter 5 - Ladder Logic Functions

Only one counter can be placed on a single rung.


Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Counter Down - CTD.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Counter Up Down (CTUD)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Counter Up Down function block is a combination of the counter up and counter down function
blocks.

© 2007 Miri Technologies All rights reserved. V3.00 5-18


Chapter 5 - Ladder Logic Functions

CTUD increments the integer current value (CV) for every false to true transition of the counter up
enable bit (CU) and decrements the current value for every false to true transition of the counter
down enable bit (CD). The current value continues to increment or decrement depending on which
enable bit becomes true until either the integer preset value (PV) or zero is reached. At this point,
the up output bit (QU) is enabled if the current value equals the preset value or the down output bit
(QD) is enabled if the current value equals zero.
The output bit remains enabled until reset by a true condition of the (R) or (LD) bit respectively.
When the reset bit (R) is true, the current value resets and remains at zero. When the load bit (LD)
is true, the current value resets and remains at the preset value.

Inputs

CU is the Counter Up enable bit. As long as the reset bit is false, each false to true transition of this
bit increments the current value until the current value equals the preset value. The value of CU is
determined by the Boolean evaluation of elements placed between the left power rail and CU in the
function block. If you do not place any contacts on the rung before CU, the value of CU is always
true but a transition never occurs.
CD is the Counter Down enable bit. As long as the reset bit is false, each false to true transition of
this bit decrements the current value until the current value equals zero. The value of CD is
determined by the Boolean evaluation of elements placed between the left power rail and CD in the
function block. If you do not place any contacts on the rung before CD, the default value of CD is
true.
R is the Counter Up reset bit. When this bit is true, the current value is set to zero and the QD
output bit is disabled. The value of R is determined by the Boolean evaluation of elements placed
between the left power rail and R in the function block. If you do not place any contacts on the rung
before R, the value of R is always false.
LD is the Counter Down load bit. When this bit is true, the current value is set to the preset value
and the QU output bit is disabled. The value of LD is determined by the Boolean evaluation of
elements placed between the left power rail and LD in the function block. If you do not place any
contacts on the rung before LD, the value of LD is always false.
PV is the Counter Up Down preset value. You can assign this input variable a value or point it to a
currently assigned variable in the "Assign Function Block Inputs/Outputs" dialogue box. The range
of values this variable can assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to
65,535 (FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT
(LONG) type variables.

Outputs

QU is the Counter Up output bit. When CU passes power, this bit is enabled and passes power
once the current value is equal to the preset value.
QD is the Counter Down output bit. This bit is enabled and passes power when the current value is
equal to zero. You do not need to place a rung with an output coil between QD in the function block
and the right power rail or connect an output variable to it. Prior to an initial loading of the preset
value, QD is not enabled even though the current value is set to zero.
CV is the Counter Up Down current value. The value of this variable will increment by one every
time a false to true transition of the counter up enable bit occurs. It decrements by one every time a
false to true transition of the counter down enable bit occurs, until the current value equals either
the preset value or zero. The current value retains this value until the reset bit is true. Prior to an
initial loading of the preset value, the value of CV is zero.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-19


Chapter 5 - Ladder Logic Functions

Only one counter can be placed on a single rung.


Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Counter UpDown - CTUD.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Timer Pulse (TP)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Timer Pulse function block enables an output for a preset amount of time.

© 2007 Miri Technologies All rights reserved. V3.00 5-20


Chapter 5 - Ladder Logic Functions

Upon a true condition of the enable bit (INP), TP increments the integer elapsed time (ET) value in
thousandths of a second until the integer preset time (PT) value is reached. During this period of
time only, the output bit (Q) is enabled. The elapsed time value resets to zero once it reaches the
preset value and the enable bit becomes false.

Inputs

INP is the Timer Pulse enable bit. A true condition of this bit triggers the elapsed time to start
incrementing in thousandths of a second until the elapsed time equals the preset time. The value of
INP is determined by the Boolean evaluation of elements placed between the left power rail and
INP in the function block. If you do not place any contacts on the rung before INP, the value of IN is
always true and the output Q will always be ON after the initial scan and the preset time PT has
elapsed.
PT is the Timer Pulse preset time. You can assign this input variable a value or point it to a
currently assigned variable in the "Assign Function Block Inputs/Outputs" dialogue box. The range
of values this variable can assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to
65,535 (FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT
(LONG) type variables.

Outputs

Q is the Timer Pulse output bit. This bit is enabled and passes power when the elapsed time is less
than the preset time and is still incrementing. The output Q will remain true until the preset time PT
has elapsed, irrespective of the state of the input IN.
ET is the Timer Pulse elapsed time. The value of this variable will increment in thousandths of a
second when triggered by a true condition of the enable bit until the elapsed time is equal to the
preset time. The elapsed time retains this value until the enable bit is false. If the enable bit
becomes false before the elapsed time equals the preset time, the elapsed time continues to
increment but resets to zero as soon as it reaches the preset value.

Example Code

A typical example of the function is shown in the following diagram:

Only one timer can be placed on a single rung.


The above example will produce a single pulsed output. To enable a continuous series of pulses
the following code illustrates the use of a Timer On-Delay, TON and a Timer Pulse, TP.

Rung 1 will produce a self-resetting on delay timer for the period set by the TON preset timer PT.
The output Q from this rung is used to trigger a timer pulse TP of duration set by the TP preset
timer PT. In this case, every 5 seconds the output Digital Output1 is pulsed for 2 seconds.
Use the Import Ladder file from disk to quickly add these example rungs to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation.
The filename for the top example is:

© 2007 Miri Technologies All rights reserved. V3.00 5-21


Chapter 5 - Ladder Logic Functions

Example Ladder - Timer Pulse - TP.mml.


The filename for the second example is:
Example Ladder - Timer Pulse ON OFF Periodic - TP.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Timer On-Delay (TON)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Timer On-Delay function block provides a time delay for enabling an event at a preset time
interval.
Upon a true condition of the enable bit (INP), TON increments the integer elapsed time (ET) value
in thousandths of a second until the integer preset time (PT) value is reached. Once the elapsed
time value equals the preset time value, the output bit (Q) is enabled and remains enabled until the
enable bit becomes false. The elapsed time value resets to and remains at zero as long as the
enable bit is false.

Inputs

INP is the Timer On-Delay enable bit. A true condition of this bit triggers the elapsed time to start
incrementing in thousandths of a second until the elapsed time equals the preset time. After this
delay, the output bit is enabled as long as the enable bit remains true. The value of INP is
determined by the Boolean evaluation of elements placed between the left power rail and INP in
the function block. If you do not place any contacts on the rung before INP the value of INP is
always true.

© 2007 Miri Technologies All rights reserved. V3.00 5-22


Chapter 5 - Ladder Logic Functions

PT is the timer on-delay preset time. You can assign this input variable a value or point it to a
currently assigned variable in the "Assign Function Block Inputs/Outputs" dialogue box. The range
of values this variable can assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to
65,535 (FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT
(LONG) type variables.

Outputs

Q is the timer on-delay output bit. This bit is enabled and passes power when the elapsed time
becomes equal to the preset time and remains enabled until the enable bit is false.
ET is the timer on-delay elapsed time. The value of this variable will increment in thousandths of a
second when triggered by a true condition of the enable bit until the elapsed time is equal to the
preset time. The elapsed time retains this value until the enable bit is false. If the enable bit
becomes false before the elapsed time equals the preset time, the elapsed time resets to zero.

Example Code

A typical example of the function is shown in the following diagram:

Only one timer can be placed on a single rung.


Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Timer ON Delay - TON.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Timer Off-Delay (TOFF)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

© 2007 Miri Technologies All rights reserved. V3.00 5-23


Chapter 5 - Ladder Logic Functions

The Timer Off-Delay function block provides a time delay for disabling an event at a preset time
interval.
The output bit (Q) is enabled upon a true condition of the enable bit (INP). When there is a false
condition of the enable bit, TOFF continues to enable the output bit while it increments the integer
elapsed time (ET) value in thousandths of a second until the integer preset time (PT) value is
reached. Once the elapsed time value equals the preset time value, the output is disabled. The
elapsed time value resets and remains at zero whenever the enable bit is true.

Inputs

INP is the Timer Off-Delay enable bit. A true condition of this bit enables the output bit. A false
condition of this bit triggers the elapsed time to start incrementing in thousandths of a second until
the elapsed time equals the preset time. After this delay, the output bit is disabled until the next true
condition of the enable bit. The value of INP is determined by the Boolean evaluation of elements
placed between the left power rail and INP in the function block. If you do not place any contacts on
the rung before INP the value of IN is always true.
PT is the Timer Off-Delay preset time. You can assign this input variable a value or point it to a
currently assigned variable in the "Assign Function Block Inputs/Outputs" dialogue box. The range
of values this variable can assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to
65,535 (FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT
(LONG) type variables.

Outputs

Q is the timer off-delay output bit. This bit is enabled and passes power when the enable bit is true.
When the enable bit is false, it remains enabled until the elapsed time becomes equal to the preset
time.
ET is the timer off-delay elapsed time. The value of this variable will increment in thousandths of a
second when triggered by a false condition of the enable bit until the elapsed time is equal to the
preset time. The elapsed time retains this value until the enable bit is true again. Prior to the first
initialisation of this function block, the elapsed time does not increment even though the enable bit
is false.

Example Code

A typical example of the function is shown in the following diagram:

Only one timer can be placed on a single rung.


Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:

© 2007 Miri Technologies All rights reserved. V3.00 5-24


Chapter 5 - Ladder Logic Functions

Example Ladder - Timer OFF Delay - TOFF.mml.


On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Timer Accumulating (TACC)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Timer Accumulating function block provides a time delay for enabling an event at a preset time
interval similar to the Timer On Delay, TON. The difference between the two timers is that the
accumulated timer elapsed time output ET is maintained rather than resetting to zero as in the
Timer On Delay TON, when the input INP is off and thus will accumulate until the elapsed time ET
equals the preset time PT. The elapsed time output ET is reset to zero via the RST input.
Upon each true condition of the enable bit (INP), TACC increments the integer elapsed time (ET)
value in thousandths of a second until the integer preset time (PT) value is reached. Once the
elapsed time value equals the preset time value, the output bit (Q) is enabled and remains enabled
until the enable bit becomes false. The elapsed time value maintains the last value when the
enable bit is false thus providing an accumulating timer.

© 2007 Miri Technologies All rights reserved. V3.00 5-25


Chapter 5 - Ladder Logic Functions

Inputs

INP is the Timer Accumulating enable bit. A true condition of this bit triggers the elapsed time to
start incrementing in thousandths of a second until the elapsed time equals the preset time. After
this delay, the output bit is enabled as long as the enable bit remains true. The value of INP is
determined by the Boolean evaluation of elements placed between the left power rail and INP in
the function block. If you do not place any contacts on the rung before INP the value of INP is
always true.
RST is the elapsed time reset input. To reset the elapsed time ET to zero the reset RST input must
be enabled.
PT is the timer on-delay preset time. You can assign this input variable a value or point it to a
currently assigned variable in the "Assign Function Block Inputs/Outputs" dialogue box. The range
of values this variable can assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to
65,535 (FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT
(LONG) type variables.

Outputs

Q is the timer on-delay output bit. This bit is enabled and passes power when the elapsed time
becomes equal to the preset time and remains enabled until the enable bit is false.
ET is the timer on-delay elapsed time. The value of this variable increments in thousandths of a
second when triggered by a true condition of the enable bit until the elapsed time is equal to the
preset time. The elapsed time retains this value even when the enable bit is false. If the enable bit
becomes false before the elapsed time equals the preset time, the elapsed time maintains the last
value when the enable bit was true.

Example Code

A typical example of the function is shown in the following diagram:

Only one timer can be placed on a single rung.


Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Timer Accumulating - TACC.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-26


Chapter 5 - Ladder Logic Functions

Data Manipulation Function Block Descriptions


Absolute
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Absolute function block returns the absolute value of a number. The absolute value of a
number is the number without its sign.

Inputs

EN is the Absolute enable bit. A true condition of this bit causes the absolute value of the variable
assigned in RIN to be output to ROUT. The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN in the function block. If you do not place any
contacts on the rung before EN the value of EN is always true.
RIN must be an assigned variable. ROUT must be another assigned variable. The default variable
type for RIN is signed. To use real variables check the real check box in the "Assign Function Block
Inputs/Outputs" dialogue box.

Output

Q is the Absolute output bit. This bit is enabled and passes power when the enable bit is true and
the absolute value defined in RIN has been output to ROUT.
The variable type and ranges used in this function block are shown in the section on number
formats.
Variables are by default treated as signed variables. When the REAL or the UNSIGNED check box
is checked (only one can be checked at a time as they are exclusive variable properties) the input
variable and output variable must be of the same format. Thus, if the output from the variable is to
be expressed in a REAL format, the input to the function block must also be input to the function
block as a REAL. Similarly if the input to the function block is expressed in a REAL format, the
output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results. To be consistent with other function blocks the Assign Function Block
Input/Output dialogue box has the UNSIGNED option, however, using the this option will not
produce a sensible result (i.e. ROUT will be the same as RIN as there is no sign to make an
absolute operation on).

© 2007 Miri Technologies All rights reserved. V3.00 5-27


Chapter 5 - Ladder Logic Functions

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Absolute - ABS.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Greater Than (GT)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Greater Than function block tests if a value is greater than a reference value.
GT tests whether one value (A) is greater than another value (B) when the enable bit (EN) is true. If
the relationship A>B is true, then the output bit (Q) is enabled. The output bit is disabled either
when the enable bit is false or the value of A is no longer greater than B. The values of A and B
can be preset to a constant or assigned variable name, which allows their value to change
dynamically within the program.

© 2007 Miri Technologies All rights reserved. V3.00 5-28


Chapter 5 - Ladder Logic Functions

Inputs

EN is the Greater Than enable bit. A true condition of this bit causes the comparison between A
and B to occur. The value of EN is determined by the Boolean evaluation of elements placed
between the left power rail and EN in the function block. If you do not place any contacts on the
rung before EN the value of EN is always true.
A is one comparison value. B is another comparison value. The default variable type for A and B is
signed. To use unsigned variables check the unsigned check box in the "Assign Function Block
Inputs/Outputs" dialogue box. To use real variables check the real check box in the "Assign
Function Block Inputs/Outputs" dialogue box.

Output

Q is the Greater Than output bit. This bit is enabled and passes power when the enable bit is true
and the value of A is greater than the value of B.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Greater Than - GT.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-29


Chapter 5 - Ladder Logic Functions

Less Than (LT)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Less Than function block tests if a value is less than a reference value.
LT tests whether one value (A) is less than another value (B) when the enable bit (EN) is true. If the
relationship A<B is true, then the output bit (Q) is enabled. The output bit is disabled either when
the enable bit becomes false or the value of A is no longer less than B. The values of A and B can
be preset to a constant or assigned variable name, which allows their value to change dynamically
within the program.

Inputs

EN is the Less Than enable bit. A true condition of this bit causes the comparison between A and B
to occur. The value of EN is determined by the Boolean evaluation of elements placed between the
left power rail and EN in the function block. If you do not place any contacts on the rung before EN
the value of EN is always true.
A is one comparison value. B is another comparison value. The default variable type for A and B is
signed. To use unsigned variables check the unsigned check box in the "Assign Function Block
Inputs/Outputs" dialogue box. To use real variables check the real check box in the "Assign
Function Block Inputs/Outputs" dialogue box.

Output

Q is the Less Than output bit. This bit is enabled and passes power when the enable bit is true and
the value of A is less than the value of B.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

© 2007 Miri Technologies All rights reserved. V3.00 5-30


Chapter 5 - Ladder Logic Functions

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Less Than - LT.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Equal To (EQ)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Equal To function block tests if a value is equal to a reference value.


EQ tests whether one value (A) is equal to another value (B) when the enable bit (EN) is true. If the
relationship A=B is true, then the output bit (Q) is enabled. The output bit is disabled either when
the enable bit is false or the value of A is no longer equal to B. The values of A and B can be preset
to a constant or assigned variable name, which allows their value to change dynamically within the
program.

© 2007 Miri Technologies All rights reserved. V3.00 5-31


Chapter 5 - Ladder Logic Functions

Inputs

EN is the Equal To enable bit. A true condition of this bit causes the comparison between A and B
to occur. The value of EN is determined by the Boolean evaluation of elements placed between the
left power rail and EN in the function block. If you do not place any contacts on the rung before EN,
the value of EN is always true.
A is one comparison value. B is another comparison value. The default variable type for A and B is
signed. To use unsigned variables check the unsigned check box in the "Assign Function Block
Inputs/Outputs" dialogue box. To use real variables check the real check box in the "Assign
Function Block Inputs/Outputs" dialogue box.

Output

Q is the Equal To output bit. This bit is enabled and passes power when the enable bit is true and
the value of A is equal to the value of B.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Equal To - EQ.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-32


Chapter 5 - Ladder Logic Functions

Maximum
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Maximum function block returns the maximum value of two numbers. These can be any
assigned variable or constants.

Inputs

EN is the Maximum enable bit. A true condition of this bit causes the maximum value of the two
variables assigned in inputs A and B to be output to C. The value of EN is determined by the
Boolean evaluation of elements placed between the left power rail and EN in the function block. If
you do not place any contacts on the rung before EN the value of EN is always true.
A and B must be a assigned variables or constants. C must be another assigned variable. The
default variable type for A and B is signed. To use real variables check the real check box in the
"Assign Function Block Inputs/Outputs" dialogue box. To use unsigned variables check the
unsigned check box in the "Assign Function Block Inputs/Outputs" dialogue box.

Output

ENO is the Maximum output bit. This bit is enabled and passes power when the enable bit is true
and the maximum value defined between A and B has been output to C.
The variable type and ranges used in this function block are shown in the section on number
formats.
Variables are by default treated as signed variables. When the REAL or the UNSIGNED check box
is checked (only one can be checked at a time as they are exclusive variable properties) the input
variable and output variable must be of the same format. Thus, if the output from the variable is to
be expressed in a REAL format, the input to the function block must also be input to the function
block as a REAL. Similarly if the input to the function block is expressed in a REAL format, the
output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-33


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Maximum - MAX.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Minimum
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Minimum function block returns the minimum value of two numbers. These can be any
assigned variable or constants.

Inputs

EN is the Minimum enable bit. A true condition of this bit causes the minimum value of the two
variables assigned in inputs A and B to be output to C. The value of EN is determined by the
Boolean evaluation of elements placed between the left power rail and EN in the function block. If
you do not place any contacts on the rung before EN the value of EN is always true.

© 2007 Miri Technologies All rights reserved. V3.00 5-34


Chapter 5 - Ladder Logic Functions

A and B must be a assigned variables or constants. C must be another assigned variable. The
default variable type for A and B is signed. To use real variables check the real check box in the
"Assign Function Block Inputs/Outputs" dialogue box. To use unsigned variables check the
unsigned check box in the "Assign Function Block Inputs/Outputs" dialogue box.

Output

ENO is the maximum output bit. This bit is enabled and passes power when the enable bit is true
and the minimum value defined between A and B has been output to C.
The variable type and ranges used in this function block are shown in the section on number
formats.
Variables are by default treated as signed variables. When the REAL or the UNSIGNED check box
is checked (only one can be checked at a time as they are exclusive variable properties) the input
variable and output variable must be of the same format. Thus, if the output from the variable is to
be expressed in a REAL format, the input to the function block must also be input to the function
block as a REAL. Similarly if the input to the function block is expressed in a REAL format, the
output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Minimum - MIN.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Modulus
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

© 2007 Miri Technologies All rights reserved. V3.00 5-35


Chapter 5 - Ladder Logic Functions

The Modulus function block returns the modulus of two numbers (the remainder after a number is
divided by divisor). The result has the same sign as divisor. These can be any assigned variable or
constants.

Inputs

EN is the Modulus enable bit. A true condition of this bit causes the modulus value of the two
variables assigned in inputs A and B to be output to C, where B is the divisor. The value of EN is
determined by the Boolean evaluation of elements placed between the left power rail and EN in the
function block. If you do not place any contacts on the rung before EN the value of EN is always
true.
A and B must be a assigned variables or constants. C must be another assigned variable. The
default variable type for A and B is signed. To use unsigned variables check the unsigned check
box in the "Assign Function Block Inputs/Outputs" dialogue box.

Output

ENO is the maximum output bit. This bit is enabled and passes power when the enable bit is true
and the modulus value defined in A and B has been output to C.
The variable type and ranges used in this function block are shown in the section on number
formats.
Variables are by default treated as signed variables. When the REAL or the UNSIGNED check box
is checked (only one can be checked at a time as they are exclusive variable properties) the input
variable and output variable must be of the same format. Thus, if the output from the variable is to
be expressed in a REAL format, the input to the function block must also be input to the function
block as a REAL. Similarly if the input to the function block is expressed in a REAL format, the
output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

For example MOD for A = 3/B = 2 equals 1,


MOD for A = -3/B = 2 equals 1, MOD for A = 3/B = -2 equals -1, MOD for A = -3/B = -2 equals -1.

© 2007 Miri Technologies All rights reserved. V3.00 5-36


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Modulus - MOD.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Bit Shift Left (SHL)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Bit Shift Left function block performs a bit shift to the left within a variable D moving the bit by a
defined number of bits N.
When the enable bit (EN) is true, the binary expression of the declared variable (D) will shift within
that variable according to the amount of bits shown in the value of the number of bits variable (N).
The EN will be enabled every scan and thus it must be a transition contact (rising, falling or any).
The length of the shift is determined by the variable type e.g. WORD, LONG. Each transition will
operate the output bit (Q). The values of N and D can be preset to a constant or assigned variable
name, which allows their value to change dynamically within the program.

Inputs

EN is the enable shift bit. Each transition of this bit shifts the contents of the variable one position to
the left in the variable.
N is the SHL size variable. The value assigned to this variable determines the number of bits within
the variable to be shifted. This variable should be either an assigned variable or a constant.

© 2007 Miri Technologies All rights reserved. V3.00 5-37


Chapter 5 - Ladder Logic Functions

Outputs

Q is the SHL output bit. This bit is enabled and passes power when a bit with a true value is shifted
out of the variable assigned in D.
D is the SHL variable that the shift is performed on. This variable should be an assigned variable.

Example Code

A typical example of the function is shown in the following diagram:


Initially the second bit is set ON.

On a positive OFF to ON at the EN enable input the bit will shift to the left a single bit (N=1) as
shown below:

This repeats for every OFF to ON transition at the EN enable input until the bit drops off the end.
This does not wrap, use the ROTATE LEFT ROTL function for this.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Shift Left - SHL.mml.
On Import select option 3 “Merge with import variables taking precedence”.

© 2007 Miri Technologies All rights reserved. V3.00 5-38


Chapter 5 - Ladder Logic Functions

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Bit Shift Right (SHR)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Bit Shift Right function block performs a bit shift to the right within a variable D moving the bit
by a defined number of bits N.
When the enable bit (EN) is true, the binary expression of the declared variable (D) will shift within
that variable according to the amount of bits shown in the value of the number of bits variable (N).
The EN will be enabled every scan and thus it must be a transition contact (rising, falling or any).
The length of the shift is determined by the variable type e.g. WORD, LONG. Each transition will
operate the output bit (Q). The values of N and D can be preset to a constant or assigned variable
name, which allows their value to change dynamically within the program.

Inputs

EN is the enable shift bit. Each transition of this bit shifts the contents of the variable one position to
the right in the variable.
N is the SHR size variable. The value assigned to this variable determines the number of bits within
the variable to be shifted. This variable should be either an assigned variable or a constant.

Outputs

Q is the SHR output bit. This bit is enabled and passes power when a bit with a true value is shifted
out of the variable assigned in D.
D is the SHR variable that the shift is performed on. This variable should be an assigned variable.

© 2007 Miri Technologies All rights reserved. V3.00 5-39


Chapter 5 - Ladder Logic Functions

Example Code

A typical example of the function is shown in the following diagram:


Initially the two most significant bits are set ON.

On a positive OFF to ON at the EN enable input the bits will shift to the right a two bits (N=2) as
shown below:

This repeats for every OFF to ON transition at the EN enable input until the bits drops off the end.
This does not wrap, use the ROTATE RIGHT ROTR function for this.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Shift Right - SHR.mml.
On Import select option 3 “Merge with import variables taking precedence”.

© 2007 Miri Technologies All rights reserved. V3.00 5-40


Chapter 5 - Ladder Logic Functions

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Rotate Left (ROTL)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Rotate Left function block performs a bit shift to the left within a variable D moving the bit by a
defined number of bits N which wraps around within the variable D.
When the enable bit (EN) is true, the binary expression of the declared variable (D) will shift within
that variable according to the amount of bits shown in the value of the number of bits variable (N).
The EN will be enabled every scan and thus it must be a transition contact (rising, falling or any).
The length of the shift is determined by the variable type e.g. WORD, LONG. Each transition will
operate the output bit (Q). The values of N and D can be preset to a constant or assigned variable
name, which allows their value to change dynamically within the program.

Inputs

EN is the enable rotate shift bit. Each transition of this bit shifts the contents of the variable one
position to the left in the variable.
N is the ROTL size variable. The value assigned to this variable determines the number of bits
within the variable to be shifted. This variable should be either an assigned variable or a constant.

Outputs

Q is the ROTL output bit. This bit is enabled and passes power when a bit with a true value is
shifted within the variable assigned in D.
D is the ROTL variable that the rotate shift is performed on. This variable should be an assigned
variable.

Example Code

A typical example of the function is shown in the following diagram:


Initially the first bit in the word is set ON.

© 2007 Miri Technologies All rights reserved. V3.00 5-41


Chapter 5 - Ladder Logic Functions

On a positive OFF to ON at the EN enable input the bit will shift to the left a single bit (N=1)until the
last bit in the word is reached:

On a positive OFF to ON at the EN enable input the bit will shift to the left a single bit popping off
the end to the first bit position again and thus wrapping to the beginning of the word defined in D as
shown below:

© 2007 Miri Technologies All rights reserved. V3.00 5-42


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Rotate Right - ROTL.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Rotate Right (ROTR)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Rotate Right function block performs a bit shift to the right within a variable D moving the bit by
a defined number of bits N which wraps around within the variable D.
When the enable bit (EN) is true, the binary expression of the declared variable (D) will shift within
that variable according to the amount of bits shown in the value of the number of bits variable (N).
The EN will be enabled every scan and thus it must be a transition contact (rising, falling or any).
The length of the shift is determined by the variable type e.g. WORD, LONG. Each transition will
operate the output bit (Q). The values of N and D can be preset to a constant or assigned variable
name, which allows their value to change dynamically within the program.

Inputs

EN is the enable rotate shift bit. Each transition of this bit shifts the contents of the variable one
position to the right in the variable.
N is the ROTR size variable. The value assigned to this variable determines the number of bits
within the variable to be shifted. This variable should be either an assigned variable or a constant.

© 2007 Miri Technologies All rights reserved. V3.00 5-43


Chapter 5 - Ladder Logic Functions

Outputs

Q is the ROTR output bit. This bit is enabled and passes power when a bit with a true value is
shifted within the variable assigned in D.
D is the ROTR variable that the rotate shift is performed on. This variable should be an assigned
variable.

Example Code

A typical example of the function is shown in the following diagram:


Initially the last bit in the word is set ON.

On a positive OFF to ON at the EN enable input the bit will shift to the right a single bit (N=1)until
the first bit in the word is reached:

On a positive OFF to ON at the EN enable input the bit will shift to the right a single bit popping off
the end to the last bit position again and thus wrapping to the end of the word defined in D as
shown below:

© 2007 Miri Technologies All rights reserved. V3.00 5-44


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Rotate Right - ROTR.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Decrement
Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

© 2007 Miri Technologies All rights reserved. V3.00 5-45


Chapter 5 - Ladder Logic Functions

The Decrement function block decreases the value the specified variable by one.
Upon a true condition of the enable bit (EN), PV decrements by one. During this period of time
only, the output bit (Q) is enabled.

Inputs

EN is the Decrement enable bit. A true condition of this bit triggers function to start decrementing
the variable defined in PV by one. The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN in the function block. If you do not place any
contacts on the rung before EN, the value of EN is always true.
PV is the Preset Value. You must assign this input to a currently assigned variable in the "Assign
Function Block Inputs/Outputs" dialogue box. The range of values this variable can assume are
unsigned INT (WORD) or DINT (LONG) which are from 1 to 65,535 (FFFFh) for INT (WORD) type
variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT (LONG) type variables.

Outputs

Q is the Decrement output bit. This bit is enabled and passes power when the increment function is
still decrementing.

Example Code

A typical example of the function is shown in the following diagram:

This function block decrements to 0 after which all bits are set ON (i.e. FFFFh, 1111111111111111
binary) continuing to decrement a bit at a time. Additional logic conditions can be used to
decrement from a set PV value and wrap from 0 back to the PV initial value.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Decrement - DEC.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-46


Chapter 5 - Ladder Logic Functions

Increment
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Increment function block increases the value the specified variable by one.
Upon a true condition of the enable bit (EN), PV increments by one. During this period of time only,
the output bit (Q) is enabled.

Inputs

EN is the Increment enable bit. A true condition of this bit triggers function to start incrementing the
variable defined in PV by one. The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN in the function block. If you do not place any
contacts on the rung before EN, the value of EN is always true.
PV is the Preset Value. You must assign this input to a currently assigned variable in the "Assign
Function Block Inputs/Outputs" dialogue box. The range of values this variable can assume are
unsigned INT (WORD) or DINT (LONG) which are from 1 to 65,535 (FFFFh) for INT (WORD) type
variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT (LONG) type variables.

Outputs

Q is the Increment output bit. This bit is enabled and passes power when the increment function is
still incrementing.

Example Code

A typical example of the function is shown in the following diagram:

This function block increments a bit at a time to FFFFh (1111111111111111 binary), after which all
bits are set OFF.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Increment - INC.mml.

© 2007 Miri Technologies All rights reserved. V3.00 5-47


Chapter 5 - Ladder Logic Functions

On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Move
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Move function can be used to move data in blocks from one physical memory location to
another within the same AD2000 unit. It can also be used to move a constant value to a single
memory location or consecutive memory locations. It has a similar action to the parcel function
where the source and destination station have the same identifier address (i.e. a copy parcel). The
Move function has the advantage of being a part of the Ladder Logic interface and can move up to
256 variables at a time (whereas parcels are limited to 100).

Inputs

EN is the Move enable bit. A true condition of this bit triggers function to move the variable defined
in INP times the number of variables defined by N. The value of EN is determined by the Boolean
evaluation of elements placed between the left power rail and EN in the function block. If you do
not place any contacts on the rung before EN, the value of EN is always true.
INP is the start variable. You must assign this input to a currently assigned variable in the "Assign
Function Block Inputs/Outputs" dialogue box. This can be set to a constant by checking the
Constant check box. The range of values this constant can assume are unsigned INT (WORD) or
DINT (LONG) which are from 1 to 65,535 (FFFFh) for INT (WORD) type variables and 1 to
4,294,967,294 (FFFFFFFFh -1) for DINT (LONG) type variables.

© 2007 Miri Technologies All rights reserved. V3.00 5-48


Chapter 5 - Ladder Logic Functions

N is the number of 16 bit WORD variables to move at one time and has a maximum of 256. For
LONG variable memory types this number is still expressed in terms of 16 bit WORD variables so
to move 20 LONG variables N will be 40 (i.e. 1 LONG is 32 bits so twice the length of a WORD
variable hence double the number).

Outputs

Q is the Move output bit. This bit is enabled and passes power when the move function is
operating.
OUTP is the first variable that the Move function moves the variables to (i.e. the destination
variable). This variable (and all those in the following block) should be assigned variables.

Example Code

A typical example of the function is shown in the following diagram:

There is no online update on this function block, the Watcher screen must be used.This is a typical
use of the MOVE function block. The 16 digital inputs, the 8 Analogue Inputs and the Internal Radio
RSSI values are required for monitoring via the radio network. Each variable is located in different
memory area of the AD2000 Series device memory. If they were sent as polled parcels there would
be multiple radio transmissions which would slow the update time at the master. The MOVE
function block moves the Digital Input variable (containing Digital Input 1-16 status), Analogue Input
1-8 (the 8 physical on-board analogue input channels) and the RD-2 RSSI (Radio Signal Strength
Indicator) to a contiguous block of internal memory variable allocations. This is a typical method
used to ensure that data is sent across the wireless network efficiently. See the section on building
an example map for more details.

© 2007 Miri Technologies All rights reserved. V3.00 5-49


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Move - MOV.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Move Not
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Move function can be used to move data in blocks from one physical memory location to
another within the same AD2000 unit and invert the result (i.e. 0 to 1 and 1 to 0 for each binary
component of the variable). It can also be used to move a constant value to a single memory
location or consecutive memory locations and invert the result. The Move Not function can move
up to 256 variables at a time.

Inputs

EN is the Move Not enable bit. A true condition of this bit triggers function to move the variable
defined in INP times the number of variables defined by N. The value of EN is determined by the
Boolean evaluation of elements placed between the left power rail and EN in the function block. If
you do not place any contacts on the rung before EN, the value of EN is always true.
INP is the start variable. You must assign this input to a currently assigned variable in the "Assign
Function Block Inputs/Outputs" dialogue box. This can be set to a constant by checking the
Constant check box. The range of values this constant can assume are unsigned INT (WORD) or
DINT (LONG) which are from 1 to 65,535 (FFFFh) for INT (WORD) type variables and 1 to
4,294,967,294 (FFFFFFFFh -1) for DINT (LONG) type variables.

© 2007 Miri Technologies All rights reserved. V3.00 5-50


Chapter 5 - Ladder Logic Functions

N is the number of variables to move at one time and has a maximum of 256.
N is the number of 16 bit WORD variables to move at one time and has a maximum of 256. For
LONG variable memory types this number is still expressed in terms of 16 bit WORD variables so
to move 20 LONG variables N will be 40 (i.e. 1 LONG is 32 bits so twice the length of a WORD
variable hence double the number).

Outputs

Q is the Move output bit. This bit is enabled and passes power when the move not function is
operating.
OUTP is the first variable that the Move Not function moves the variables to (i.e. the destination
variable). This variable (and all those in the following block) should be assigned variables.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Move Not - NOT.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-51


Chapter 5 - Ladder Logic Functions

Convert
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Convert function can be used to convert the number format of a variable to another number
format. In all function blocks the input variable must match the output source variable and thus the
Convert function block is used for conversion. A typical use for this is to convert the raw analogue
input memory variables to floating point format for use in the Scale function.
The conversions between the following variables are available:
‰ Word (unsigned 16 bit) - in the range 0 to 65535
‰ Int (signed 16 bit) - in the range –32768 to 32767
‰ Long (signed 32 bit) - in the range –2,147,483,648 to 2,147,483,647
‰ Dint (unsigned 32 bit) - in the range 0 to 4,294,967,295
‰ Float (32 bit) - in the range –10-38 to +10+38

Inputs

EN is the Convert enable bit. A true condition of this bit triggers function to convert the variable
defined in INP. The value of EN is determined by the Boolean evaluation of elements placed
between the left power rail and EN in the function block. If you do not place any contacts on the
rung before EN, the value of EN is always true.
INP is the variable to convert. You must assign this input to a currently assigned variable in the
"Assign Function Block Inputs/Outputs" dialogue box.

Outputs

Q is the Convert output bit. This bit is enabled and passes power when the convert function is
operating and the result is in range.
OUTP is the variable that the Convert function places the result into (i.e. the destination variable).
This variable should be an assigned variable.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-52


Chapter 5 - Ladder Logic Functions

When using Watcher charts to monitor converted variables, ensure that the same number type
has been selected in the Watcher size column as selected in the Convert OUTP variable. This
ensures that the correct number format is displayed rather than the raw data.
For example, the output format on the function below is Type Float (32 bits).

To view this correctly in a watcher chart, the size column must be adjusted from the default watcher
setting to match the converted type so as to display the data correctly.

The variable type and ranges used in this function block are shown in the section on number
formats.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Convert - CON.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-53


Chapter 5 - Ladder Logic Functions

© 2007 Miri Technologies All rights reserved. V3.00 5-54


Chapter 5 - Ladder Logic Functions

AND Word
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The AND Word function block produces the logical AND for the bit values in two variables.
AND Word logically ANDs all the bits of one variable (A) and another variable (B) and places the
result in another variable (C), when the enable bit (EN) is true. The values of A and B can be preset
to a constant or assigned variable name, which allows their value to change dynamically within the
program.

Inputs

EN is the AND Word enable bit. A true condition of this bit causes the values of A to be ANDed to
the bit values of B and the result stored in C. The value of EN is determined by the Boolean
evaluation of elements placed between the left power rail and EN. If you do not place any contacts
on the rung before EN, the value of EN is always true.
A is one value to be ANDed. B is another value to be ANDed. The function block only supports the
ANDing of two single WORDs (INTs) with each other or two LONGs (DINTs) with each other. To
AND multiple contiguous words or longs multiple function blocks should be used.
If this variable is assigned a value out of these ranges, ENO is disabled. C reverts to its last valid
value whenever ENO is disabled.
The variables are normally treated as signed variables. When the UNSIGNED check box is
checked the input variable and output variable must be of the same format. Selecting UNSIGNED
will force checking of any constants used in the AND process to be within the limits shown above.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-55


Chapter 5 - Ladder Logic Functions

This code is using the AND Word function block to AND the contents of two 16 bit words together
and outputs the result to a third word. The Watcher chart shows the result of this process for
illustration.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - And - AND.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-56


Chapter 5 - Ladder Logic Functions

OR Word
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The OR Word function block produces the logical OR for the bit values in two variables.
OR Word logically ORs all the bits of one variable (A) and another variable (B) and places the
result in another variable (C), when the enable bit (EN) is true. The values of A and B can be preset
to a constant or assigned variable name, which allows their value to change dynamically within the
program.

Inputs

EN is the OR Word enable bit. A true condition of this bit causes the values of A to be ORed to the
bit values of B and the result stored in C. The value of EN is determined by the Boolean evaluation
of elements placed between the left power rail and EN. If you do not place any contacts on the rung
before EN, the value of EN is always true.
A is one value to be ORed. B is another value to be ORed. The function block only supports the
ORing of two single WORDs (INTs) with each other or two LONGs (DINTs) with each other. To OR
multiple contiguous words or longs multiple function blocks should be used.
If this variable is assigned a value out of these ranges, ENO is disabled. C reverts to its last valid
value whenever ENO is disabled.
The variables are normally treated as signed variables. When the UNSIGNED check box is
checked the input variable and output variable must be of the same format. Selecting UNSIGNED
will force checking of any constants used in the OR process to be within the limits shown above.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-57


Chapter 5 - Ladder Logic Functions

This code is using the OR Word function block to OR the contents of two 16 bit words together and
outputs the result to a third word. The Watcher chart shows the result of this process for illustration.
For Exclusive OR operations use the XOR function block.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Or - OR.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-58


Chapter 5 - Ladder Logic Functions

XOR Word
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The XOR Word function block produces the logical XOR (eXclusive OR) for the bit values in two
variables.
XOR Word logically XORs all the bits of one variable (A) and another variable (B) and places the
result in another variable (C), when the enable bit (EN) is true. The values of A and B can be preset
to a constant or assigned variable name, which allows their value to change dynamically within the
program.

Inputs

EN is the XOR Word enable bit. A true condition of this bit causes the values of A to be XORed to
the bit values of B and the result stored in C. The value of EN is determined by the Boolean
evaluation of elements placed between the left power rail and EN. If you do not place any contacts
on the rung before EN, the value of EN is always true.
A is one value to be XORed. B is another value to be XORed. The function block only supports the
ORing of two single WORDs (INTs) with each other or two LONGs (DINTs) with each other. To
XOR multiple contiguous words or longs multiple function blocks should be used.
If this variable is assigned a value out of these ranges, ENO is disabled. C reverts to its last valid
value whenever ENO is disabled.
The variables are normally treated as signed variables. When the UNSIGNED check box is
checked the input variable and output variable must be of the same format. Selecting UNSIGNED
will force checking of any constants used in the XOR process to be within the limits shown above.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-59


Chapter 5 - Ladder Logic Functions

This code is using the XOR Word function block to XOR the contents of two 16 bit words together
and outputs the result to a third word. The Watcher chart shows the result of this process for
illustration.
For basic OR operations use the OR function block.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder – Exclusive Or - XOR.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-60


Chapter 5 - Ladder Logic Functions

Arithmetic & Mathematic Function Block Descriptions


Add (ADD)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Add function block produces the sum of two values.


ADD calculates the sum of one value (A) and another value (B) and places the result in another
variable (C), when the enable bit (EN) is true. The values of A and B can be preset to a constant or
assigned variable name, which allows their value to change dynamically within the program.

Inputs

EN is the Add enable bit. A true condition of this bit causes the value of A to be added to the value
of B and the result stored in C. The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN. If you do not place any contacts on the rung
before EN, the value of EN is always true.
A is one value to be added. B is another value to be added.

Outputs

ENO is the Add enable out bit. This bit is enabled and passes power when the enable bit is true, as
long as the value of C does not go out of range.
C is the sum. C contains the sum of the addition of A and B, as long as the enable bit is true.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

© 2007 Miri Technologies All rights reserved. V3.00 5-61


Chapter 5 - Ladder Logic Functions

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Add - ADD.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Subtract (SUB)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Subtract function block produces the difference between two values.
SUB calculates the difference between one value (A) and another value (B) and places the result in
another variable (C), when the enable bit (EN) is true. The values of A and B can be preset to a
constant or assigned variable name, which allows their value to change dynamically within the
program.

© 2007 Miri Technologies All rights reserved. V3.00 5-62


Chapter 5 - Ladder Logic Functions

Inputs

EN is the Subtract enable bit. A true condition of this bit causes the value of B to be subtracted
from the value of A and the result stored in C. The value of EN is determined by the Boolean
evaluation of elements placed between the left power rail and EN in the function block. If you do
not place any contacts on the rung before EN, the value of EN is always true.
A is the value to be subtracted from. B is the value to subtract.

Outputs

ENO is the Subtract enable out bit. This bit is enabled and passes power when the enable bit is
true, as long as the value of C does not go out of range.
C is the difference. C contains the difference between A and B, as long as the enable bit is true.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Subtract - SUB.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-63


Chapter 5 - Ladder Logic Functions

Multiply (MUL)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Multiply function block produces the product of two values.


MUL calculates the product between one value (A) and another value (B) and places the result in
another variable (C), when the enable bit (EN) is true. The values of A and B can be preset to a
constant or assigned variable name, which allows their value to change dynamically within the
program.

Inputs

EN is the Multiply enable bit. A true condition of this bit causes the values of A and B to be
multiplied and the result stored in C. The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN in the function block. If you do not place any
contacts on the rung before EN, the value of EN is always true. A is a multiply value. B is another
multiply value.

Outputs

ENO is the Multiply enable out bit. This bit is enabled and passes power when the enable bit is
true, as long as the value of C does not go out of range.
C is the product value. C contains the product of A and B, as long as the enable bit is true.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-64


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Multiply - MUL.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Divide (DIV)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Divide function block produces the quotient of two values.


DIV calculates the quotient between one value (A) which is the dividend and another value (B)
which is the divisor and places the result in another variable (C), when the enable bit (EN) is true.
The values of A and B can be preset to a constant or assigned variable name, which allows their
value to change dynamically within the program.

© 2007 Miri Technologies All rights reserved. V3.00 5-65


Chapter 5 - Ladder Logic Functions

Inputs

EN is the Divide enable bit. A true condition of this bit causes the value of A to be divided by the
value of B and the result stored in C. The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN in the function block. If you do not place any
contacts on the rung before EN, the value of EN is always true.
A is the dividend. B is the divisor. If B is assigned a value of zero (0), the ENO enable out bit
changes state to false and C retains its previous value.

Outputs

ENO is the Divide enable out bit. This bit is enabled and passes power when the EN enable bit is
true as long as the value of B is non-zero and value of C does not go out of range.
C is the quotient. C contains the quotient of A and B, as long as the enable bit is true.
For all variable types other than REAL, no remainders are stored in this value; only the whole
number value. If this variable is assigned a value out of these ranges, ENO is disabled. C reverts to
its last valid value whenever ENO is disabled.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Divide - DIV.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-66


Chapter 5 - Ladder Logic Functions

Cosine (COS)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The COS function block produces the Cosine of the input variable RIN and outputs this to the
output variable ROUT when the enable bit (EN) is true.

The input variable RIN must be expressed in terms of Radians and the output ROUT is written
in terms of Radians (the Degree to Radian function block should be used to perform this
conversion).
The value of RIN can be preset to a constant or assigned variable name, which allows their value
to change dynamically within the program.

Inputs

EN is the Cosine enable bit. A true condition of this bit causes the Cosine of the floating point
number (in terms of Radians) of RIN to be calculated and the result stored in ROUT (as a floating
point number in terms of Radians). The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN in the function block. If you do not place any
contacts on the rung before EN, the value of EN is always true.

Outputs

Q is the Cosine output bit. This bit is enabled and passes power when the enable bit is true and the
absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:

© 2007 Miri Technologies All rights reserved. V3.00 5-67


Chapter 5 - Ladder Logic Functions

Example Ladder - Cosine - COS.mml.


On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Sine (SIN)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The SIN function block produces the Sine of the input variable RIN and outputs this to the output
variable ROUT when the enable bit (EN) is true.

The input variable RIN must be expressed in terms of Radians and the output ROUT is written
in terms of Radians (the Degree to Radian function block should be used to perform this
conversion).
The value of RIN can be preset to a constant or assigned variable name, which allows their value
to change dynamically within the program.

Inputs

EN is the Sine enable bit. A true condition of this bit causes the Sine of the floating point number (in
terms of Radians) of RIN to be calculated and the result stored in ROUT (as a floating point
number in terms of Radians). The value of EN is determined by the Boolean evaluation of elements
placed between the left power rail and EN in the function block. If you do not place any contacts on
the rung before EN, the value of EN is always true.

© 2007 Miri Technologies All rights reserved. V3.00 5-68


Chapter 5 - Ladder Logic Functions

Outputs

Q is the Sine output bit. This bit is enabled and passes power when the enable bit is true and the
absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Sine - SIN.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Tangent (TAN)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.

© 2007 Miri Technologies All rights reserved. V3.00 5-69


Chapter 5 - Ladder Logic Functions

The TAN function block produces the Tangent of the input variable RIN and outputs this to the
output variable ROUT when the enable bit (EN) is true.

The input variable RIN must be expressed in terms of Radians and the output ROUT is written
in terms of Radians (the Degree to Radian function block should be used to perform this
conversion).
The value of RIN can be preset to a constant or assigned variable name, which allows their value
to change dynamically within the program.

Inputs

EN is the Tangent enable bit. A true condition of this bit causes the Tangent of the floating point
number (in terms of Radians) of RIN to be calculated and the result stored in ROUT (as a floating
point number in terms of Radians). The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN in the function block. If you do not place any
contacts on the rung before EN, the value of EN is always true.

Outputs

Q is the Tangent output bit. This bit is enabled and passes power when the enable bit is true and
the absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Tangent - TAN.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-70


Chapter 5 - Ladder Logic Functions

ArcCosine (ARCCOS)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The ARCCOS function block produces the Inverse (Arc) Cosine of the input variable RIN and
outputs this to the output variable ROUT when the enable bit (EN) is true. This is read as “ROUT is
the angle (in Radians) whose Cosine is RIN”.

The input variable RIN must be expressed in terms of Radians and the output ROUT is written
in terms of Radians (the Degree to Radians and Radians to Degrees function blocks can be used
to perform these conversions if required).
The value of RIN can be preset to a constant or assigned variable name, which allows their value
to change dynamically within the program.

Inputs

EN is the ArcCosine enable bit. A true condition of this bit causes the Inverse (Arc) Cosine of the
floating point number (in terms of Radians) of RIN to be calculated and the result stored in ROUT
(as a floating point number in terms of Radians). The value of EN is determined by the Boolean
evaluation of elements placed between the left power rail and EN in the function block. If you do
not place any contacts on the rung before EN, the value of EN is always true.

Outputs

Q is the ArcCosine output bit. This bit is enabled and passes power when the enable bit is true and
the absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-71


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Arc Cosine - ARCCOS.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

ArcSine (ARCSIN)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The ARCSIN function block produces the Inverse (Arc) Sine of the input variable RIN and outputs
this to the output variable ROUT when the enable bit (EN) is true. This is read as “ROUT is the
angle (in Radians) whose Sine is RIN”.

The input variable RIN must be expressed in terms of Radians and the output ROUT is written
in terms of Radians (the Degree to Radians and Radians to Degrees function blocks can be used
to perform these conversions if required).

© 2007 Miri Technologies All rights reserved. V3.00 5-72


Chapter 5 - Ladder Logic Functions

The value of RIN can be preset to a constant or assigned variable name, which allows their value
to change dynamically within the program.

Inputs

EN is the ArcSine enable bit. A true condition of this bit causes the Inverse (Arc) Sine of the floating
point number (in terms of Radians) of RIN to be calculated and the result stored in ROUT (as a
floating point number in terms of Radians). The value of EN is determined by the Boolean
evaluation of elements placed between the left power rail and EN in the function block. If you do
not place any contacts on the rung before EN, the value of EN is always true.

Outputs

Q is the ArcSine output bit. This bit is enabled and passes power when the enable bit is true and
the absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Arc Sine - ARCSIN.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-73


Chapter 5 - Ladder Logic Functions

ArcTangent (ARCTAN)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The ARCTAN function block produces the Inverse (Arc) Tangent of the input variable RIN and
outputs this to the output variable ROUT when the enable bit (EN) is true. This is read as “ROUT is
the angle (in Radians) whose Tangent is RIN”.

The input variable RIN must be expressed in terms of Radians and the output ROUT is written
in terms of Radians (the Degree to Radians and Radians to Degrees function blocks can be used
to perform these conversions if required).
The value of RIN can be preset to a constant or assigned variable name, which allows their value
to change dynamically within the program.

Inputs

EN is the ArcTan enable bit. A true condition of this bit causes the Inverse (Arc) Tangent of the
floating point number (in terms of Radians) of RIN to be calculated and the result stored in ROUT
(as a floating point number in terms of Radians). The value of EN is determined by the Boolean
evaluation of elements placed between the left power rail and EN in the function block. If you do
not place any contacts on the rung before EN, the value of EN is always true.

Outputs

Q is the ArcTan output bit. This bit is enabled and passes power when the enable bit is true and the
absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-74


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Arc Tangent - ARCTAN.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Log Natural (LOG_LN)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The LOG_LN function block produces the Natural Log of the input variable RIN and outputs this to
the output variable ROUT when the enable bit (EN) is true. This can be read as ROUT = Log_Lne x
RIN where e = 2.718. The value of RIN can be preset to a constant or assigned variable name,
which allows their value to change dynamically within the program.

Inputs

EN is the Log_Ln enable bit. A true condition of this bit causes the Log_Ln of the floating point
number of RIN to be calculated and the result stored in ROUT (as a floating point number). The
value of EN is determined by the Boolean evaluation of elements placed between the left power rail
and EN in the function block. If you do not place any contacts on the rung before EN, the value of
EN is always true.

© 2007 Miri Technologies All rights reserved. V3.00 5-75


Chapter 5 - Ladder Logic Functions

Outputs

Q is the Log_Ln output bit. This bit is enabled and passes power when the enable bit is true and
the absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Log Natural - LOG_LN.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Exponential (EXPONENTIAL)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.

© 2007 Miri Technologies All rights reserved. V3.00 5-76


Chapter 5 - Ladder Logic Functions

The EXPONENTIAL function block produces the Exponential of the input variable RIN and outputs
this to the output variable ROUT when the enable bit (EN) is true. This can be read as ROUT =
EXP x RIN (i.e ROUT = eRIN). This is will undo the LOG_LN function. The value of RIN can be
preset to a constant or assigned variable name, which allows their value to change dynamically
within the program.

Inputs

EN is the Exponential enable bit. A true condition of this bit causes the Exponential of the floating
point number of RIN to be calculated and the result stored in ROUT (as a floating point number).
The value of EN is determined by the Boolean evaluation of elements placed between the left
power rail and EN in the function block. If you do not place any contacts on the rung before EN, the
value of EN is always true.

Outputs

Q is the Exponential output bit. This bit is enabled and passes power when the enable bit is true
and the absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Exponential - EXPONENTIAL.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-77


Chapter 5 - Ladder Logic Functions

Log Base10 (LOG_10)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The LOG_10 function block produces the Logarithm to base 10 of the input variable RIN and
outputs this to the output variable ROUT when the enable bit (EN) is true. This can be read as
ROUT = Log_10 x RIN. The value of RIN can be preset to a constant or assigned variable name,
which allows their value to change dynamically within the program.

Inputs

EN is the Log_10 enable bit. A true condition of this bit causes the Log_10 of the floating point
number of RIN to be calculated and the result stored in ROUT (as a floating point number). The
value of EN is determined by the Boolean evaluation of elements placed between the left power rail
and EN in the function block. If you do not place any contacts on the rung before EN, the value of
EN is always true.

Outputs

Q is the Log_10 output bit. This bit is enabled and passes power when the enable bit is true and
the absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Log 10 - LOG_10.mml.
On Import select option 3 “Merge with import variables taking precedence”.

© 2007 Miri Technologies All rights reserved. V3.00 5-78


Chapter 5 - Ladder Logic Functions

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Square Root (SQRT)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The SQRT function block produces the Square Root of the input variable RIN and outputs this to
the output variable ROUT when the enable bit (EN) is true. The value of RIN can be preset to a
constant or assigned variable name, which allows their value to change dynamically within the
program.

Inputs

EN is the SQRT enable bit. A true condition of this bit causes the SQRT of the floating point
number of RIN to be calculated and the result stored in ROUT (as a floating point number). The
value of EN is determined by the Boolean evaluation of elements placed between the left power rail
and EN in the function block. If you do not place any contacts on the rung before EN, the value of
EN is always true.

Outputs

Q is the SQRT output bit. This bit is enabled and passes power when the enable bit is true and the
absolute value defined in RIN has been output to ROUT.

© 2007 Miri Technologies All rights reserved. V3.00 5-79


Chapter 5 - Ladder Logic Functions

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Square Root - SQRT.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Power (POWER)
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The POWER function block raises one variable to the power of the other variable.

© 2007 Miri Technologies All rights reserved. V3.00 5-80


Chapter 5 - Ladder Logic Functions

POWER calculates the power of one value (A) to the order defined by the other value (B) and
places the result in another variable (C), when the enable bit (EN) is true. The values of A and B
can be preset to a constant or assigned variable name, which allows their value to change
dynamically within the program.

Inputs

EN is the POWER enable bit. A true condition of this bit causes the value of A to be raised to the
power of B and the result stored in C. The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN. If you do not place any contacts on the rung
before EN, the value of EN is always true.
A is the value to be operated on. B is order to which the value is raised.

Outputs

ENO is the POWER enable out bit. This bit is enabled and passes power when the enable bit is
true, as long as the value of C does not go out of range.
C is the result. C contains the power of A raised to the order of B, as long as the enable bit is true.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Power - POWER.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-81


Chapter 5 - Ladder Logic Functions

Degree To Radian (DEGCON)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The DEGCON function block converts of the input variable RIN which is expressed in terms of
Degrees to the output variable ROUT expressed in terms of Radian when the enable bit (EN) is
true. The value of RIN can be preset to a constant or assigned variable name, which allows their
value to change dynamically within the program.

Inputs

EN is the DEGCON enable bit. A true condition of this bit causes the conversion of the floating
point number in Degrees of RIN to be expressed in Radians and the result stored in ROUT (as a
floating point number). The value of EN is determined by the Boolean evaluation of elements
placed between the left power rail and EN in the function block. If you do not place any contacts on
the rung before EN, the value of EN is always true.

Outputs

Q is the DEGCON output bit. This bit is enabled and passes power when the enable bit is true and
the absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder – Degree To Radian - DEGCON.mml.
On Import select option 3 “Merge with import variables taking precedence”.

© 2007 Miri Technologies All rights reserved. V3.00 5-82


Chapter 5 - Ladder Logic Functions

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Maths refresher.

Degrees and radians


It is really quite simple if you remember two things. Working in degrees, one revolution is 360
degrees. When working in radians, there are two pi (2 times Π - i.e. Pi) radians in one revolution
(where Π = 3.141592). So it becomes evident that:
360 degrees = 2 Π radians so that:
1 degree = 2 Π /360 radians = .0175 rad (approx) or
1 radian = 360/(2 Π) = 57.3 degrees (approx)
‰ To convert radians into degrees you should multiply by 180/ Π.
‰ To convert degrees into radians you should multiply by Π /180.

Radian To Degree (RADCON)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

All variables used in this function block must be expressed in terms of a floating point numbers.
The CONVERT TO function block can be used to perform the conversion in the Ladder Logic if
required.
The RADCON function block converts of the input variable RIN which is expressed in terms of
Radians to the output variable ROUT expressed in terms of Degrees when the enable bit (EN) is
true. The value of RIN can be preset to a constant or assigned variable name, which allows their
value to change dynamically within the program.

© 2007 Miri Technologies All rights reserved. V3.00 5-83


Chapter 5 - Ladder Logic Functions

Inputs

EN is the RADCON enable bit. A true condition of this bit causes the conversion of the floating
point number in Radians of RIN to be expressed in Degrees and the result stored in ROUT (as a
floating point number). The value of EN is determined by the Boolean evaluation of elements
placed between the left power rail and EN in the function block. If you do not place any contacts on
the rung before EN, the value of EN is always true.

Outputs

Q is the RADCON output bit. This bit is enabled and passes power when the enable bit is true and
the absolute value defined in RIN has been output to ROUT.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder – Radian To Degree - RADCON.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Maths refresher.

Degrees and radians


It is really quite simple if you remember two things. Working in degrees, one revolution is 360
degrees. When working in radians, there are two pi (2 times Π - i.e. Pi) radians in one revolution
(where Π = 3.141592). So it becomes evident that:
360 degrees = 2 Π radians so that:
1 degree = 2 Π /360 radians = .0175 rad (approx) or
1 radian = 360/(2 Π) = 57.3 degrees (approx)
‰ To convert radians into degrees you should multiply by 180/ Π.
‰ To convert degrees into radians you should multiply by Π /180.

© 2007 Miri Technologies All rights reserved. V3.00 5-84


Chapter 5 - Ladder Logic Functions

Special Function Block Descriptions


There are several special function codes that have been developed for various particular user
requirements and as aids to the process of event parcel generation for the AD2000 report by
exception facilities. These are detailed in the following sections.

Change Detect (CHD)


The Function Block symbol is shown below:

The facility to define Change Detect on more than a single variable is only supported from
MiriMap2000+ Version 2.10 onwards.
The Assign Function Block Input/Output dialogue box is shown below:

The Change Detect, CHD, function block is designed for use with the event parcel processing for
the AD2000 mapping processing. Any variable can be assigned as an input to the function block.
On each scan the current value of the number of variables are compared to the value read on the
previous scan. If the difference matches the chosen change value DV the function operates. Note
that for single bit change detect the Positive Transition Contact - Ctrl+F2, Negative Transition
Contact - Ctrl+F3, Any Transition Contact - Shift+F2 can be used. The CHD function block should
be used to detect a bit change in a word variable, e.g. any bit in the Digital Input variable or a
change in an Analogue Input variable.

Inputs

EN is the Change Detect enable bit. A true condition of this bit causes the variable V to be
compared with the variable CV to detect a change as defined by the input parameters.
The Function Block input parameters are:
‰ V - the first variable the change is to be detected in
‰ N - the number of words starting at variable V, the change is to be detected in
‰ DV - the change (delta) value to detect for all the variables in the block.
There are three check boxes that further specify the mode of change detect:
‰ Delta - will detect any change
‰ Rise - will detect only a positive change
‰ Fall - will detect only a negative change.

© 2007 Miri Technologies All rights reserved. V3.00 5-85


Chapter 5 - Ladder Logic Functions

Outputs

Q is the CHD enable out bit. This bit is enabled and passes power when the enable bit is true and a
change has been detected as long as the value of CV of non-zero does not go out of range. This
will be on only once per scan as once the function block has been processed and the Q enable out
bit is true the value of V and CV will be equal and the next change detect will be processed.
CV is the value of the variable V in the previous scan when the EN enable bit for the function block
is true.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

The example above uses the CHD function block to detect a bit change (a delta change, or any
change) for the Digital Inputs and this in turn enables the PARCEL function to send a chosen
parcel from the AD2000 Series unit to another. See the PARCEL function block for further details
and the section on creating Event Parcels and for a basic discussion on event parcels see the
paragraph about periodically polled data with events in the section about data gathering
techniques.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Change Detect - CHD.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-86


Chapter 5 - Ladder Logic Functions

High Speed Counter for DIN1 and DIN2

High Speed DIN2 is only available on the AD2006.


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The High Speed Counter function block provides an up counter for high speed pulsed digital inputs
available on Digital Input1 (DIN1) on the AD2000 units and Digital Inputs 1 and 2 (DIN1 and DIN2)
on the AD2006 units. The High Speed Counter1 (for DIN1) and High Speed Counter2 (for DIN2)
function blocks are special types of counters which accumulate the number of pulses counted on
the EN input. This function is for use only on high-speed digital inputs DIN1 and DIN2 not normal
low speed inputs (use the CTU/CTD and CTUD counter function blocks for these). These will suit
maximum pulse frequency rates of 5kHz (5000 pulses per second).
The High Speed Counter function block enables an output Q after the current counter value CV
equals the preset counter value PV.
There are two steps to enable the AD2000 Series devices to use high-speed counter inputs.
‰ Step 1 - Check the software setting in MiriMap2000+ to enable the option. There is also a
hardware jumper setting to be made. Note they differ between AD2000 Series models and
are listed on the Station Properties General tab as shown below:

‰ Step 2 - The wiring is also different for the high-speed inputs and this is detailed in the
following diagram. For further information refer to the AD2000 Series Installation and Wiring
Manual.

© 2007 Miri Technologies All rights reserved. V3.00 5-87


Chapter 5 - Ladder Logic Functions

Inputs

EN is the High-Speed Counter enable bit. There must be no contacts on the rung before EN, so the
value of EN is always true.
R is the high-speed counter reset bit. When this bit is true, the current value is set to zero and the
output bit is disabled. The value of R is determined by the Boolean evaluation of elements placed
between the left power rail and R. A connection must be made to R.
PV is the high-speed counter preset value. You can assign this input variable a constant value or
point it to a currently assigned variable in the "Assign Function Block Inputs/Outputs" dialogue box.
The range of values this variable can assume are unsigned INT (WORD) or DINT (LONG) which
are from 1 to 65,535 (FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh
-1) for DINT (LONG) type variables.

Outputs

Q is the high-speed counter output bit. This bit is enabled and passes power when the current
value is equal to the preset value.
CV is the high-speed counter current value. You must assign this output variable to any assigned
32 bit variable (i.e. a %ML LONG memory) via a nickname or memory address in the "Assign
Function Block Inputs/Outputs" dialogue box. The value of this variable will increment by one every
time a false to true transition of the counter up enable bit occurs until the current value equals the
preset value. The current value retains its value until the reset bit is true.

Example Code

A typical example of the function is shown in the following diagram:

Only one counter can be placed on a single rung.

Outputs CV must be assigned to a 32 bit DINT (LONG) type variable.


Use the Import Ladder file from disk to quickly add these example rungs to your logic. The files are
stored in the Examples folder under MiriMap2000+ installation, filenames:
Example Ladder - High Speed Counter1 - CTU1.mml.
Example Ladder - High Speed Counter2 - CTU2.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-88


Chapter 5 - Ladder Logic Functions

High Speed Rate Calculation for DIN1 and DIN2

High Speed DIN2 is only available on the AD2006.


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The High Speed RATE function block provides the calculation of rate values for high speed pulsed
digital inputs to digital inputs 1 on the AD2000 units and digital inputs 1 and 2 (DIN1 and DIN2) on
the AD2006 units. The High Speed RATE1 (for DIN1) and High Speed RATE2 (for DIN2) function
blocks are special types of counters which accumulate the number of pulses counted on the CU
input. Every time period specified by PT, the rate is calculated by multiplying the number of pulses
counted in the last elapsed time period PT by the number of units specified by the value entered at
PV. This function is for use only on high-speed digital inputs DIN1 and DIN2 on the AD2000 unit
not normal low speed inputs (use the RATE function block for these). These will suit maximum
pulse frequency rates of 5kHz (5000 pulses per second).
The High Speed RATE function block enables an output Q after the current counter value CV
equals the preset counter value PV.
There are two steps to enable the AD2000 Series devices to use high-speed RATE inputs.
‰ Step 1 - Check the software setting in MiriMap2000+ to enable the option. There is also a
hardware jumper setting to be made. Note they differ between AD2000 Series models and
are listed on the Station Properties General tab as shown below:

‰ Step 2 - The wiring is also different for the high-speed inputs and this is detailed in the
following diagram. For further information refer to the AD2000 Series Installation and Wiring
Manual.

© 2007 Miri Technologies All rights reserved. V3.00 5-89


Chapter 5 - Ladder Logic Functions

Inputs

EN is the High-Speed Rate counter enable bit. There must be no contacts on the rung before EN,
so the value of EN is always true.
R is the High-Speed Rate counter reset bit. When this bit is true, the current value is set to zero
and the output bit is disabled. The value of R is determined by the Boolean evaluation of elements
placed between the left power rail and R. A connection must be made to R.
PT is the Period Time value over which the rate is to be calculated. This must be expressed in
seconds.
PV is the High-Speed Rate preset value. This is the number of units that each pulse counted on
CU represents, e.g. 1, 10, 100, 1000 etc. Typical examples for the use of the rate function block
are where a flow meter provides a pulse per litre of fluid. If each pulse represents 100 litres of fluid
then the PV entered would be 100.
You can assign this input variable a constant value or point it to a currently assigned variable in the
"Assign Function Block Inputs/Outputs" dialogue box. The range of values this variable can
assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to 65,535 (FFFFh) for INT
(WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT (LONG) type variables.

Outputs

Q is the High-Speed Rate output bit. This bit is enabled and passes power each time the PT time
period has elapsed. It is not necessary to assign an output variable to this. A No Operation coil,
NOP is suitable.
CV is the High-Speed Rate counter current value. You must assign this output variable to any
assigned variable memory via a nickname or memory address in the "Assign Function Block
Inputs/Outputs" dialogue box. The value of this variable will increment by one every time a false to
true transition of the counter up enable bit occurs until the current value equals the preset value.
The current value retains its value until the reset bit is true. This variable must be assigned to DINT
(LONG) type variables which range in value from 1 to 4,294,967,295 (FFFFFFFFh).
RV is the High-Speed Rate current value. It is the result of the number of pulses counted in the last
time period PT multiplied by the PV RATE preset value. You must assign this output variable to any
assigned variable memory via a nickname or memory address in the "Assign Function Block
Inputs/Outputs" dialogue box. The value of this variable increments by one every time a false to
true transition of the counter up enable bit occurs until the current value equals the preset value.
The current value retains its value until the reset bit is true. This variable must be assigned to 32 bit
DINT (LONG) type variables which range in value from 1 to 4,294,967,295 (FFFFFFFFh).

Example Code

A typical example of the function is shown in the following diagram:

Outputs CV and RV must be assigned to 32 bit DINT (LONG) type variables.

© 2007 Miri Technologies All rights reserved. V3.00 5-90


Chapter 5 - Ladder Logic Functions

Use the Import Ladder file from disk to quickly add these example rungs to your logic. The files are
stored in the Examples folder under MiriMap2000+ installation, filenames:
Example Ladder - Rate Counter1 - RATE1.mml.
Example Ladder - Rate Counter2 - RATE2.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Log Data Variable (LOG)

This is NOT a logarithmic function block, see the function blocks Log Base 10 and Log Natural
for such operations.
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The LOG function block is used to write a variable to FLASH memory from within the Ladder Logic
interface as opposed to using the data-log interface available within the MiriMap2000+ software
package.

Inputs

EN is the LOG enable bit. A true condition of this bit causes the variable PV to be logged to FLASH
memory. This must be on only once per scan to avoid constantly sending log data to the AD2000
FLASH memory and possibly causing a log memory overflow condition which will effect other data-
logging variables.
PV is the variable to LOG. This can be a variable or a constant.

© 2007 Miri Technologies All rights reserved. V3.00 5-91


Chapter 5 - Ladder Logic Functions

Logging constants is a memory efficient way to record digital events. Rather than recording a text
string (e.g. Critical Fault, Level Low) which will use a byte per character and waste data-log
memory) a code per digital event can be created (e.g. 1 = Critical Fault, 2 = Level Low) and these
logged as constants. The some cross reference table can be used by the user to determine the
meaning. To record text strings use the Text Messages utility with event parcels and log with the
Parcels Function Block.

Outputs

Q is the LOG enable out bit. This bit is enabled and passes power when the EN enable bit is true
and the LOG function block has successfully written the variable PV to FLASH memory.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Log Data - LOG.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-92


Chapter 5 - Ladder Logic Functions

Moving Average (MAVG)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Moving Average MAVG function block takes a variable (as assigned by the input INP), and on
each scan adds the current value of each sample to an accumulated value (up to the number of
samples as defined in N). After this, the accumulated total is divided by the sample number N and
the average output to the variable assigned in OUTP. After the initial sample is taken the last
sample is added to the total and the oldest removed and the average calculated on the current
total. This will continue whilst the enable bit N is ON.

Inputs

EN is the Moving Average MAVG enable bit. A true condition of this bit triggers function to start
taking samples on each scan for the variable defined in INP. The value of EN is determined by the
Boolean evaluation of elements placed between the left power rail and EN in the function block. If
you do not place any contacts on the rung before EN, the value of EN is always true.
INP is the variable to be averaged. You must assign this input to currently assigned variable or
constant in the "Assign Function Block Inputs/Outputs" dialogue box. The range of values this
variable can assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to 65,535
(FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT (LONG)
type variables or REAL variables -10-38 to +10+38.
N is the Number of samples. You must assign this input to currently assigned variable or constant
in the "Assign Function Block Inputs/Outputs" dialogue box. The range of values this variable can
assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to 65,535 (FFFFh) for INT
(WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT (LONG) type variables or
REAL variables ranging from -10-38 to +10+38.

Outputs

Q is the Moving Average MAVG output bit. This bit is enabled and passes power when the MAVG
function is successful.
OUTP is the last calculated moving average value. You must assign this input to currently assigned
variable in the "Assign Function Block Inputs/Outputs" dialogue box. The range of values this
variable can assume are unsigned INT (WORD) or DINT (LONG) which are from 1 to 65,535
(FFFFh) for INT (WORD) type variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT (LONG)
type variables or REAL variables ranging from -10-38 to +10+38.

© 2007 Miri Technologies All rights reserved. V3.00 5-93


Chapter 5 - Ladder Logic Functions

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Moving Average - MAVG.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Parcel
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The PARCEL function block is used to configure EVENT parcels NOT POLLED parcels. Normally
parcels are specified as polled parcels for the station in the map and these are processed
automatically (i.e. no user configuration other than marking the parcel as “polled” is required). An
example of a polled parcel is shown below (parcel #2):

© 2007 Miri Technologies All rights reserved. V3.00 5-94


Chapter 5 - Ladder Logic Functions

Should a specific variable or block of variables be required to be sent on an event (e.g. a change
detect on the Digital Inputs on the AD2000 Series devices) then the parcel can be defined as an
event type parcel.

To use an event parcel in the PARCEL function block the parcel must be defined first. Refer to
the section on event parcel for further details about this process.
The event parcels can be triggered by the LOG function block to send SMS text messages or data-
log text messages (or a combination).
To send the parcel on the event as an SMS text messages check the SMS Message check box.
To send the parcel on the event as a data-logged text message check the Log Message check
box.

Inputs

EN is the Parcel function block enable bit. A true condition of this bit causes the parcel P1 to be
sent according to the mapped route as determined in the parcel properties for the station on which
the Ladder Logic is operating. This must be on only once per scan to avoid constantly sending
events to the AD2000 Series device event queue and possibly causing an overflow condition.
The Function Block input parameters are:
P1 = the event parcel number to be sent. The number displayed corresponds to the parcel number
on the left-hand side of the parcel properties form.

Outputs

Q is the Parcel function block enable out bit. This bit is enabled and passes power when the enable
bit is true and the parcel has been placed on the AD2000 event queue for processing.

Example Code

A typical example of the function is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 5-95


Chapter 5 - Ladder Logic Functions

Here the event parcel is triggered to send data from the source station to the destination station. In
this example it will send Digital Inputs from Station1 to Digital Outputs at Station 2 via port1,
however, any correctly configured parcel can be sent as long as it is an event type.
PARCEL Function Block using LOG Type Parcels

It is also possible to use the Parcel function block to write to data-log memory. The parcel has type
LOG and must be defined prior to the Parcel function block. Refer to the section on Text Messages
to see how they are created. Refer to the section on Event LOG Parcels to see how they are
created.
A typical example of the function using event LOG parcels is shown in the following diagram:

Here the parcel is a text message triggered on the OFF to ON transition of Digital Input 9 which will
log to the data-log memory the time and date of the event with the text Alarm.
Another typical example of the function using event LOG parcels is shown in the following diagram:

Here the parcel is a text message with an embedded variable value (in this case a floating point
number at address %ML25175) triggered on the OFF to ON transition of Digital Input 11 which will
log to the data-log memory the time and date of the event with the text Alarm.

The PLC System real time clock coils can be used to data-log event LOG parcels at exact time
periods (e.g. every minute, hour, day etc.)

© 2007 Miri Technologies All rights reserved. V3.00 5-96


Chapter 5 - Ladder Logic Functions

PARCEL Function Block using SMS Type Parcels

It is also possible to use the Parcel function block to send SMS messages to SMS enabled
devices. The parcel has type SMS and must be defined prior to the Parcel function block. One port
must have a GSM enabled interface. Refer to the section on Text Messages to see how they are
created. Refer to the section on Event SMS Parcels to see how they are created.
Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Parcel - PARCEL.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

RTC Time
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The RTC Time function performs a real time clock update from within the Ladder Logic. RTC is
short for Real Time Clock. The variable values specified via the RTC Time function block for H, M
and S can be written from and external source such as an HMI package to enable the RTC to be
synchronised to a common clock. The data passed to the variables would have to conform to the
correct formats for each input variable as defined in the input section below.
Please note that the real time clock can also be changed via the MiriMap2000+ programming
interface for the AD2000 using the Set Clock button on the station Properties form Compile tab.
This option allows all units on the same network e.g. a radio network to have all the RTCs
synchronised from the one master clock. This option should be used only if the real time clock is to
be updated manually or occasionally.

© 2007 Miri Technologies All rights reserved. V3.00 5-97


Chapter 5 - Ladder Logic Functions

Inputs

EN is the RTC Time enable bit. A true condition of this bit triggers function to move the values in
the variable memory defined by H, M and S to the AD2000 real time clock chip and to update that
clock with the new settings. The value of EN is determined by the Boolean evaluation of elements
placed between the left power rail and EN in the function block. If you do not place any contacts on
the rung before EN, the value of EN is always true. It is important to note that a positive or negative
transition variable is advisable.
The variables H, M and S are all 16 bit unsigned word types.
H sets the current Real Time Clock (RTC) hour word. The displayed format is 0 to 23 hours.
The Diagnostic word [Time_Hour] %MW65266 will display the current RTC hour value.
M sets the current Real Time Clock (RTC) minutes word. The displayed format is 0 to 59 minutes.
The Diagnostic word [Time_Minute] %MW65265 will display the current RTC minute value.
S sets the current Real Time Clock (RTC) seconds word. The displayed format is 0 to 59 seconds.
The Diagnostic word [Time_Second] %MW65264 will display the current RTC second value.

Outputs

Q is the RTC Time output bit. This bit is enabled and passes power when the RTC Time function
block operates. It is not necessary to assign a variable to this output. A No Operation NOP coil is
suitable.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Real Time Clock Time - RTC Time.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-98


Chapter 5 - Ladder Logic Functions

RTC Date
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The RTC Date function performs a real time clock update from within the Ladder Logic. RTC is
short for Real Time Clock. The variable values specified via the RTC Date function block for D, M,
W and Y can be written from and external source such as an HMI package to enable the RTC to be
synchronised to a common clock. The data passed to the variables would have to conform to the
correct formats for each input variable as defined in the input section below.
Please note that the real time clock can also be changed via the MiriMap2000+ programming
interface for the AD2000 Series device using the Set Clock button on the station Properties form
Compile tab. This option allows all units on the same network e.g. a radio network, to have all the
RTCs synchronised from the one master clock. This option should be used only if the real time
clock is to be updated manually or occasionally.

Inputs

EN is the RTC Date enable bit. A true condition of this bit triggers function to move the values in
the variable memory defined by D, M, W and Y to the AD2000 real time clock chip and to update
that clock with the new settings. The value of EN is determined by the Boolean evaluation of
elements placed between the left power rail and EN in the function block. If you do not place any
contacts on the rung before EN, the value of EN is always true. It is important to note that a positive
or negative transition variable is advisable.
The variables D, M, W and Y are all 16 bit unsigned word types.
D sets the current Real Time Clock (RTC) date word. The displayed format is 1 to 31.
The Diagnostic word [Time_Date] %MW65267 will display the current RTC date of the month
value.
M sets the current Real Time Clock (RTC) month word. The displayed format uses the Roman
calendar 1 to 12, where 1 is January, 2 is February, 3 is March, 4 is April, 5 is May, 6 is June, 7 is
July, 8 is August, 9 is September, 10 is October, 11 is November and 12 is December.
The Diagnostic word [Time_Month] %MW65268 will display the current RTC date of the month
value.
W sets the current Real Time Clock (RTC) day of the week word. 1 = Monday, 2 = Tuesday, 3 =
Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, 7 = Sunday.
The Diagnostic word [Time_Day] %MW65269 will display the current RTC day of the week value.

© 2007 Miri Technologies All rights reserved. V3.00 5-99


Chapter 5 - Ladder Logic Functions

Y sets the current Real Time Clock (RTC) year word. 00 = 2000, to 2099. Once 99 is reached the
number wraps back to zero. This will repeat every 100 years.
The Diagnostic word [Time_Year] %MW65270 will display the current RTC year value.

Outputs

Q is the RTC Date output bit. This bit is enabled and passes power when the RTC Time function
block operates. It is not necessary to assign a variable to this output. A No Operation NOP coil is
suitable.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Real Time Clock Date - RTC Date.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-100


Chapter 5 - Ladder Logic Functions

Rate Calculation (RATE)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The RATE calculation function block provides the calculation of rate values for pulsed digital inputs
(DIN1–16). The RATE calculation function block is a special type of counter which accumulates the
number of pulses counted on the CU input. Every time period specified by PT, the rate is calculated
by multiplying the number of pulses counted in the last elapsed time period PT by the number of
units specified by the value entered at PV. This function is for normal inputs DIN1–16 on the
AD2000 unit not high-speed inputs. These will suit maximum pulse frequency rates of 5Hz (5
pulses per second). When the hardware is configured for high-speed inputs the High Speed Rate1
& 2 function blocks must be used. The High Speed Rate1 is available for the AD2000 units and
High Speed Rate1 and High Speed Rate2 for the MiriAD2002. These access the high speed
interrupt driven inputs DIN1 and DIN2 (DIN2 is available only as a high-speed input on the
MiriAD2002).

Inputs

CU is the Rate counter enable bit. As long as the reset bit is false, each false to true transition of
this bit increments the current value until the current value equals the preset value. The value of
CU is determined by the Boolean evaluation of elements placed between the left power rail and CU
in the function block. If you do not place any contacts on the rung before CU, the value of CU is
always true and will increment every scan acting like a timer (and the rate counter will not operate
correctly). The RATE calculation function block must have a positive or negative transition bit in this
rung to function correctly.
R is the Rate counter reset bit. When this bit is true, the current value is set to zero and the output
bit is disabled. The value of R is determined by the Boolean evaluation of elements placed between
the left power rail and R. A connection must be made to R.
PT is the Period Time value over which the rate is to be calculated. This must be expressed in
seconds.
PV is the RATE preset value. This is the number of units that each pulse counted on CU
represents, e.g. 1, 10, 100, 1000 etc. Typical examples for the use of the rate function block are
where a flow meter provides a pulse per litre of fluid. If each pulse represents 100 litres of fluid then
the PV entered would be 100.

© 2007 Miri Technologies All rights reserved. V3.00 5-101


Chapter 5 - Ladder Logic Functions

You can assign this input variable a value or point it to a currently assigned variable in the "Assign
Function Block Inputs/Outputs" dialogue box. The range of values this variable can assume are
unsigned INT (WORD) or DINT (LONG) which are from 1 to 65,535 (FFFFh) for INT (WORD) type
variables and 1 to 4,294,967,294 (FFFFFFFFh -1) for DINT (LONG) type variables.

Outputs

Q is the RATE output bit. This bit is enabled and passes power each time the PT time period has
elapsed. It is not necessary to assign an output variable to this. A No Operation NOP coil is
suitable.
CV is the RATE counter current value. You must assign this output variable to any assigned
variable memory via a nickname or memory address in the "Assign Function Block Inputs/Outputs"
dialogue box. The value of this variable increments by one every time a false to true transition of
the counter up enable bit occurs until the current value equals the preset value. The current value
retains its value until the reset bit is true. This variable must be assigned to DINT (LONG) type
variables which range in value from 1 to 4,294,967,295 (FFFFFFFFh).
RV is the RATE current value. It is the result of the number of pulses counted in the last time period
PT multiplied by the PV RATE preset value. You must assign this output variable to any assigned
variable memory via a nickname or memory address in the "Assign Function Block Inputs/Outputs"
dialogue box. The value of this variable increments by one every time a false to true transition of
the counter up enable bit occurs until the current value equals the preset value. The current value
retains its value until the reset bit is true. This variable must be assigned to 32 bit DINT (LONG)
type variables which range in value from 1 to 4,294,967,295 (FFFFFFFFh).

Example Code

A typical example of the function is shown in the following diagram:

Outputs CV and RV must be assigned to 32 bit DINT (LONG) type variables.


Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Rate - RATE.mml.
On Import select option 3 “Merge with import variables taking precedence”.

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

© 2007 Miri Technologies All rights reserved. V3.00 5-102


Chapter 5 - Ladder Logic Functions

Scale
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Scale function can be used to scale data from an analogue channel and bring it into the limits
prescribed by another variable that is used in the Ladder Logic, the Data-log interface, external
PLC or for viewing at an HMI. Often the scaled value viewed in the Watcher, which is available only
for viewing in the Watcher interface, is required as a scaled variable for monitoring purposes. This
can be done using the individual maths functions. However the SCALE function block provides a
quick and convenient alternative. For example, use SCALE to convert a 4-20 mA analogue input
signal from the AD2000 unit to a PID process variable used in a connected PLC or to calibrate an
external instrument without requiring further adjustments to be made to HMI package databases.
Or use SCALE to scale an analogue input to control an analogue output.
The SCALE uses a linear relationship and the equations used in calculating a linear relationship
are:
‰ Scaled value = (input value x rate) + offset
‰ Multiplier = (scaled maximum - scaled minimum)/(raw input maximum - raw input minimum)
‰ Offset = scaled minimum - (input minimum x rate)
For example the Multiplier, M for a 12 bit analogue (select the 12 bit Analogue Inputs check box on
the variable Element Browser dialogue box) from an AD2000 Series device, the raw input
maximum would be 4095 and the raw input minimum would be 0. Scaling this to a percentage, the
scaled maximum would be 100 and the scaled minimum would be 0. The multiplier would then be:
M = 100-0/4095-0 = 0.02442
(Use the multiplier M = 100-0/65520-0 = 0.00152 when using analogues expressed as 16 bit words
0 - 65520).

Inputs

EN is the SCALE enable bit. A true condition of this bit causes the variable V to be scaled
according to a linear relationship defined by the input parameters.
The Function Block input parameters are:
V = the variable to be scaled, M = the Multiplier, A = the addition or offset factor.

© 2007 Miri Technologies All rights reserved. V3.00 5-103


Chapter 5 - Ladder Logic Functions

Outputs

Q is the SCALE enable out bit. This bit is enabled and passes power when the enable bit is true as
long as the value of R is non-zero and does not go out of range.
R is the result of the scale. R contains the scaled value, as long as the enable bit is true. If the
result R is required as a Real variable, the variable V to be scaled must also be a Real. The
Convert function block can be used to perform the conversion and the example code below
illustrates this.
The variable type and ranges used in this function block are shown in the section on number
formats.
The variables are normally treated as signed variables. When the REAL or the UNSIGNED check
box is checked (only one can be checked at a time as they are exclusive variable properties) the
input variable and output variable must be of the same format. Thus, if the output from the variable
is to be expressed in a REAL format, the input to the function block must also be input to the
function block as a REAL. Similarly if the input to the function block is expressed in a REAL format,
the output from the function block will also be expressed in a REAL format. The CONVERT TO
function block can be used to perform the conversion to other number formats in either case. The
user must be sure of the variable format entered to a function block to ensure accurate function
block operation and results.

Example Code

A typical example of the function is shown in the following diagram:

Here the raw analogue channel is scaled as a 12 bit value between 0-100, i.e.
M = 100-0/4095-0 = 0.02442
The variables are left as integers and thus will only display as integer (no decimal place) and thus
be lees accurate as converting to floating point first and then scaling.

In the second example the raw analogue channel is the voltage input channel on the AD2000
Series device, channel 8, scaled as a 12 bit value between 10V and 50V, i.e.
Thus the M scale factor is (50-10)/4095=0.09768 and there is an offset of 10 assigned to A.
The use of floating point conversion first allows for six decimal point accuracy.
Use the Import Ladder file from disk to quickly add these example rungs to your logic. The files
stored in the Examples folder under MiriMap2000+ installation, filenames:
Example Ladder - Scale Integer - SCALE.mml
Example Ladder - Scale with Convert to Float - SCALE
On Import select option 3 “Merge with import variables taking precedence”.

© 2007 Miri Technologies All rights reserved. V3.00 5-104


Chapter 5 - Ladder Logic Functions

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Shaft Encoder Interface (SHAFT)


The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The SHAFT function block is designed for specific use with a Unidata 6509B Water Level
Instrument Shaft Encoder for accurate water level measurement.
The AD2000 unit hardware must also be configured correctly to operate with the SHAFT function
block. The following section is an extract from the AD2000 Installation and Wiring Manual.
An SEI-100 shaft encoder interface must also be installed between the AD2000 Digital Input/Output
terminals and the Unidata 6509B Water Level Instrument. The SEI-100 shaft encoder interface
provides the means to interface a Unidata 6509B Water Level Instrument to the AD2000 telemetry
module. The shaft encoder interface provides a regulated 6 Volt DC supply to the instrument from
the 12 Volt DC supply to the AD2000 unit. It also utilises two digital outputs from the AD2000 unit
which should be configured as common ground transistors, and one digital input to the AD2000 unit
which is used in normal input mode (not fast pulse mode). In this scenario the DIN common is
wired to 0 volts. The SHAFT function block may be configured to use any combination of I/O for the
shaft encoder interface.
The wiring diagram below shows the wiring arrangement using Digital Outputs 1& 2 and Digital
Input 1.

© 2007 Miri Technologies All rights reserved. V3.00 5-105


Chapter 5 - Ladder Logic Functions

Outputs 1 and 2 MUST configured as common grounded transistors.

Inputs

CU is the SHAFT enable bit.


D is the SHAFT data pulse input received from the SEI-100 shaft encoder interface (typically Digital
Input 1).

Outputs

Q is the SHAFT enable out bit. This bit is enabled and passes power when the CU enable bit is
true and the SHAFT function block has read a valid data pulse stream.
P is the power reset bit. The hardware MUST configured as a common grounded transistor.
C is the clock pulse. The hardware MUST configured as a common grounded transistor.
CV is the shaft encoder current value, the actual level reading as displayed on the shaft encoder
LCD display.

Example Code

A typical example of the function is shown in the following diagram:

Use the Import Ladder file from disk to quickly add this example rung to your logic. The file is
stored in the Examples folder under MiriMap2000+ installation, filename:
Example Ladder - Shaft Encoder - SHAFT.mml.
On Import select option 3 “Merge with import variables taking precedence”.

© 2007 Miri Technologies All rights reserved. V3.00 5-106


Chapter 5 - Ladder Logic Functions

The variable allocations for these imported rungs are assigned in the memory area
%MW50000 and above. If the project has variables assigned in this area already, choose
option 1 “Leave Current Variables” and after importing, allocate the empty rungs to
assigned variable to suit.

Sub-Routine
The Function Block symbol is shown below:

The Assign Function Block Input/Output dialogue box is shown below:

The Sub-Routine JSR Function Block is used to call Ladder logic written on different pages within
the station. These different pages can be based on logical function, readability or other reasons.
Each sub-routine is displayed in a separate Ladder logic screen and each must be called by a Sub-
Routine JSR Function Block in the Ladder main screen. The Assign Function Block Input/Output
can be used to refer to an existing page or create a new page.

Example Code

The following diagram illustrates the use of the function block.

© 2007 Miri Technologies All rights reserved. V3.00 5-107


Chapter 5 - Ladder Logic Functions

Printing Ladder Logics


The PLC data can be printed as part of the Print Reports utility. See the section on Printing
Reports for further details.

Ladder Logic Cross-Reference List


Refer to the section on Ladder cross-reference for further details
This facility allows a cross-reference between memory variable nicknames, memory locations,
rungs, addresses and ladder elements.
The various columns in the ladder cross-reference list can be sorted as alpha numeric ascending
or descending by selecting the desired column with the mouse. The sort type is indicated in the top
right-hand corner of each column by an up ↑ or down ↓ arrow.

© 2007 Miri Technologies All rights reserved. V3.00 5-108


Chapter 6 - Data-logging Functions

Chapter 6 - Data-logging Functions


The following section describes the user interface available within MiriMap2000+ to configure the
data-logging capabilities of the AD2000 Series devices.

The Data Logger functions of the AD2000 products


Internal Flash RAM memory is installed in each AD2000 Series unit. This allows the local time-
stamp recording (data-logging) of memory variables over time. This will allow the later retrieval of
time stamped data for analysis. A separate user interface is provided in the MiriMap2000+ software
package to assist in the set up of such data-logging. Each recorded event written to the data-log
memory will have a time and date stamp associated with that record. In the majority of cases the
variables that are to be logged would be the Analogue Input channels 1-8. However any internally
declared variable in the station or any text messages with embedded variables can be logged.
The data-logging must be configured per station in the map as described in the following chapters.
The data-logging can also be enabled via the Ladder Logic interface using the Log Function Block
and the Parcel Function Block.

The difference between “data-log” and “real-time” variables


The term “variable” is used throughout this manual to refer to the memory item stored in Random
Access Memory (RAM) in the AD2000 Series device. This memory location will represent the
current value associated with either a physical input or output (analogue or digital) connected to the
hardware. It can also represent an internal logic parameter used in internal calculations (e.g. a
timer, counter, an internal diagnostics value or any function block result). The value is changing
constantly based on the current state of the parameter, hence the term “variable”.
This “variable” can be read in “real-time” via a watcher chart or via an HMI/DCS/SCADA software
package link etc. These will read the current value and store it in its own database at the instant the
value is received and processed by the HMI/DCS/SCADA software package. Any time stamping of
the value for trending is added by the external software package at the time it received the data
across the communications link. In other words there is a delay imposed on the actual time that
variable is read at the AD2000 Series device memory and the time the HMI/DCS/SCADA software
package reads it. If the link is fast then this delay is in the order of milliseconds and is considered to
be acceptable (and quite normal). If the delay is long then consideration on the effect on the data
read must be taken. In many SCADA systems the link is remote (several kilometers away) and via
narrow bandwidth communications links or links that are only periodic. Thus the time between
reading the variable at the remote site and displaying it on the HMI/DCS/SCADA software
computer could be minutes. This is illustrated in the following diagram:

Figure 53 - Real-time data collection example

© 2007 Miri Technologies All rights reserved. V3.00 6-1


Chapter 6 - Data-logging Functions

In many systems it is not critical to know exactly when an event happened or at what the current
value is now. It is more important to know what happened over a period of time. Take a water tank
supplying a township. The local control system will ensure levels are maintained (controlling supply
pumps to pump the water to the tank). The system is remote and not monitored 24 hours a day.
However, the operating utility may wish to know the peak demand times to be able to fine tune the
pumping times and maybe take advantage of low tariff electricity to pump at off peak times. Ideally
they would wish to know the tank levels every minute for a 24 hour period and see that for every
week. To install the communications links to get that data update may be too costly. However, to
install a remote modem link (dialup, GSM or GPRS) can be affordable and easy to implement.
Using the data-log functions in the AD2000 Series devices, the tank levels can be logged every
minute (along with other parameters such as alarms and power consumption, in-flow, out-flow, total
flow etc.). They have the exact value at the time of logging along with a time stamp of
day/month/year and hour:minute:second against it. Thus it is the AD2000 Series device that
applies the time stamp to each the data value. That record is stored and cannot be erased, even if
the power on the AD2000 Series device is turned off. The next record of the same parameter is
then stored in a separate memory location on the data-log memory and will have a different time-
stamp. By reading these records periodically (e.g. once a day, every hour, all user configurable in
the MiriMap2000+ software) they can then be exported to the likes of Excel (there is an export to
Excel and .CSV file facility in the MiriMap2000+ software) for analysis. This is illustrated in the
following diagram:

Figure 54 - External time stamp data collection example


Data-logging does not only have to be via a regular periodic sample, it can also be based on some
condition or event change. For example, perhaps an alarm is required each time the tank level
crosses a limit (high or low). This can be configured and can be studied later on the same data-log
read. Several parameters can be logged at the same time and to the same AD2000 Series device
and all read back in the one read.
More sophisticated analysis can be achieved by using an HMI/DCS/SCADA software package that
will use this remote time stamp from the AD2000 Series device. This requires the
HMI/DCS/SCADA software package to support the protocol commands required to process the
data-log reads. Such packages exist, contact Miri Technologies technical support.
There are 3 methods available within MiriMap2000+ to read the data-log data from an AD2000
Series device:
‰ The manual data-logger interface
‰ The internal scheduler
‰ The external ADScheduler schedule utility.

© 2007 Miri Technologies All rights reserved. V3.00 6-2


Chapter 6 - Data-logging Functions

Please note that the internal and external schedulers both use the same schedule settings and
these are stored in the same MiriMap2000+ .mmf configuration file.

Setting up the Data Logger Interface


The data-logger interface can be started from the toolbar icon as shown . The data-logger
interface will also open via the keystroke Ctrl+G or by selecting a station and pressing the right
mouse button and selecting the menu option Data Logging. The interface form is shown in the
following diagram:

The following steps allow a channel to be configured for data-logging.

Add Channel

Select the Add Channel button to display a blank Channel form as shown in the following diagram.

Channel

Select a channel from the Channel drop down box. In this example Analogue Input 1 is chosen. If
the variable details (such as scaling, description etc.) have been modified from the default values
these will be displayed as read-only parameters in the Scaling section on the bottom of the form. In
this example it has been scaled to a percentage with 2 decimal point resolution. To alter the
variable parameters, return to the map window and select the General properties tab and select
the Variables button and edit the parameters for the Variable via the Modify button. The
completed form is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 6-3


Chapter 6 - Data-logging Functions

The two check boxes for Real and Unsigned must be checked if you wish the variable to be treated
as a real or an unsigned number.
The Bit box allows digital bits within words to be used as status logs, enter 1–16 as the bit where 1
is DIN1, 2 is DIN2 and so on to 16 is DIN16.
Schedule

Select the Modify button to adjust the Schedule to allow the variable to be logged under different
conditions.

‰ Fixed Time Log


Selecting this will log the variable regularly every time period as chosen via the drop down boxes.
Valid time periods are seconds, minutes, hours and days.
‰ Event Triggered Log
Selecting this will log the variable regularly every time period as chosen via the drop down boxes.
Valid time periods are seconds, minutes, hours and days.
In addition to the regular log, a scan time period in seconds can also be set to run regularly to
sample the variable at that time period to measure the value against the last logged value for the
variable. If that sampled value is greater than the deviation specified in the deviation box, the value
is logged. The deviation is expressed in raw units. This ensures that any sudden rapid changes in
the channel being measured is logged.
Sensor Control

Some external devices that can be connected to the AD2000 unit I/O interface may be in a low
power “sleep” mode. Prior to taking a measurement and logging the data, the power needs to be
re-connected or “sleep” mode disabled. The sensor control parameters allow an output (as defined
in the Output control option) to be turned on for a short time (as defined in the Delay Time option).
The Output Bit option determines which digital output is used, where bit 1 is DOT1, bit 2 DOT2, bit3
DOT3 and so on to the maximum number of physical outputs available on the AD2000 unit. This
option can be used only in a periodic “Log Every X Secs” schedule.

The set up above would provide a delay time before sampling of 30 seconds on digital output 1.

© 2007 Miri Technologies All rights reserved. V3.00 6-4


Chapter 6 - Data-logging Functions

The sequence of operation is:


‰ The periodic logging period elapses.

‰ The Output bit defined for the Output Control option chosen will come on.

‰ After the Delay Time the sample will be taken and logged to Flash memory.

‰ The Output control bit will turn off.

‰ The process repeats after the periodic time has elapsed again.

Scaling

The variable scaling is displayed in this section. The scaling parameters cannot be changed - they
are view only. To edit the variable scaling parameters, return to the map window and select the
General properties tab and then the Variables button and proceed from there. See the section on
Modify variable for further details.

Delete Channel

To delete a configured channel, first select the required channel from the Channel tab of the data-
log form and press the Delete button or select ALT+L keystroke. The following screen illustrates
this:

Edit Channel

To edit a configured channel, first select the required channel from the Channel tab of the data-log
form and press the Edit button or select ALT+E keystroke.

Displaying the data-log data


There are several tabs on the Data Logger screen that can be chosen to filter the various types of
data logged data for ease of display. These are:
‰ Scaled Data - Displays the logged records assigned to variable memory for the selected
channel only. These include the records assigned to data logging using the Datalog Add
Channel utility or the Ladder Logic Log Function Block where the input is assigned to a
variable ID (e.g. Analogue Input 1).
‰ String Data - Displays all the logged records assigned to type text message. These include
the records assigned to data logging using the Parcel Function Block where the parcel is
assigned to a Log type parcel.
‰ SMS Data - Displays all the logged records assigned to type SMS message. These include
the records assigned to data logging using the Parcel Function Block where the parcel is
assigned to a SMS type parcel.

© 2007 Miri Technologies All rights reserved. V3.00 6-5


Chapter 6 - Data-logging Functions

‰ Constant Data - Displays all the logged records assigned to constants. These include the
records assigned to data logging using the Ladder Logic Log Function Block where the input
is assigned to a constant.
‰ All Data log Data - Displays all type of logged data on one page for all channels.
This data is in a disk file on the PC running the MiriMap2000+ package. This file contains the last
upload data records. To ensure that the most recent data-log records are stored on disk, complete
a Read function before displaying any data.
An example of the data displayed is shown below:

Read

The data that has been stored in the AD2000 Series device Flash RAM memory can be read via
the Read button. This process can be started by selecting the Read button or by selecting the
ALT+R keystroke. The AD2000 Series device must have a valid and working communications path
to the unit that is selected in the map for the data to be read via this button. See the section on
communications setup and the Comms Port Wizard option for further details.
All the data that is read is stored to disk on the connected computer in a sub-folder with the same
name as the MiriMap2000+ project filename with different data log files created per station. For
example, if the project is named Data-log and the AD2000 Series device that the data is being read
from is called Station1 (and it is in the default folder \Program Files\MiriMap2000+Ver3), the data-
log data will be called folder \Program Files\MiriMap2000+Ver3\Projects\Data-log\Data-log-
Station1.log). This file is a compressed binary file so cannot be read directly. The Export function
should be used to transfer the data in a format that is easily read (e.g. CSV or Excel spreadsheet
format). As the log file gets bigger, archive files are produced to ensure the files remain at a
manageable size. The Project option Auto-Archive data log data can be used to adjust this.
After selecting the Read button, the menu choice shown below will be displayed:

There are several options available to gather the data as described in the sections below. In each
case pressing the Go button will commence the read communications process to read the data-log
data variables. Please note that ALL logged data is read for ALL configured channels. For large
amounts of data this can take some time, so please be patient. A progress bar on the lower area of
the form will display the estimated percentage of completed data.
Read All

This will read and save to disk all data-log records from the entire Flash RAM chip.

© 2007 Miri Technologies All rights reserved. V3.00 6-6


Chapter 6 - Data-logging Functions

Read All Since Last

This will read and save to disk only data that has been read since the last time data was saved to
disk.
Read Last

This will read and save to disk only data in Flash RAM for a certain number of days.

Clear Flash

The Clear Flash function will delete all records from the connected AD2000 Series device. To
choose this function, press the Clear Flash button or select the ALT+F keystroke.

This will delete all data-log records stored in Flash RAM and once deleted these cannot
be restored. Ensure that any important data is read from the unit first before performing this
function.

Export

The data that has been read from each AD2000 Series device is stored on disk on the connected
PC. This data is in a compressed format to minimise disk space. The data-logged variable can be
exported to more common file formats to facilitate data diagnosis and manipulation. To select the
Export utility, press the Export button or select the ALT+X keystroke. The screen below is
displayed:

For each variable, several data log parameters can be exported. By default all parameters are
exported and in the order shown below. To allow maximum flexibility to export the data to other
packages, the choice of parameter and the order in which they are exported can be adjusted using
the arrow selection buttons. To adjust, select the required parameter, press the left button to
remove it from export, the right button to add it, the up button to raise the order and the down
button to lower the order of export. The highest order variable will be the first column entry
exported with subsequent variables in the list following in sequence.
Date

Selecting this option box includes the date in the exported file.
Time

Selecting this option box includes the time in the exported file.
Raw data

Selecting this option box includes the variable raw data in the exported file.
Scaled Data

Selecting this option box includes the variable scaled data in the exported file.

© 2007 Miri Technologies All rights reserved. V3.00 6-7


Chapter 6 - Data-logging Functions

Variable Description

Selecting this option box includes the variable description as defined in the variable definition in the
exported file.
Variable Name

Selecting this option box includes the variable name as defined in the variable definition in the
exported file.
Variable Nickname

Selecting this option box includes the shortened variable name, the variable nickname, as defined
in the variable definition in the exported file.
CSV - Comma Separated Variable

This common flat file format will export the variables into a CSV file, with a comma between each
variable detail item and a carriage return after each whole record. The file is stored in the Projects
folder and an option to name the file is given prior to the export process.
Excel

The Microsoft© Excel file format is commonly used for data diagnosis and thus a direct Excel file
format export is available.
Excel must be installed on the computer for this function to work. If it is not, use the CSV format.
The Excel Export function has several options as shown below:

All Data

Selecting this option box includes all the exported data the one Excel sheet.
Page Per Week

Selecting this option box includes all the exported data divided into one Excel sheet per week.
Page Per Day

Selecting this option box includes all the exported data divided into one Excel sheet per day.
Page Per Hour

Selecting this option box includes all the exported data divided into one Excel sheet per hour.
The file is stored in the Projects folder and an option to name the file is given prior to the export
process.

© 2007 Miri Technologies All rights reserved. V3.00 6-8


Chapter 6 - Data-logging Functions

Export All

This option will export all data form the currently saved data-log files. All channels are exported
and the data is saved in CSV file format sorted by date and time. This facility is given as a quick
export utility to allow further data analysis by other means. For more specific exporting of data use
the Export button.

Scheduler

MiriMap2000+ has an in-built and external data-log “read” (i.e. data retrieval) scheduler to allow the
automatic, scheduled data-log upload from remote AD2000 Series devices. The in-built scheduler
requires the MiriMap2000+ software package to be running and connected to a AD2000 Series
device with a spare RS232 port configured for No Poll, Miri2000, 38.4 k Baud or an Ethernet port
configured for the Miri2000 protocol which has full access to the desired network. The external
scheduler is available as a separate application called ADScheduler. It can be downloaded for free
from www.miri.com.au/support.htm and installed on the same PC as the MiriMap2000+ application.
It reads the same schedule set in the MiriMap2000+ project configuration file (the .mmf file) and
uses the same communications setting and thus this must be created and tested first.
The data-log scheduler can be used to periodically access the network and read (sometimes
referred to as “uploading”) the last data-logged records from each remote unit. There is also a
facility to run scheduled events that can be used to run batch files on the PC on which
MiriMap2000+ is running (for example, to copy or archive the data-log files and compress the files
using external compression software). It is even possible to email files automatically from a
scheduled event/batch file (via any of the external tools available from Microsoft© for use with
Windows NT Schedule service or DOS batch files).
The uploaded data can be saved as CSV (comma separated variable) file format directly from the
scheduler. These files will be appended to until the files size has 65000 rows then a new file with
the appended descriptor _XXX will be added allowing 1 to 999 files to be stored. This allows each
file to be read by Microsoft© Excel which has a maximum row limit of 65535. The CSV files
available can be viewed and read via the Scheduler Log File List button. A log file of Scheduler
events is also available from this button.
To illustrate the data-log upload scheduler an example system is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 6-9


Chapter 6 - Data-logging Functions

The base station has access to the network and is configured for slave mode operation (e.g. HMI
package) using Modbus on the RS232 port. The Ethernet port is available for permanent
connection, as shown below:

Configuring the Scheduler

The remotes have data log data that should be retrieved periodically (in this example once a day).
The scheduler can be set up to do this automatically. To access the scheduler select the Main
menu item Edit - Scheduler to display the blank upload scheduler form as illustrated in the following
diagram:

© 2007 Miri Technologies All rights reserved. V3.00 6-10


Chapter 6 - Data-logging Functions

To add a station to the scheduler, select the Add button.


To edit an existing station, select the desired station and select the Edit button.
To delete a station from the scheduler, select the desired station and select the Delete button.
To copy an existing station schedule to other stations (so as to replicate the same settings), select
the desired station and select the Apply Others button.
To close the scheduler, select the Close button. Please note that on closing the scheduler edit
form at any time will automatically enable it so ensure that all communications links are connected
and operating.
An example scheduler set up for several stations is illustrated in the diagram below:

The station order for each column can be sorted as alpha numeric ascending or descending by
selecting the desired column with the mouse. The sort type is indicated in the top right-hand corner
of each column by an up (alpha numeric ascending) or down (alpha numeric descending) arrow.
The schedule details for each are the same in this example and thus the scheduler will start from
the first station, attempt to upload the data for the first station and work through the list until
complete.
The scheduler entries are illustrated in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 6-11


Chapter 6 - Data-logging Functions

The Station field allows every station in the map to be set up from the one form. There is also a
Scheduled Task entry that can be entered which instead of calling a upload schedule event can be
used to call a batch file as defined in the field Batch File (or other executable program) at a
particular period defined by the Schedule every field.
The schedule period can be set up via the Schedule every fields for any period based on the 24
hour clock. Select the required days, hours and minutes in the option fields. For example the
schedule could be set up to perform an upload every day at 23.00 hours. To perform an upload
every week at 23.00 hours the field entry would be as follows:

To synchronise this to a set start time each day, check the Start from Set Time check box and set
the desired time.
The Retries field allows the number of retries to be configured to accommodate when links are not
operational. If no data reply is received after this number of retries the scheduler proceeds with the
next scheduled task.
If the Export data to CSV field check box is checked, the data will be exported as a CSV (comma
separated variable) file format directly from the scheduler. The files are exported into a sub-folder
with the same name as the MiriMap2000+ .mmf file. For, example, if the MiriMap2000+ file is called
Demo.mmf and the MiriMap2000+ software application has been installed in the default location,
the CSV files will be located in: C:\Program Files\Miri Map2000+\Projects\Demo.

A fixed storage folder can be specified for the files to be exported and stored in. This is defined
in the Project Properties form. This is useful if the Save As function is used to save the project file
as a different name but where the log files need to be stored in the same folder as used under the
previous filename.
Once each CSV file reaches 65000 records long the, a new file with the same name is opened with
the last 4 characters following the naming convention _001 up to _999. Once 999 files are created
the numbering process re-starts at _001. External archiving should be enabled to ensure that these
files are not lost if the data is required.
The Collect options specify whether data is uploaded Since last upload (i.e. only new data or to
Upload all data-log data from the remote unit every time (be aware that this option will produce
excessive and unnecessary charges on dialup, GSM and GPRS networks and should only be used
in initial or fault finding conditions).
If the Export Since Last to CSV check box is checked, every time a scheduled data-log
connection is completed a separate CSV file will be created on every scheduled event. This file
only has new data collected at the remote AD2000, i.e. new data-log data stored since the last
connection. This is useful for other third party database utilities to read from, avoiding the need to
search through the main CSV file each time. These files are stored with the naming convention
StationName_YYMMDDHHMM.csv, with the time being the creation time of the file not the actual
connection time which could be different if the reading of the data takes some time. For example
for the schedule above there would be a new file created on every connection named
Station9_060806230105.csv.

© 2007 Miri Technologies All rights reserved. V3.00 6-12


Chapter 6 - Data-logging Functions

The remaining fields of Date, Time, Raw Data, Scaled Data, Units, Variable Description,
Variable Name, Variable Nickname are provided so that the exported data fields can be chosen.
The default is to export all fields.
Typical output from the CSV files is shown below:
Date,Time,Variable Nickname,Variable Name,Description,Raw Data,Scaled Data,Units,
02/08/06,18:55:42,[Time_Minute],%MW65265,,55,55,,
02/08/06,18:56:42,[Time_Minute],%MW65265,,56,56,,
02/08/06,18:57:42,[Time_Minute],%MW65265,,57,57,,
02/08/06,18:58:42,[Time_Minute],%MW65265,,58,58,,
02/08/06,18:59:42,[Time_Minute],%MW65265,,59,59,,
02/08/06,19:00:00,Rain_Totaliser,%ML1,,1220560000,1220560000,,
02/08/06,19:00:00,BatteryLevelScaled,%ML5,,13.291816,13,,
02/08/06,19:00:00,GPRS_CSQ_RESP_rssi,%MW5005,,25,25,,
02/08/06,19:00:00,WaterLevelScaled,%ML3,,0.014652,0,,
02/08/06,19:00:00,RainLastLogPeriod,%ML12,,0,0,,
02/08/06,19:00:43,[Time_Minute],%MW65265,,0,0,,
02/08/06,19:01:43,[Time_Minute],%MW65265,,1,1,,

This can be viewed with Excel by using the File Open option with Files of Type set to Text Files
(*.prn, *.txt, *.csv) as shown below:

The Batch File field allows any DOS batch file to be called either after the scheduled event is
completed or when a scheduled event task is specified in the Stations field. Checking the Hide
Batch File check box when running DOS based files, to prevent the screen flicker that results as
this runs. Do not check this box if this launches Windows based programs that need to be visible.
Checking the Default Comms check box will use the communications set in the Project-Com
Setup main menu Communications Properties form. If left un-checked then alternative
communications paths can be defined per station. Ensure that these paths are tested as
functioning first.
Normally leave the Stop Polling option checked as to access remote slave AD2000s on any
network normally requires the Master device polling to be stopped when the scheduler runs.
A Run Now! button is available to run the Scheduler immediately so you do not have to wait until
the next scheduled event. The last time the Scheduler application was started is also reported in
the Scheduler title bar by displaying the time and date. This is the time the Scheduler itself was
started, not the time the scheduled event was started (these are listed in the Scheduler form per
station).
Data-log Data File Storage Location

All the data that is read is stored to disk on the connected computer in a sub-folder with the same
name as the MiriMap2000+ project filename with one file created per station. For example, if the
project is named Data-log and the AD2000 unit from which the data is being read is called Station1
(and it is in the default folder \Program Files\MiriMap2000+), the data-log data will be called folder
\Program Files\MiriMap2000+\Projects\Data-log\Data-log-Station1.log). This file is a
compressed binary file so cannot be read directly.
If the Export data to CSV field check box is checked (and if the optional Export Since Last to
CSV check box is checked) the scheduler will store any CSV format files in the same folder with
the same name but using the .csv suffix.

© 2007 Miri Technologies All rights reserved. V3.00 6-13


Chapter 6 - Data-logging Functions

Stopping and Starting the Scheduler

To enable the scheduler at any time select the Upload Schedule toolbar icon and ensure it is
pressed down as illustrated below:

Scheduler Enabled
To disable the scheduler at any time select the Upload Schedule toolbar icon and ensure it is
depressed up as illustrated below:

Scheduler Disabled .
Please note that on closing the scheduler edit form at any time will automatically enable it so
ensure that all communications links are connected and operating. The user is prompted to ensure
that the normal situation is to have the scheduler running.
Data-log Communications

It is possible to use the Ethernet TCP or UDP communications setting to read data-log data from
the scheduler. The AD2000 units must have the Ethernet port setup correctly to support the
Miri2000 protocol with unique fixed IP addresses. The scheduler then has the option to use default
communications (which is the settings set in the main menu option Project - Com Setup) or the
Ethernet setting assigned to each station.
To use the Default Communications setting ensure that the Default Comms checkbox is checked at
the bottom of the Scheduler Dialog.
To use the AD2000 station comms setting uncheck the Default Comms checkbox at the bottom of
the Scheduler Dialog and select the Setup Comms button to display the Communications
Properties dialog as below:

For each station, set up the unique Ethernet communications parameters. Ensure these are unique
and match those assigned to the actual AD2000s.
Data-log Data Storage Format

Each data-log record is stored in the following manner:


The data is stored on the EPROM Flash chip in the following format:
‰ BYTE VarType [byte count =1]
‰ BYTE NumWords (number of words to be stored per log) [byte count =1]
‰ WORD VarID (e.g. &MW00001, %MW65535 etc.) [byte count =2]
‰ DWORD TimeStamp (no. of seconds since 1st January 2000) [byte count =4]
‰ WORD Data (number of words depends on NumWords field) [byte count =2]
Where WORD Data length is 2 bytes - for the actual logged variable for 16 bit variables or 4 bytes
for the actual logged variable for 32 bit variables.
Every data-log record contains the following elements, total 8 bytes regardless of whether those
elements are used (unused values are written with FF):

© 2007 Miri Technologies All rights reserved. V3.00 6-14


Chapter 6 - Data-logging Functions

(VarType + NumWords + VarID + TimeStamp)


That is:
8 x 16 bit words per 16 bit WORD data-log record,
10 x 16 bit words per 32 bit LONG data-log record,
10 x 16 bit words per 32 bit single precision FLOAT data-log record.
Thus for a physical analogue value a data-log record takes up 10 bytes.
The AD2000 unit has 4Mbit flash EPROM storage installed. This is equivalent to 512k bytes or
256k words (where 1k = 1024).
So 512 x 1024 = 524288bytes so with 10 bytes per record the maximum number of records that
would be logged before the wrap around occurs would be 52428.
The AD2006 unit has 8Mbit flash EPROM storage installed. This is equivalent to 1024k bytes
(1Mbyte) or 512k words (where 1k = 1024).
So 1024 x 1024 = 1,048,576 bytes so with 10 bytes per record the maximum number of records
that would be logged before the wrap around occurs would be 104,857.

Text strings can also be stored, which can be any length and can change the maximum
number of logs. Each character (including spaces) stored is a byte long, however all records written
are rounded to the nearest word (i.e. an even number of bytes) plus 8 bytes (VarType[1byte] +
NumWords[1byte] + VarID [2bytes1] + TimeStamp[4 bytes]).
1
Not applicable, written as FF.
Running the ADScheduler on Startup of Windows

The ADScheduler will load automatically if the user copies a shortcut from the installed folder to the
Start folder as below.
First create a shortcut, in Windows Explorer, select the AdSched.exe file in the \Program
Files\ADScheduler folder, right click the mouse.

Select Create shortcut, then select the short cut, right click, choose Copy

© 2007 Miri Technologies All rights reserved. V3.00 6-15


Chapter 6 - Data-logging Functions

The go to C:\Documents and Settings\All Users\Start Menu\Programs\Startup

And select Paste:

Once this has been done, the scheduler will start on every instance of Windows, regardless of the
user signed on.

Graph

The data-logging interface includes a charting utility to quickly view any data-log data that has been
read on screen. This should aid the evaluation of the logged data.
The charts that are produced can be printed via the Print button on each chart or saved as a JPEG
format file for later viewing or insertion into word-processing or spreadsheet documents.
The range of the data to be displayed can be edited with the Start Date and End Date drop down
boxes. These will display a calendar choice box as shown below:

© 2007 Miri Technologies All rights reserved. V3.00 6-16


Chapter 6 - Data-logging Functions

The data can be displayed as a line type diagram as below:

© 2007 Miri Technologies All rights reserved. V3.00 6-17


Chapter 6 - Data-logging Functions

Or as a 3D line diagram as shown below:

Several channels can be selected and displayed at the same time.

Delete Log
The Delete log function will delete all disk records from the PC running MiriMap2000+. To choose
this function, press the Erase button or select the ALT+D keystroke.

This will delete all disk files containing data-log records stored on the PC and once
deleted these cannot be restored. Ensure that any important data is archived first before
performing this function.
Refer to the section on data log file storage locations for further details.

© 2007 Miri Technologies All rights reserved. V3.00 6-18


Chapter 7 - Protocols

Chapter 7 - Protocols
The following section details the various protocol drivers that are available for use with the AD2000
Series Devices. This list is always being updated as new drivers become available so contact
support for the latest list or any particular requirements that you may have.
Protocol Supported Types Modes
Allen Bradley DF1 Integer Files Half-Duplex
Master & Slave
Modbus Coil Status (0xxxx), Input Status (1xxxx), Input Registers Master & Slave
(3xxxx), Holding Registers (4xxxx) range 0 - 65535

CCM 205/405/350 PLC Type - Input (X), Output (Y), Control Master & Slave
Relay (C), Data Word (V), Timer Current Value (V)
305 PLC Type - Input/Output (IO), Control Relay (CR),
Data Register (R), Timer Current Value (R)
CCM Series 3 & 6, 90-30 and 90-70 PLC type - Input,
Output, Register
TI Task Codes Control Relay (CR), Discrete Input (X), Discrete Output Master & Slave
(Y), Variable Memory (V)/Image Input (WX),
Image Output (WY)

Please note that the default communications protocol used on the AD2000 Series is Miri2000 and
this protocol supports Master and Slave, binary and ASCII formats and works with Ethernet
TCP/UDP as well as RS232 and RS485/422 (via suitable converters).

© 2007 Miri Technologies All rights reserved. V3.00 7-1


Chapter 7 - Protocols

DF1
This protocol supports the reading and writing to whole (16 bit) words Integer File types only.

Modes Supported
Master and Slave. (Half Duplex mode only). In Master mode the AD2000 Series device initiates the
commands to another slave device. In Slave mode the AD2000 Series device waits to receive
commands from another master device.

Memory Data Types Supported


The PLC memory data types supported are:
Integer File (Type N) only.
All files up to the maximum of 999. All words within files up to a maximum of 1000. These will cover
both the SLC and AB PLC5 range of PLCs. The user must ensure that they use the maximum
values set by the PLC manufacturer. For SLC500 PLCs the maximum number of type N integer
files is 256 (0 - 255) with 256 words per file (0 - 255). For AB PLC5 PLCs the maximum number of
type N integer files is 1000 (0 - 999) with 1000 words per file (0 - 999).
In Master mode the parcel sizes supported are word read/write (ALL in the Parcel Field element).
Single Bit read/writes are not supported. It is advisable to ensure that bit data is packed into words
to avoid this limitation. Multiple word read/writes can be specified by setting a NumVar value to be
greater than 1. In Master mode direct to an in-built DF1 port the maximum parcel size of 100 words
will work. Ensure that the Broadcasts per Poll setting is set to a minimum value of 20.
When a KF3 module is used, the maximum parcel size should be limited to 40 words for all data to
be transferred. For more than 40 words use multiple parcels.
In slave mode, bit read/writes are not supported and an error response will be given. Most HMI
packages perform bit writes by reading the whole word, masking the bit then writing back the result.
The danger in doing this is that in between the read and the write the bits may then change state
and the write will overwrite the new state with the previous state. This can be avoided by always
using bits packed into full words for write parcels.

Master Mode Configuration


In Master mode the AD2000 Series device needs to be set up to initiate the protocols commands to
the connected PLC. This is done through the Station Port properties dialogue box and an example
port set up is shown below:

© 2007 Miri Technologies All rights reserved. V3.00 7-2


Chapter 7 - Protocols

The actual port details are set by selecting the port required (e.g. Port5 in this example) by double
clicking the mouse or pressing the Properties button.

Port Properties

The port properties for the Master mode are:


‰ Protocol to be selected is Allen Bradley DF1.
‰ Interface to match the physical interface on the DF1 slave device. There are several options
available and these depend on the chosen AD2000 Series device port. The options available
per port are available in the selection list. These include, RS232, RS485 and Ethernet as
well as some of the radio options.
‰ Polling set to Continuous.

Comms

‰ Baud rate, Parity, Stop and data bits set to match the slave DF1 device.
The dialogue box showing these correct settings is shown:

Protocol Options

There are protocol specific settings that need to be set.


‰ PLC Sub Type - Choose SLC 500 or PLC 5 to match the PLC type connected.
‰ Comms Unit Address - This must match the DF1 port address expected by the PLC/DCS
or HMI package for PLC node address.
‰ Broadcasts per Poll - This is typically fixed at 20.
‰ Broadcast Retry Slots - This is typically fixed at 5.

Create a PLC Type Station

A PLC type station must then be created in the map. Refer to the section Station Properties - Other
Protocol Type devices for details on the settings required. Take special note of the comments
regarding the choice of Identifier number.
Type in a suitable Station Name then change the Type field to Allen Bradley and the Station
Properties box reduces to a property box as below:

© 2007 Miri Technologies All rights reserved. V3.00 7-3


Chapter 7 - Protocols

Ensure that the PLC Address field matches the DF1 node address of the slave DF1 device. This
must then be set on the slave device and may require additional software or hardware. Refer to the
slave device user manual.

PLC Variables

DF1 Master Memory Variables

In Master mode the AD2000 Series device will read or write DF1 memory variables across the
physical link assigned to the port which connects the two devices. The memory variable locations
in the Master device must exist prior to parcels being created. If no variables have been created at
this stage, open the Variable Element Browser for this unit and create them.
Select the Master station and select the Station Properties form. On the Station General tab
select the Variable button. Select the Create Variable button and create the Modbus memory
allocations for the data that is to be shared across the Modbus link. In the Variable Nickname
entry type N10: (to represent the fact that the allocation is Integer file N10 type memory).

Make sure the “:” is inserted, this allows the N10 to be at the beginning of every nickname
created.
Leave the Memory Types as 16 bit (only select 32 bits when assigning memory variables for 32 bit
long and floating point memory), leave the default Memory Location at 1, in the Number to
Create, type in 1000 (the block length), add a comment if required:

Press OK. This will have created a block of memory variables from %MW1 to %MW1000 labelled
as N10:00001 to N10:01000 as shown below:

© 2007 Miri Technologies All rights reserved. V3.00 7-4


Chapter 7 - Protocols

Press OK.
DF1 Slave Memory Variables

The maximum number of available Integer files in the slave DF1 device are already defined
internally to the PLC Type Station (to the maximum of 999) so no variable declarations are
required.

Although all the slave DF1 device memory points may be available within MiriMap2000+ for
allocation, they may not be available in the actual slave DF1 device or they may already be
allocated for other PLC functions. It is the responsibility of the user to ensure that data from the
connected AD2000 Series device does not overwrite existing slave Integer file device memory. In
existing slave DF1 device programs this could severely affect the operation of the connected slave
DF1 device program and could cause equipment damage or affect human safety on associated
plant.
The correct programming practices allowing efficient data transfer between the AD2000 Series
device and slave DF1 device are:
‰ Use the minimum number of N type integer files only, either the same for read write data
or one for reads and one for writes.

‰ Read and write words in contiguous blocks e.g. N10:0 to 99 for reads, N10:100 - 120 for
writes.

‰ Pack digital bits into words within the PLC logic and move them to the specified file for
telemetry use, keeping packed digital bits together e.g. all packed digital data is in N10:0
- 9.

‰ Use all PLC data in the AD2000 Series device variable definition in one array block e.g.
create a single array of variables 200 words long rather than two 100 word blocks.

‰ Use the Integer File from the start, i.e. start at 0 not 1 (or 13 or some other starting point
which is hard to remember).

The File Number must match the N type integer file defined (and created) in the connected PLC.
‰ The Element Number must match the first word in the file that is to be used, usually 0.

‰ The Number is the number of words in the file you wish to use. Ensure that for an
SLC500 this is no greater than 256 (words 0 - 255) and for a PLC5 it is no greater than
1000 (words 0 - 999).

© 2007 Miri Technologies All rights reserved. V3.00 7-5


Chapter 7 - Protocols

Create a Link and define the correct ports

It is essential to match the correct port across a physical link between any two devices in the map
file. For details refer to the section on creating a link between the two stations. Match the ports as
illustrated in the following diagram.

It is important to match the protocols on each port (define them before configuring the link to aid
this process). In the example above, the Port5 has been assigned as DF1 and should be selected.

Creating Read Parcels

To create a parcel open the Parcel Properties form. Ensure that if the parcel is from the PLC Type
station (i.e. the DF1 slave) to an AD2000 Series device, the AD2000 Series device has memory
variables defined to allow the data from the DF1 slave to be written. Parcels can be created in only
one direction at a time.
‰ Parcels that are READ from the DF1 slave by the AD2000 Series device are created AT
the PLC Type Station.
‰ Parcels that are WRITTEN to the DF1 slave from the AD2000 Series device are created
AT the AD2000 Series device.
This is despite the fact that in DF1 Master mode the AD2000 Series device is the Master in the
communications process to the DF1 slave. Building parcels this way will ensure that parcel source
and destination stations are correct.
The read parcel is defined as illustrated in the following diagram:

Select the Parcels tab and create a new parcel by selecting the New button.
This displays the Parcels Properties form as shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 7-6


Chapter 7 - Protocols

Make sure the correct Destination Station is chosen (e.g. in this example Master ID100). Select
the required PLC Variable Type and Address to match the PLC memory address from where the
data read is to start. Set the Number 16 bit Words to determine the number of words that are to
be read. Ensure that the correct Destination Port of the AD2000 Series device is chosen (e.g. in
this example, Port5). Pressing OK or Apply. Reject the parcel definition by pressing Cancel.
Pressing Apply allows further parcels to be defined without closing the Parcel Properties screen.
The maximum parcel length is 100 so multiple parcels may be required to read more than 100
words.
Once accepted the parcel tab is displayed as shown in the following diagram:

Creating Write Parcels

Data that is to be written from the AD2000 Series device to the connected Slave device is defined
by creating parcels from the AD2000 Series device.
Parcels can be created in only one direction at a time.
‰ Parcels that are READ from the DF1 slave by the AD2000 Series device are created AT
the PLC Type Station.
‰ Parcels that are WRITTEN to the DF1 slave from the AD2000 Series device are created
AT the AD2000 Series device.

© 2007 Miri Technologies All rights reserved. V3.00 7-7


Chapter 7 - Protocols

This is despite the fact that in DF1 Master mode the AD2000 Series device is the Master in the
communications process to the DF1 slave. Building parcels this way will ensure that parcel source
and destination stations are correct.
The write parcel is defined as illustrated in the following diagram:

Select the Parcels tab and create a new parcel by selecting the New button.
This displays the Parcels Properties form as shown in the following diagram:

Make sure the correct Destination Station is chosen (e.g. in this example DF1 Slave ID102).
Select the required Variable address or nickname to match the AD2000 Series device memory
address from where the data write is to start. Select the correct PLC Variable Type and set the
correct Address. Set the Number 16 bit Words to determine the number of words that are to be
written. Ensure that the correct Source Port of the AD2000 Series device is chosen (e.g. in this
example, Port5). Pressing OK or Apply. Reject the parcel definition by pressing Cancel. Pressing
Apply allows further parcels to be defined without closing the Parcel Properties screen.
The maximum parcel length is 100 so multiple parcels may be required to read more than 100
words.
Once accepted the parcel tab is displayed as shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 7-8


Chapter 7 - Protocols

Slave Mode Configuration


In Slave mode, the AD2000 Series device only needs to be set up to respond to the protocols
commands received from the connected DF1 master device (e.g. PLC, HMI, OPC server). In this
mode the Master PLC device does not appear in the MiriMap2000+ project map as an icon as
there are no parcels to be defined. The AD2000 Series device is set up to receive protocol
commands, emulate protocol memory types and have a valid address and port communications
settings. A typical system layout for this is shown in the following diagram:

Here the Master station is gathering data from the remote slave devices and making them available
to another DF1 Master device on one of the AD2006 ports. The only configuration parameters to be
set are those associated with that port.

Port Properties

The port properties for the Slave mode are:


‰ Protocol to be selected is Allen Bradley DF1.
‰ Interface to match the physical interface on the DF1 Master device. There are several
options available and these depend on the chosen AD2000 Series device port. The options
available per port are available in the selection list. These include, RS232, RS485 and
Ethernet as well as some of the radio options.
‰ Polling set to No Poll.

© 2007 Miri Technologies All rights reserved. V3.00 7-9


Chapter 7 - Protocols

Comms

‰ Baud rate, Parity, Stop and data bits set to match the Master DF1 device.
The dialogue box showing these correct settings is shown:

Protocol Options

There are protocol specific settings that need to be set.


‰ Broadcasts per Poll - This is typically fixed at 20.
‰ Broadcast Retry Slots - This is typically fixed at 5.
‰ PLC Sub Type - Choose SLC 500 or PLC 5 to match the PLC type connected.
‰ PLC Address - The DF1 address to be used by the DF1 Master to identify this port. It must
be unique on a multi-drop network.
‰ Comms Unit Address - This must match the DF1 port address expected by the PLC/DCS
or HMI package for PLC node address.
Press the PLC Variables button on the Protocol Properties box to display the DF1 PLC Allocation
table. This will list the mapping of physical memory to DF1 memory and the length attributed to the
different memory types. The only type supported is Integer and each file must be defined
individually. This is illustrated in the following diagram.

In this example, three Integer type memory files have been created, each 256 words long. These
will be addressed in the DF1 Master as N10, N11 and N12. The first Integer file starts at the
physical address %MW1 in the AD2000 Series device.

Note that the Allen Bradley memory allocations start at 0 and the AD2000 Series devices start
at 1. Care should be taken when addressing these memory offsets.

© 2007 Miri Technologies All rights reserved. V3.00 7-10


Chapter 7 - Protocols

PLC Programming Software set up


The actual PLC/HMI set up is performed on different software produced by the PLC/HMI
manufacturer/supplier. The details of the most common software package for the Allen Bradley
PLC is shown below as an aid to the user. These methods change with different versions and thus
the user may be required to match the required settings in a different way. The following screen
displays should assist in the majority of cases but are provided as a guide only.
The RSLinx set up for an SLC5/03 PLC is shown below:

The Baud, Parity and Stop bits must match the AD2000 Series device port parameters. All other
parameters on the above screen should match except the Node Address can be varied if required
to suit the user’s requirements but this value MUST match the Comms Unit Address in the PLC
Properties box for the AD2000 AB PLC.

HMI Setup
For Citect ensure that the Citect.INI (or the INI file you are using for runtime operation) parameter
setting AltInitReg matches an emulated variable assigned to the AD2000 Series device (Citect by
default looks for O0:0 on startup which does not exist in the AD2000 DF1 driver so this parameter
modifies it to one that does exist).
[KE]
AltInitReg=
e.g. if N10 is assigned as an emulated slave memory file in the AD2000, use AltInitReg=N10:0.
For DF1 with TCP, use the following parameters: Delay=50, Timeout=10000, WatchTime=30.
See the Citect Help on the KE driver parameters for further detail.

© 2007 Miri Technologies All rights reserved. V3.00 7-11


Chapter 7 - Protocols

Modbus
The Modbus protocol driver implementation for the AD2000 Series devices is based on information
published in the Modicon Modbus Protocol Reference Guide (PI-MBUS-300 Rev. D) published by
Modicon Inc. Industrial Automation Systems March 1992. Further reference is available from
www.modbus.org.
Although designed as a proprietary protocol, the Modbus protocol is the most commonly available
"third party" driver and several other manufacturer products provide a Modbus interface. As a result
it has become a defacto standard. Note that some devices use Modbus message framing only and
create their own memory types and thus cannot be considered true Modbus devices as they do not
adhere strictly to the Modbus Protocol Reference Guide.
Some devices also use memory locations beyond the maximum Modbus memory location of 9999.
An example of this is the Jbus protocol which emulates Modbus but uses the maximum theoretical
memory address of Modbus of 65535. In this version of MiriMap2000+ and the Modbus driver for
the AD2000 units, full addressing to this maximum theoretical limit has been permitted. The
Modbus offset of 1 is still used in MiriMap2000+. The user should note that often other, non-
Modbus addressing, such as Jbus, do not use the 1 offset so all such memory addressing requires
the addition of 1 to the published memory location (e.g. Jbus address FFF0h is entered as Modbus
65521).

Modes Supported
There are two modes, Master and Slave. In Master mode the AD2000 unit initiates the commands
to another slave device. In Slave mode the AD2000 unit waits to receive commands from another
master device. There are two types of Modbus framing, ASCII and RTU. RTU is the most efficient
framing mode and it is recommended for most applications. ASCII mode is available for situations
when RTU is not supported by other devices. Modbus with dialup is also supported in slave mode.

Memory Data Types Supported


There are 4 data types supported by the AD2000 Modbus driver:
Coil Status (0xxx) - binary or bit format, Read/Write
Input Status (1xxxx) - binary or bit format, Read only
Input Registers (3xxxx) - word format, Read only
Holding Registers (4xxxx) - word format, Read/Write
In Slave mode bit read/writes are not supported and an error response will be given. Most HMI
packages perform bit writes by reading the whole word, masking the bit then writing back the result.
The danger in doing this is that in between the read and the write, the bits may then change state
and the write will overwrite the new state with the previous state. This can be avoided by always
using bits packed into full words (Holding registers) for write parcels.

© 2007 Miri Technologies All rights reserved. V3.00 7-12


Chapter 7 - Protocols

Master Mode Configuration


In Master mode the AD2000 Series device needs to be set up to initiate the protocols commands to
the connected PLC. This is done through the Station Port properties dialogue box and an example
port set up is shown below:

The actual port details are set by selecting the port required (e.g. Port5 in this example) by double
clicking the mouse or pressing the Properties button.

Port Properties

The port properties for the Master mode are:


‰ Protocol to be selected is Modbus.
‰ Interface to match the physical interface on the Modbus slave device. There are several
options available and these depend on the chosen AD2000 Series device port. The options
available per port are available in the selection list. These include, RS232, RS485 and
Ethernet as well as some of the radio options.
‰ Polling set to Continuous.

Comms

‰ Baud rate, Parity, Stop and data bits set to match the slave Modbus device.
The dialogue box showing these correct settings is shown:

Protocol Options

There are protocol specific settings that need to be set.

© 2007 Miri Technologies All rights reserved. V3.00 7-13


Chapter 7 - Protocols

‰ Data Type - RTU (Binary) or ASCII.

Create a PLC Type Station

A PLC type station must then be created in the map. Refer to the section Station Properties - Other
Protocol Type devices for details on the settings required. Take special note of the comments
regarding the choice of Identifier number.
Type in a suitable Station Name then change the Type field to Modbus and the Station Properties
box reduces to a property box as below:

Ensure that the PLC Address field matches the Modbus address of the slave Modbus device. This
must then be set on the slave device and may require additional software or hardware. Refer to the
slave device user manual.

PLC Variables

Modbus Master Memory Variables

In Master mode the AD2000 Series device will read or write Modbus memory variables across the
physical link assigned to the port which connects the two devices. The memory variable locations
in the Master device must exist prior to parcels being created. If no variables have been created at
this stage, open the Variable Element Browser for this unit and create them.
Select the Master station and select the Station Properties form. The memory allocation for the
Master is performed in a similar manner by selecting the Variables button. On the Station General
tab select the Variable button. Select the Create Variable button and create the Modbus memory
allocations for the data that is to be shared across the Modbus link. In the Variable Nickname
entry type 4x (to represent the fact that the allocation is Holding register type memory), leave the
Memory Types as 16 bit (only select 32 bits when assigning memory variables for 32 bit long and
floating point memory), leave the default Memory Location at 1, in the Number to Create, type in
1000 (the block length), add a comment if required:

© 2007 Miri Technologies All rights reserved. V3.00 7-14


Chapter 7 - Protocols

Press OK. This will have created a block of memory variables from %MW1 to %MW1000 labelled
as 4x00001 to 4x01000 as shown below:

Press OK.
Modbus Slave Memory Variables

The maximum possible slave Modbus device variables that can be assigned are already defined
internally to the PLC Type Station (to the maximum of 65535) so no variable declarations are
required.

Although all the slave Modbus device memory points may be available within MiriMap2000+ for
allocation, they may not be available in the actual slave Modbus device or they may already be
allocated for other PLC functions. It is the responsibility of the user to ensure that data from the
connected AD2000 Series device does not overwrite existing slave Modbus device memory. In
existing slave Modbus device programs this could severely affect the operation of the connected
slave Modbus device program and could cause equipment damage or affect human safety on
associated plant.
The correct programming practices allowing efficient data transfer between the AD2000 Series
device and slave Modbus device are:
‰ Use the minimum number of memory types, either the same for read/write data or one
for read and one for writes. Holding Registers are the easiest to use.
‰ Read and write words in contiguous blocks e.g. 40001 to 99 for reads, 40100 - 120 for
writes.
‰ Pack digital bits into words within the Ladder Logic and move them to the specified file
for telemetry use, keeping packed digital bits together e.g. all packed digital data is in
40001 - 10.

© 2007 Miri Technologies All rights reserved. V3.00 7-15


Chapter 7 - Protocols

‰ Create all master Modbus device variable memory in the AD2000 Series device in one
array block e.g. create a single array of variables 200 words long rather than two 100
word blocks.
‰ Use the memory type from the start, i.e. start at 1 not 5 (or 13 or some starting point
which is hard to remember).
‰ The memory range must match the range available in the connected PLC.
‰ The Modbus Address must match the slave Modbus device address or identification
number, usually 1.
‰ The Number is the number of words or bits of the Modbus memory type you wish to use.
Ensure that this is no greater than the memory available in the slave Modbus device (not
all Modbus type devices support the full addressable range of Modbus memory).
‰ The name is a description and must be added. Descriptors like “HReg” or “4x” can be
used but you may wish to describe the memory use, e.g read, write, PLC Data which will
be displayed when building parcels. The actual file number will be appended to this
description. Keep this short to allow easier viewing on the parcels screens.

Create a Link and define the correct ports

It is essential to match the correct port across a physical link between any two devices in the map
file. For details refer to the section on creating a link between the two stations. Match the ports as
illustrated in the following diagram.

It is important to match the protocols on each port (define them before configuring the link to aid
this process). In the example above, the Port5 has been assigned as Modbus and should be
selected.

Creating Read Parcels

To create a parcel open the Parcel Properties form. Ensure that if the parcel is from the PLC Type
station (i.e. the Modbus slave) to an AD2000 Series device, the AD2000 Series device has memory
variables defined to allow the data from the Modbus slave to be written. Parcels can be created in
only one direction at a time.
‰ Parcels that are READ from the Modbus slave by the AD2000 Series device are created
AT the PLC Type Station.
‰ Parcels that are WRITTEN to the Modbus slave from the AD2000 Series device are
created AT the AD2000 Series device.

© 2007 Miri Technologies All rights reserved. V3.00 7-16


Chapter 7 - Protocols

This is despite the fact that in Modbus Master mode the AD2000 Series device is the Master in the
communications process to the Modbus slave. Building parcels this way will ensure that parcel
source and destination stations are correct.
The read parcel is defined as illustrated in the following diagram:

Select the Parcels tab and create a new parcel by selecting the New button.
This displays the Parcels Properties form as shown in the following diagram:

Make sure the correct Destination Station is chosen (e.g. in this example Master ID100). Select
the required PLC Variable Type and Address to match the PLC memory address from where the
data read is to start. Set the Number 16 bit Words to determine the number of words that are to
be read. Ensure that the correct Destination Port of the AD2000 Series device is chosen (e.g. in
this example, Port5). Pressing OK or Apply. Reject the parcel definition by pressing Cancel.
Pressing Apply allows further parcels to be defined without closing the Parcel Properties screen.
The maximum parcel length is 100 so multiple parcels may be required to read more than 100
words.
Once accepted the parcel tab is displayed as shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 7-17


Chapter 7 - Protocols

Creating Write Parcels

Data that is to be written from the AD2000 Series device to the connected Slave device is defined
by creating parcels from the AD2000 Series device.
Parcels can be created in only one direction at a time.
‰ Parcels that are READ from the Modbus slave by the AD2000 Series device are created
AT the PLC Type Station.
‰ Parcels that are WRITTEN to the Modbus slave from the AD2000 Series device are
created AT the AD2000 Series device.
This is despite the fact that in Modbus Master mode the AD2000 Series device is the Master in the
communications process to the Modbus slave. Building parcels this way will ensure that parcel
source and destination stations are correct.
The write parcel is defined as illustrated in the following diagram:

Select the Parcels tab and create a new parcel by selecting the New button.
This displays the Parcels Properties form as shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 7-18


Chapter 7 - Protocols

Make sure the correct Destination Station is chosen (e.g. in this example Modbus Slave ID102).
Select the required Variable address or nickname to match the AD2000 Series device memory
address from where the data write is to start. Select the correct PLC Variable Type and set the
correct Address. Set the Number 16 bit Words to determine the number of words that are to be
written. Ensure that the correct Source Port of the AD2000 Series device is chosen (e.g. in this
example, Port5). Pressing OK or Apply. Reject the parcel definition by pressing Cancel. Pressing
Apply allows further parcels to be defined without closing the Parcel Properties screen.
The maximum parcel length is 100 so multiple parcels may be required to read more than 100
words.
Once accepted the parcel tab is displayed as shown in the following diagram:

Slave Mode Configuration


In Slave mode, the AD2000 Series device only needs to be set up to respond to the protocols
commands received from the connected Modbus master device (e.g. PLC, HMI, OPC server). In
this mode the Master PLC device does not appear in the MiriMap2000+ project map as an icon as
there are no parcels to be defined. The AD2000 Series device is set up to receive protocol
commands, emulate protocol memory types and have a valid address and port communications
settings. A typical system layout for this is shown in the following diagram:

© 2007 Miri Technologies All rights reserved. V3.00 7-19


Chapter 7 - Protocols

Here the Master station is gathering data from the remote slave devices and making them available
to another Modbus Master device on one of the AD2006 ports. The only configuration parameters
to be set are those associated with that port.

Port Properties

The port properties for the Slave mode are:


‰ Protocol to be selected is Modbus.
‰ Interface to match the physical interface on the Modbus Master device. There are several
options available and these depend on the chosen AD2000 Series device port. The options
available per port are available in the selection list. These include, RS232, RS485 and
Ethernet as well as some of the radio options.
‰ Polling set to No Poll.

Comms

‰ Baud rate, Parity, Stop and data bits set to match the Master Modbus device.
The dialogue box showing these correct settings is shown:

Protocol Options

There are protocol specific settings that need to be set.


‰ Data Type - RTU (Binary) or ASCII.
‰ PLC Address - The Modbus address to be used by the Modbus Master to identify this port.
It must be unique on a multi-drop network.
‰ PLC Variables - The memory in the AD2000 Series device will emulate the Modbus protocol
on this port and match the Modbus commands to read or write from %MW variable memory.

© 2007 Miri Technologies All rights reserved. V3.00 7-20


Chapter 7 - Protocols

Press the PLC Variables button on the Protocol Properties box to display the Modbus PLC
Allocation table. This will list the mapping of physical memory to Modbus memory and the length
attributed to the different memory types. The default is to map the entire 64k word (65535 words) of
the AD2000 Series device memory to Modbus Holding register (type labelled 4xxxxx). This is
illustrated in the following diagram.

The maximum possible memory address using Modbus is 65535. Originally Modbus devices
only had 9999 registers. The maximum addressed memory is more common nowadays and this
can lead to confusion when addressing Holding Registers and Input Registers. For Holding
Register memory type the label used is number “4”. This should not be confused with the actual
address. For example, Holding Register address 41000 should not be confused with address 1000.
For Input Register memory type the label used is number “3”. This should not be confused with the
actual address. For example, Input Register address 32000 should not be confused with address
2000.There is no real convention in manuals to distinguish this easily thus take care when referring
to Modbus addresses and label them in Mirimap2000+ with the 4x or 3x superscript, (e.g. 4x41000
and 4x1000, 3x32000 and 3x2000).

Modbus TCP/IP
In the AD2006, the Ethernet port can be setup to support Modbus TCP/IP for support on LAN and
WAN networks. The process of building parcels and defining the ports is identical to those
described in the sections Modbus Master Mode Configuration and Modbus Slave Mode
Configuration. In addition to this the Ethernet XPort device must be set up to support the protocol
and the Master or Slave mode.
Refer to the section AD2006 XPort Ethernet Firmware Update to load the Modbus firmware to the
Ethernet XPort. The settings are listed in the following sections.

Modbus/TCP to RTU Bridge - Master Mode

Refer to the section on setting up the AD20006 Ethernet port to read the current settings. For
Modbus Master mode the settings should be adjusted as below:

© 2007 Miri Technologies All rights reserved. V3.00 7-21


Chapter 7 - Protocols

Set the item 2 Protocol to Modbus/RTU, Master attached and the additional option 5 will appear.
Here, select the full range of expected Modbus slave addresses and then the IP address of the
slaves. In this example, the Modbus Master device is only connecting from IP 220.1.1.215 to a
single Modbus Slave address 1 at IP address 220.1.1.219.

Modbus/TCP to RTU Bridge - Slave Mode

Refer to the section on setting up the AD20006 Ethernet port to read the current settings. For
Modbus Slave mode the settings should be adjusted as below:

© 2007 Miri Technologies All rights reserved. V3.00 7-22


Chapter 7 - Protocols

Set the item 2 Protocol to Modbus/RTU, Slave(s) attached and there are no additional options. In
this example, the Modbus Slave device is available at IP 220.1.1.219 and multiple masters are able
to connect to it (up to the maximum of 8 sockets on TCP port 502).

PLC Programming Software set up


The actual PLC/HMI set up is performed on different software produced by the PLC/HMI
manufacturer/supplier. Modbus is used for hundreds of devices and the range of software
packages to configure these is vast so example set up screens are not given here. Consult your
PLC/HMI or third party device documentation for further information.

Citect HMI Setup


For Citect ensure that the Citect.INI (or the INI file you are using for runtime operation) has the
following parameters set:
[Modbus]
FloatMode=1
1 - Byte order = 3 2 1 0
LongDataType=1
1 = 65536 x low register + high register
RegisterBitReverse=1
i.e. 1 - Bit 1= LSB, Bit 16 = MSB if you wish the bit order to match the MiriMap2000+ order to read
1,2,3,4,5,6,7 through to 16 rather than 16,15,14,13, through to 1.
InitType=2
Usually this will be 3, i.e. 40001, Holding Registers so ensure this is created (see configuring
Modbus slave mode). Other options are shown below.
InitType Address Variable
1 00001 - 00017 Output status

© 2007 Miri Technologies All rights reserved. V3.00 7-23


Chapter 7 - Protocols

2 10001 - 10017 Input status


3 40001 Holding registers
4 30001 Input registers
For Modbus with TCP, use the following parameters: Delay=50, Timeout=10000, WatchTime=30.
See the Citect Help on the Modbus driver parameters for further detail.

© 2007 Miri Technologies All rights reserved. V3.00 7-24


Chapter 8 - Diagnostic Variables

Chapter 8 - Diagnostic Variables


There are several diagnostic variables available in the AD2000 units and the following sections
detail these.

Radio Diagnostic Data


The MiriMap2000+ software Watcher will display the scaled values for the three radio diagnostics
RD-1 Temperature, RD-2 RSSI and RD-3 Tx Power. Please note that the correct internal radio
must be installed and configured for these radio diagnostics to be available. If radio diagnostics
data is required to be scaled for use in external PLCs, HMI or DCS packages, the raw analogue
values available at %MW65160, %MW65161 and %MW65162 (for RD-1 Temperature, RD-2 RSSI
and RD-3 Tx Power respectively) must be scaled separately. This can be achieved either in those
external packages or devices or via Ladder Diagram code in the AD2000. The scaled value for
Radio Diagnostics available in the Watcher is for Watcher viewing only.
These 3 radio diagnostic values are analogue values fed directly from the radios to the AD2000
analogue to digital converter chips. They are scaled as 0–65520 bits.
Where the AD2000 units are supplied with internal radios the following diagnostic variables are
available:

RD - 1 Temperature (%MW65160)
The temperature (in units of degrees Celsius, 0C) is derived from the formulae below:
Temperature = (Scaled Value x 100) - 273
Where:
Scaled Value = [(Display High - Display Low/Raw High - Raw low) x Measured Value] +1
Display High = 5, Display Low = 1
(N.B. The 1-5 Low to High values are based on the fact that the formulae are derived for an
analogue range of 1-5V DC from the actual internal radio hardware diagnostic circuit outputs).
Raw High = 65520 or 4095, Raw Low = 0
273 is the factor to convert temperature in Kelvin to degrees Celsius, 0C.

RD - 2 RSSI i.e. Radio Received Signal Strength (%MW65161)


The RSSI (in units of decibels, dB) is derived from the formulae below:
RSSI = [(Display High - Display Low/Raw High - Raw low) x Actual Measured Analogue
value] - 110
Where:
Display High = -30, Display Low = -110
Raw High = 65520 or 4095, Raw Low = 0
As an Example
Radio Signal Strength Indicator is an indication of the radio path level.
RSSI = (Display High - Display Low/Raw High - Raw low) x Actual Measured Analogue value
Where: Display High = -30, Display Low = -110, Raw High = 4095, Raw Low = 0
Thus: Scaled Value (Units) dB = [(0.019536 x Measure value from AD2000) -110]

RD - 3 Tx Power i.e. Transmit Power (%MW65162)


The Transmit Power (in units of Watts, W) is derived from the formulae below:
For 400MHz radios

© 2007 Miri Technologies All rights reserved. V3.00 8-1


Chapter 8 - Diagnostic Variables

Transmit Power = 1.151 x (Scaled Value + 0.192)2


For 900MHz radios
Transmit Power = 0.02 x (7 x (Scaled Value + 0.15))2
Where:
Scaled Value = [(Display High - Display Low/Raw High - Raw low) x Measured Value]+1
Display High = 5, Display Low = 1
(N.B. The 1-5 Low to High values are based on the fact that the formulae are derived for an
analogue range of 1-5V DC from the actual internal radio hardware diagnostic circuit outputs).
Raw High = 65520 or 4095, Raw Low = 0

© 2007 Miri Technologies All rights reserved. V3.00 8-2


Chapter 8 - Diagnostic Variables

PLC Diagnostic Data


There are several diagnostic variables available for the Ladder Diagram functions of the AD2000
units.

PLC System Coils


These are PLC system Coils with each bit in the word having a different function. There are 4
words reserved for PLC System Coils. These coils are pulses that occur once per PLC scan that
the event occurs in (one-shots). Thus to use these in Ladder Diagram a rising or falling edge
contact should be used. To latch them a SET coil would be required in the Ladder Diagram. They
cannot be viewed via the Watcher as the update time of the Watcher communications cannot be
processed to catch the pulse change. An example Ladder Diagram code is shown below that will
illustrate the use of the PLC System Coils in conjunction with an UP Counter.

[PLC System Read Coil 1] %MW65084 Word 1 bit definition

[PLC System Read Coil 1].1 - First_Scan_Coil (%MW65084.1).


PLC System Read Coil Word 1 Bit1 - on for the first PLC scan only.
[PLC System Read Coil 1].2 - Second_Coil (%MW65084.2).
PLC System Read Coil Word 1 Bit2 - on every change of second.
[PLC System Read Coil 1].3 - Minute_Coil (%MW65084.3).
PLC System Read Coil Word 1 Bit3 - on every change of minute.
[PLC System Read Coil 1].4 - Hour_Coil (%MW65084.4).
PLC System Read Coil Word 1 Bit4 - on every change of hour.
[PLC System Read Coil 1].5 - Date_Coil (%MW65084.5).
PLC System Read Coil Word 1 Bit5 - changes every change of date 1–31.
[PLC System Read Coil 1].6 - Month_Coil (%MW65084.6).
PLC System Read Coil Word 1 Bit6 - on every change of month.
[PLC System Read Coil 1].7 - Year_Coil (%MW65084.7).
PLC System Read Coil Word 1 Bit7 - on every change of year.
[PLC System Read Coil 1].8 - Log_Coil (%MW65084.8).
PLC System Read Coil Word 1 Bit8 - on when logging enabled (this must be on for logging to be
successful and normally is not reset to zero per scan).
[PLC System Read Coil 1].9 - Clock_Fault (%MW65084.9).
PLC System Read Coil Word 1 Bit9 - on for the internal AD2000 Real Time Clock (RTC) fault. This
is due to either an RTC chip failure or a battery failure and thus data-logging will stop. Immediately
replace the internal AD2000 RTC battery with a type CR1220 Lithium 3V type battery.
[PLC System Read Coil 1].10 - Event_Fault (%MW65084.10).
PLC System Read Coil Word 1 Bit10 - Event lost due to full event queue.
[PLC System Read Coil 1].11 - Data-log_Full (%MW65084.11).
PLC System Read Coil Word 1 Bit11 - Data-log has been filled and has wrapped to the start of the
data-log memory. Oldest data will be over-written.

© 2007 Miri Technologies All rights reserved. V3.00 8-3


Chapter 8 - Diagnostic Variables

[PLC System Read Coil 1].12 - Broadcast_Time_Sent (%MW65084.12).


PLC System Read Coil Word 1 Bit12 - This is written on when the system write coil [PLC System
Write Coil 1].4 - Broadcast_Time_Coil (%MW65086.4) is sent. This can be used to count or data-
log this event. Example code is shown below illustrating how this bit can be used to count the
number of times the Broadcast_Time_Sent bit has been sent, triggered (in this example only) by

the digital input 1. It is important that you use a Positive Rising Edge input trigger to the up
counter CTU CU input (failing to do this will result in a double count since the
Broadcast_Time_Sent bit is set ON for two scans).

[PLC System Read Coil 1].13 - SBD_Sent (%MW65084.13).


PLC System Read Coil Word 1 Bit13 - An Iridium SBD (Short Burst Message) has been sent.
[PLC System Read Coil 1].14 - Modem_Reset_Required (%MW65084.14).
PLC System Read Coil Word 1 Bit14 - The internal firmware has detected an error that suggests a
modem hard reset is required. This can be used to trigger a timer pulse to set a digital output
(normally closed contact, DOT3 or 4) ON to power off the attached modem.
[PLC System Read Coil 1].15 - Clock_Updated (%MW65084.13).
PLC System Read Coil Word 1 Bit15 - The AD2000 internal Real Time Clock (RTC) clock has been
updated from an external source.

[PLC System Read Coil 2] %MW65085 Word 2 bit definition

No definitions exist for this word at this time.

[PLC System Write Coil 1] %MW65086 Word 1 bit definition

[PLC System Write Coil 1].1 - Radio_Off_Coil (%MW65086.1).


PLC System Write Coil Word 1 Bit1 - if set ON will turn OFF the internal radio to reduce current
drain. Note that once off, no radio data can be transmitted or received so the unit should be turned
on periodically. Careful use of this bit is required.
[PLC System Write Coil 1].2 - Reboot_Unit_Coil (%MW65086.2).
PLC System Write Coil Word 1 Bit2 - if set ON will cause a re-boot of the AD2000 to reset all
internal parameters and interfaces. Careful use of this bit is required.
[PLC System Write Coil 1].3 - Sleep_Coil (%MW65086.3).
PLC System Write Coil Word 1 Bit3 - if set ON it will cause the unit to go to sleep mode. Careful
use of this bit is required. This is NOT for use with the AD2000 only the AD2004.
[PLC System Write Coil 1].4 - Broadcast_Time_Coil (%MW65086.4).
PLC System Write Coil Word 1 Bit4 - if set ON will cause a broadcast time command to be sent to
the remote AD2000 devices and will update the real time clock of all remotes to the same time as
the initiating AD2000. Careful use of this bit is required. This will only work with radio based
systems and there will be a transport delay in the time sent (i.e. it will take some hundreds of
milliseconds to send the broadcast time command to the remotes so they will be behind in time by
that amount).

© 2007 Miri Technologies All rights reserved. V3.00 8-4


Chapter 8 - Diagnostic Variables

No further definitions exist for remaining bits in this word at this time.

[PLC System Write Coil 2] %MW65087 Word 2 bit definition

No definitions exist for this word at this time.

Time
The Real Time Clock current time/date values. There are only 7 words available in this block, the
8th word is reserved/unused.

[Time_Second] %MW65264

Displays the current Real Time Clock (RTC) seconds word.


The displayed format is 0 to 59 seconds.

[Time_Minute] %MW65265

Displays the current Real Time Clock (RTC) minutes word.


The displayed format is 0 to 59 minutes.

[Time_Hour] %MW65266

Displays the current Real Time Clock (RTC) hour word.


The displayed format is 0 to 23 hours.

[Time_Date] %MW65267

Displays the current Real Time Clock (RTC) date word.


The displayed format is 1 to 31.

[Time_Month] %MW65268

Displays the current Real Time Clock (RTC) month word.


The displayed format uses the Roman calendar is 1 to 12, where 1 is January, 2 is February, 3 is
March, 4 is April, 5 is May, 6 is June, 7 is July, 8 is August, 9 is September, 10 is October, 11 is
November and 12 is December.

[Time_Day] %MW65269

Displays the current Real Time Clock (RTC) day word.


1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, 7 = Sunday.

[Time_Year] %MW65270

Displays the current Real Time Clock (RTC) year word.


00 = 2000, to 2099 wrapping to zero thereafter.

[Seconds Since Midnight] %MW32641/2

Displays the number of seconds since midnight as a 32 bit Long (unsigned integer)

General Diagnostics
The following PLC scan diagnostics are available for monitoring.

© 2007 Miri Technologies All rights reserved. V3.00 8-5


Chapter 8 - Diagnostic Variables

[Ave PLC Scan] %MW65273

The average time is the average time taken in milliseconds between 15 consecutive scans.

[Min PLC Scan] %MW65274

The minimum scan time is the least time a PLC scan took to complete.

[Max PLC Scan] %MW65275

The maximum scan time is the most time a PLC scan took to complete.

[Current Station ID] %MW65280

The ID (Identifier) number of the currently connected AD2000/6.

Data-log Diagnostics
The following data-log diagnostics are available:

[Log Count] %MW65276

The number of times a data-log variable has been written to the data-log memory. This will reach a
maximum count of 65535 and wrap to zero.

[Log Percent] %MW65279

This variable indicates the percentage of data-log memory currently used.

Port Diagnostic Data


Protocol error number per port
[Port Error Code Port1] %MW65030
[Port Error Code Port2] %MW65031
[Port Error Code Port3] %MW65032
[Port Error Code Port4] %MW65033
[Port Error Code Port5] %MW65034
For the exception or error numbers, read back from PLC type devices when the AD2000 is in
Master mode. The driver will flash the Fault LED but by reading this register and with reference to
the protocol error list (see each specific protocol errors later in this appendix), the exact error can
be determined. This would include any Miri2000 protocol errors.

Modem Status per port


[Port Dialup Status Port1] %MW65036
[Port Dialup Status Port2] %MW65037
[Port Dialup Status Port3] %MW65038
[Port Dialup Status Port4] %MW65039
[Port Dialup Status Port5] %MW65040
These status words are available for viewing modem control states. The modem operating states
are:
0 - MODEM_IDLE. The modem is in the idle state.
1 - MODEM_RESET. The modem is in the reset mode.

© 2007 Miri Technologies All rights reserved. V3.00 8-6


Chapter 8 - Diagnostic Variables

2 - MODEM_READY. The modem is ready after reset.


3 - MODEM_RING. The modem is ringing.
4 - MODEM_DIALING. The modem is dialing.
5 - MODEM_ANSWERING. The modem is answering a call.
6 - MODEM_CONNECTED. The modem is connected.
7 - MODEM_HANGUP. The modem is in performing a hang-up.
8 - MODEM_TIMEOUT. The modem is in a time-out and the AD2000 is trying to talk to it, e.g.
during retries.
9 - MODEM_ATTENTION. The modem is performing an attention command.
10 - MODEM_DEAD. The AD2000 thinks the modem has stopped responding and the modem
requires a power reset.
11 - MODEM_WAITING_CALLER_ID. The AD2000 unit is waiting for the caller ID text to be
determined (if present).

Bad Packets per port


This indicates the number of times bad packets (bad CRC/HDLC errors) etc. have been received
on the respective port.
[Bad Packets Port1] %MW65042
[Bad Packets Port2] %MW65043
[Bad Packets Port3] %MW65044
[Bad Packets Port4] %MW65045
[Bad Packets Port5] %MW65046

Current station ID polled per port


This indicates the station ID to which the port is trying to send a parcel. This would be the Station
Identifier for Miri2000 or the PLC address for others.
[Port TxID Port1] %MW65042
[Port TxID Port2] %MW65043
[Port TxID Port3] %MW65044
[Port TxID Port4] %MW65045
[Port TxID Port5] %MW65046

Received station ID polled per port


This indicates the station ID from which the port is receiving the current message. This would be
the Station Identifier for Miri2000 or the PLC address for others.
[Port RxID Port1] %MW65048
[Port RxID Port2] %MW65049
[Port RxID Port3] %MW65050
[Port RxID Port4] %MW65051
[Port RxID Port5] %MW65052

© 2007 Miri Technologies All rights reserved. V3.00 8-7


Chapter 8 - Diagnostic Variables

Retry count per port


This indicates the number of retries attempted on each port. These words accumulate to a
maximum value of 65535 and reset to zero then repeat the count. These words can be reset to
zero (or any other value via the Watcher or the Ladder Diagram logic).
[Port Retries Port1] %MW65054
[Port Retries Port2] %MW65055
[Port Retries Port3] %MW65056
[Port Retries Port4] %MW65057
[Port Retries Port5] %MW65058

Link Fail count per port


This indicates the number of times the Link Status point has been set OFF on each port. These
words accumulate to a maximum value of 65535 and reset to zero then repeat the count. These
words can be reset to zero (or any other value via the Watcher or the Ladder Diagram logic).
[Port Link Fails Port1] %MW65060
[Port Link Fails Port2] %MW65061
[Port Link Fails Port3] %MW65062
[Port Link Fails Port4] %MW65063
[Port Link Fails Port5] %MW65064

Message Received count per port


This indicates the number of times a complete protocol message packet is received on each port.
These words accumulate to a maximum value of 65535 and reset to zero then repeat the count.
These words can be reset to zero (or any other value via the Watcher or the Ladder Diagram logic).
[Message Rx Port1] %MW65066
[Message Rx Port2] %MW65067
[Message Rx Port3] %MW65068
[Message Rx Port4] %MW65069
[Message Rx Port5] %MW65070

PCMCIA Diagnostics (PCMCIA port only)


This indicates diagnostic counters on the PCMCIA port only. Currently these apply to the
diagnostics for the use of an Ethernet PCMCIA card. These words accumulate to a maximum value
of 65535 and reset to zero then repeat the count. These words can be reset to zero (or any other
value via the Watcher or the Ladder Diagram logic)
[PCMCIA_Diags1] %MW65072
The network tally counters exceeded. The values of the three counters at that time are added to
the global count and store in the following three counters [PCMCIA_Diags2], [PCMCIA_Diags3],
[PCMCIA_Diags4]
[PCMCIA_Diags2] %MW65073
Alignment error count.
[PCMCIA_Diags3] %MW65074
CRC error count.
[PCMCIA_Diags4] %MW65075
Missed packet count.

© 2007 Miri Technologies All rights reserved. V3.00 8-8


Chapter 8 - Diagnostic Variables

[PCMCIA_Diags5] %MW65076
Transmitted message ok count.
[PCMCIA_Diags6] %MW65077
Transmit error count.
[PCMCIA_Diags7] %MW65078
Overflow error count.
[PCMCIA_Diags8] %MW65079
Room available in the buffer to add packet.
[PCMCIA_Diags9] %MW65080
No room available in buffer to add packet.
[PCMCIA_Diags10] %MW65081
Packet header indicates good packet.
[PCMCIA_Diags11] %MW65082
Packet header indicates bad packet.
[PCMCIA_Diags12] %MW65083
Bad packet due to length error or page number exceeds limit.

Broadcast Diagnostics
These indicate parameters were used in previous implementations of Broadcast event systems.
They are not used in the current firmware, but remain defined for compatibility reasons between
map file versions..
[Broadcast Backoff Time] %MW65277
Currently set to zero. For possible future use.
[Broadcast Slot Var] %MW65278
Currently set to zero. For possible future use.

© 2007 Miri Technologies All rights reserved. V3.00 8-9


Chapter 8 - Diagnostic Variables

Miri2000 Error Codes


The following error codes are defined for the Miri2000 protocol.

Code 1000 - Invalid Message


The message received is not valid - usually a bad CRC.

Code 1001 - Bad Command


The message received is bad, garbled or not valid - it is an unrecognised command.

Modbus Error Codes


The Modbus protocol driver has several defined error exception codes as defined in the Modicon
Modbus Protocol Reference Guide (PI–MBUS–300 Rev. D) published by Modicon Inc. Industrial
Automation Systems March 1992. These are repeated in the following sections.

Code 01 - Illegal Function


The function code received in the query is not an allowable action for the Slave. If a Poll Program
Complete was isused, this code indicates that no program function preceded it.

Code 02 - Illegal Data Address


The data address received in the query is not an allowable address for the Slave.

Code 03 - Illegal Data Value


A value contained in the query field is not an allowable value for the Slave.

Code 04 - Slave Device Failure


An unrecoverable error occurred while the Slave was attempting to perform the requested action.

Code 05 - Acknowledge
The Slave has accepted the request and is processing it but a long duration of time will be required
to do so. This response is returned to prevent a timeout error from occurring in the Master. The
Master can next issue a “Poll Program Complete” message determine if processing is completed.

Code 06 - Slave Device Busy


The Slave is engaged in processing a long-duration program command. The Master should
retransmit the message later when the Slave is free.

Code 07 - Negative Acknowledge


The Slave cannot perform the program function received in the query. This code is returned for a
programming request using function code 13 or 14 decimal. The Master should request diagnostic
or error information from the Slave.

Code 08 - Memory Parity Error


The Slave attempted to read memory, but detected a parity error. The Master can retry the request
but service may be required on the Slave device.

Code 1000 - Invalid Message


The message received is not valid - usually a bad CRC.

© 2007 Miri Technologies All rights reserved. V3.00 8-10


Chapter 8 - Diagnostic Variables

Code 1001 - Bad Command


The message received is bad, garbled or not valid - it is an unrecognised command.

Allen Bradley DF1 Error Codes


The following error codes are defined for the Allen Bradley DF1 protocol STS Byte. The errors
should be read as HEX values. The STS byte provides information about the execution or failure of
the corresponding command that was transmitted from the computer. If the reply returns a code of
00, the command was executed at the remote node. All other codes can be divided into two types:
Local - the local node is unable to transmit a message to the remote node. The local node
interface turns the command around, stuffs the STS byte with the appropriate code and returns it to
the computer.
Remote - the command is successfully transmitted to a remote node but the remote node is unable
to execute the command. The remote node formats a reply message with the appropriate remote
error code in the STS byte.
The STS byte is divided into two nibbles (4 bits each). For further details refer to the DF1 Protocol
and Command Set document, AB Publication Number 1770–6.5.16, Chapter 8.

Code 00h - OK
Success no error.

Code 01h - Out of buffer space


DST node is out of buffer space.

Code 02h - Delivery problem


Cannot guarantee delivery on link layer. (The remote node specified does not ACK command.)

Code 03h - Duplicate token


Duplicate token holder detected.

Code 04h - Local port is disconnected


The local port is disconnected.

Code 05h - Application layer timed out


Application layer timed out waiting for a response.

Code 06h - Duplicate node


Duplicate node detected.

Code 07h - Station is offline


The station requested is offline.

Code 08h - Hardware fault


There is a hardware fault on the device you are requesting data from.

Code 10h - Illegal command or format


The command isused is illegal or the format is wrong.

© 2007 Miri Technologies All rights reserved. V3.00 8-11


Chapter 8 - Diagnostic Variables

Code 20h - Host has a problem and will not communicate


The error is as per description above.

Code 30h - Remote node host is missing, disconnected, or shut down


The error is as per description above.

Code 40h - Host could not complete function due to hardware fault
The error is as per description above.

Code 50h - Addressing problem or memory protect rungs


The error is as per description above.

Code 60h - Function not allowed due to command protection selection


The error is as per description above.

Code 70h - Processor is in Program mode


The error is as per description above.

Code 80h - Compatibility mode file missing or communication zone problem


The error is as per description above.

Code 90h - Remote node cannot buffer command


The error is as per description above.

Code A0h - Wait ACK (1775_KA buffer full)


The error is as per description above.

Code B0h - Remote node problem due to download


The error is as per description above.

Code C0h - Wait ACK (1775_KA buffer full)


The error is as per description above.

Code D0h - Not used


This error code is not used.

Code E0h - Not used


This error code is not used.

Code F0h - Error code in the EXT STS byte


The error is as per description above.

Code 100h - Invalid File


The Integer File requested for read/write is not defined. The file should be created with adequate
length to support the required read/write words.

© 2007 Miri Technologies All rights reserved. V3.00 8-12


Chapter 8 - Diagnostic Variables

Code 101h - Invalid Function


The DF1 function code is not supported by the AD2000 driver implementation. This would be the
case if you tried to use read/write functions on an SLC500 type PLC when the PLC5 read/write
functions are required. The DF1 driver supports different function codes to do the same read/write
functions to/from Integer Files used by the AD2000 units.

Code 1000 - Invalid Message


The message received is not valid - usually a bad CRC.

Code 1001 - Bad Command


The message received is bad, garbled or not valid - it is an unrecognised command.

© 2007 Miri Technologies All rights reserved. V3.00 8-13


Chapter 9 - Cables, connections and pin-outs

Chapter 9 - Cables, connections and pin-outs


RS232 Standard Pin Connections
25 Pin Assignments

© 2007 Miri Technologies All rights reserved. V3.00 9-1


Chapter 9 - Cables, connections and pin-outs

9 Pin Assignments

AD2000 RJ45 Pin Assignments

© 2007 Miri Technologies All rights reserved. V3.00 9-2


Chapter 9 - Cables, connections and pin-outs

RS232 Converter Pin Connections


These converters are straight through converters for use with other device RS232 cables that may
need a 25 to 9 pin converter or 25 or 9 pin converter to the RJ45 type connector used with the
AD2000 units. They are to be used as connector type converters only and are not actual cable
assignments. Commercially available converters are available and should be used in preference to
made up units for guaranteed connections and performance.

RS232 25 Pin to 9 Pin converter Pin Assignments

9 Pin to AD2000 RS232 Converter - Pin Details

© 2007 Miri Technologies All rights reserved. V3.00 9-3


Chapter 9 - Cables, connections and pin-outs

25 Pin to AD2000 RS232 Converter - Pin Details

© 2007 Miri Technologies All rights reserved. V3.00 9-4


Chapter 9 - Cables, connections and pin-outs

Device Cable Details


AD2000 to PC for Programming software and HMI/DCS cable - RS232

AD2000 to AD2000 Extension cable - RS232

© 2007 Miri Technologies All rights reserved. V3.00 9-5


Chapter 9 - Cables, connections and pin-outs

AD2000 to GE Fanuc 90 Series CMM Module - RS232

AD2000 to ADAM 4520 RS485/422 Converter

© 2007 Miri Technologies All rights reserved. V3.00 9-6


Chapter 9 - Cables, connections and pin-outs

AD2000 to Allen Bradley SLC500 PLC RS232 Port

AD2000 to UDS-10, 100 or 1100 Ethernet to Serial Converter

© 2007 Miri Technologies All rights reserved. V3.00 9-7


Chapter 9 - Cables, connections and pin-outs

AD2000 to Greenspan Smart Sensor RS232

Ethernet 10BaseT cables

Please note that the pin orientation for Ethernet is OPPOSITE to the orientation used for RS232
wiring diagrams on the AD2000 RJ45 plugs and sockets.

© 2007 Miri Technologies All rights reserved. V3.00 9-8


Chapter 10 - Glossary

Chapter 10 - Glossary
Some terms are used throughout this manual and in general discussions on the topic of remote
monitoring. For clarity they are defined in the following paragraphs.

Bits, Bytes and Words, Long, Real


A bit indicates of the state of a digital point, either ON or OFF (1 or 0).
A byte is 8 bits (sometimes referred to as an octet). The AD2000 Series devices do not support
memory in byte format, use a whole word (2 bytes) instead).
A word is 16 bits and most analogue values will be written into a word (even if the resolution of the
measured analogue is only 8 or 12 bits). A word can be signed or unsigned. Bits can be
represented in a single word in the order shown below:

A long is 32 bit and counters and timers can be used to count up to the maximum value available in
a long. A long can be signed or unsigned. Bits can be represented in a single long in the order
shown below:

A real is 32 bits and can be used to represent single precision floating point numbers (e.g. 3.2345, -
45678.1234) of any positive or negative sign. The real number bit format used is shown below:

The format and maximum ranges used in the AD2000 Series devices are shown in the following
table:
Table 26 - Number Format Ranges
IEC Data Type Signed Unsigned

WORD(16 bits) -32768 to 32767 0 to 216-1 (0 to 65535)

LONG (32 bits) -231 to +231-1 0 to 232-1


(-2,147,483,648 to (0 to 4,294,967,295)
2,147,483,647)

REAL(32 bits) 3.4 x 10–37 to 3.4 x 10+38

© 2007 Miri Technologies All rights reserved. V3.00 10-1


Chapter 10 - Glossary

Data acquisition
This refers to the various methods used to access and control analogue and digital information
from field devices. This information is multiplexed onto a telemetry system for transferring data
between different sites. The AD2000 Series devices allow this data acquisition for physical I/O
interface points, internal ladder logic variables and data gathered via the serial ports.

HMIs/MMIs/DCSs & PLCs


The term Human Machine Interface, (HMI) previously known as Man Machine Interface, (MMI) is
used to define the various software and hardware packages that allow representation of field data
via visual displays, thus allowing an interface between human and machine for interpretation of
system status. The simplest of these can be discrete I/O based units with switches and lamps
allowing display of system status information and control via selector switches etc. through text
based alarm panels and up to the most complex graphics software systems on multiple monitors
covering an entire plant or process.
The term Distributed Control System, DCS, is a complete system which includes closely integrated
operator stations, control modules and remote I/O (for interfacing to analogue and digital real world
signals). The term distributed refers to the practice of performing control functions in a series of
standalone control modules, distributed physically if desired and linked by a communications
highway. Operator screens are provided for controller monitoring, archiving and historical data
collection, alarming of important events, tending of variables and reporting of a period of plant
activity.
A Programmable Logic Controller, (PLC) is an electronic device used for automation of industrial
processes, such as control of machinery on factory assembly lines, pump controllers, gate
controllers etc.. Unlike general-purpose computers, the PLC is designed for multiple inputs and
output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to
vibration and impact. Programs to control machine operation are typically stored in battery-backed
or non-volatile memory. A PLC is an example of a real time system since output results must be
produced in response to input conditions within a bounded time, otherwise unintended operation
will result.

I/O
Refers to Input/Output, a common term for the field interface cards where analogue and digital
information is gathered.

Ladder Logic
Ladder logic is a method of drawing electrical logic schematics. It is now a graphical language very
popular for programming Programmable Logic Controllers (PLCs). It was originally invented to
describe logic made from relays. The name is based on the observation that programs in this
language resemble ladders, with two vertical "rails" and a series of horizontal "rungs" between
them. Ladder logic is one of the most popular PLC programming languages. It is one of the IEC
61131 languages (IEC61131 is an IEC standard for Programmable logic controllers. It was known
as IEC 1131 before the change in numbering system by IEC).

Leased Lines & Landlines


Leased lines are telephone lines owned by the telephone company but leased to provide direct
cable connection for modems. The telecom authority will maintain the lines for the lease charged.
The lease guarantees certain performance characteristics between each end but this may be
achieved via several cable connections and the user has no control over this. Landlines are similar
but not owned by the telephone company.

© 2007 Miri Technologies All rights reserved. V3.00 10-2


Chapter 10 - Glossary

Master
In any telemetry system the object is to gather data and usually this is presented in some form or
another at one site. This is known as the Master site. Often large SCADA systems will have several
sub-master stations which act as the master unit to other units on a different network and the Slave
on the main network. The term Master is still used in RBE (Report By Exception) configured
systems since the data is still being gathered to a central location.

Master/Slave (Polled) Systems


These refer to systems where the Master unit is in total control of the communication system. It
makes regular, repeated requests for data to each Slave in sequence, writing the data to each unit
and reading that unit's data back in response. This is a half duplex approach where the Slave only
responds on a request from the Master. Each Slave unit will have a unique address or identification
number to allow this to function correctly. If the Slave does not respond within a defined time, the
Master will retry again (usually several retries) and then carries on polling the other units in the
system. In the Miri systems, it is possible to retry that unit again on several more re-transmissions
before marking it as failed link after which the Master will only poll it once each poll period to enable
a restored link to be detected. The advantages of this type of system are:
‰ The process of data gathering is simple and easy to follow.
‰ A link failure of a Slave unit is detected fairly quickly.
‰ No collisions can occur on the communications network, hence the data throughput is
predictable and constant.
‰ For heavily loaded systems with each Slave having constant data transfer requirements, this
gives a predictable and efficient system.
The disadvantages of this type of system are:
‰ Variations in the data transfer requirements of each Slave cannot be handled.
‰ Interrupt type requests from a Slave requesting urgent action cannot be handled (as the
Master may be processing some other Slave).
‰ Systems which are lightly loaded with minimum data changes from a Slave are quite
inefficient and unnecessarily slow.
‰ Slaves needing to communicate with each other have to do so through the Master with
added complexity in the design of the Master station.
To overcome some of the above disadvantages in polled systems, system design can consider
using multiple sub-master networks so that there are several small, fast groups and the Master of
these is polled by the main system Master again in a quickly polled system.

Narrow-Band Wireless
Narrow band wireless systems are often termed this way due to their channel occupancy in the
radio spectrum which are typically 12.5kHz and 25kHz.
VHF (Very High Frequency) and UHF (Ultra High Frequency) wireless systems are typically used in
SCADA (System Control And Data Acquisition) systems and are popular in the water, sewerage
and electrical power utilities and in the oil, gas, mining and environmental industries. They usually
employ radio modems specifically designed to provide fast and efficient data transmission. They
are usually lower baud rate devices (2400/4800 bits per second) because with the various
modulation techniques available today, the higher the data rate the wider the channel allocation
required. Since the spectrum in these VHF and UHF frequency bands is to be distributed amongst
many different users the regulatory bodies employ channel width restrictions in order to share the
spectrum around.

© 2007 Miri Technologies All rights reserved. V3.00 10-3


Chapter 10 - Glossary

These narrow band radio systems is the traditional use for the AD2000 Series devices and many
hundreds of systems have been operating successfully in systems operating on a 24 hour/7 days a
week basis. Based on experience in some countries, however, this is not the most common or
easily available wireless method. The reasons for this seem to be lack of exposure to the
capabilities of such systems and possibly lack of regulatory freedom in the assigning of the radio
spectrum frequency. However, in some applications it is still the only cost effective way of remote
data monitoring and control for distances in the range of tens of kilometres.

OPC
The following text is based on the summary from the OPC Foundation, see
http://www.opcfoundation.org or further information.
OPC is a series of standards specifications. The first standard (originally called simply the OPC
Specification and now called the Data Access Specification) resulted from the collaboration of a
number of leading worldwide automation suppliers working in cooperation with Microsoft. Originally
based on Microsoft's OLE COM (component object model) and DCOM (distributed component
object model) technologies, the specification defined a standard set of objects, interfaces and
methods for use in process control and manufacturing automation applications to facilitate
interoperability. The COM/DCOM technologies provided the framework for software products to be
developed. There are now hundreds of OPC Data Access servers and clients.
Everyone's favorite analoguey for needing the original Data Access Specification is printer drivers
in DOS and then in Windows. Under DOS the developer of each application had to also write a
printer driver for every printer. So AutoCAD wrote the AutoCAD application and the printer drivers.
And WordPerfect wrote the WordPerfect application and the printer drivers. They had to write a
separate printer driver for every printer they wanted to support: one for an Epson FX-80 and one
for the H-P LaserJet, and on and on. In the industrial automation world, Intellution wrote their
Human Machine Interface (HMI) software and a proprietary driver to each industrial device
(including every PLC brand). Rockwell wrote their HMI and a proprietary driver to each industrial
device (including every PLC brand, not just their own).
Windows solved the printer driver problem by incorporating printer support into the operating
system. Now one printer driver served all the applications! And these were printer drivers that the
printer manufacturer wrote (not the application developer). Windows provided the infrastructure to
allow the industrial device driver's solution as well. Adding the OPC specification to Microsoft's OLE
technology in Windows allowed standardization. Now the industrial devices' manufacturers could
write the OPC DA Servers and the software (like HMIs) could become OPC Clients.
The resulting selfish benefit to the software suppliers was the ability to reduce their expenditures
for connectivity and focus them on the core features of the software. For the users, the benefit was
flexibility. They could now choose software suppliers based on features instead of "Do they have
the driver to my unique device?" They don't have to create a custom interface that they must bear
the full cost of creating and upgrading through operating system or device vendor changes. Users
were also assured of better quality connectivity as the OPC DA Specification codified the
connection mechanism and compliance testing. OPC interface products are built once and reused
many times; hence, they undergo continuous quality control and improvement.
The user's project cycle is shorter using standardized software components. And their cost is lower.
These benefits are real and tangible. Because the OPC standards are based in turn upon computer
industry standards, technical reliability is assured.
The original specification standardized the acquisition of process data. It was quickly realized that
communicating other types of data could benefit from standardization. Standards for Alarms &
Events, Historical Data, and Batch data were launched.

© 2007 Miri Technologies All rights reserved. V3.00 10-4


Chapter 10 - Glossary

Point to Point Systems


This is the simplest configuration for telemetry systems where data is exchanged between two
stations. One station can be set up as the Master and the other the Slave. A typical application
using the Miri range of products is to use two AD2000s each with 4 digital inputs and 4 digital
outputs mapped between each other. The I/O can provide basic level control via external wiring so
that when an input at the tank closes (or opens) this status is reflected at the other end on an
output to start (or stop) a pump. More sophisticated control is possible using internal process
functions and the on board analogue inputs. The data can be exchanged continuously using a
polled system or on an events only basis using the report by exception capability or a combination
of both using the periodic polled option and events.

Point to Multi Point Systems


This configuration is where one device is designated the Master unit to several Slaves. The Master
is usually the control room where the data gathered can be monitored and the system controlled
from. An example is shown below where several Miri products are connected on the same network
in a point to multi-point system. The data can be exchanged continuously using a polled system or
on an events only basis using the report by exception capability or a combination of both using the
periodic polled option and events. For large point to multi-point systems the broadcast method may
also be used.

Point Mapping
This is the process used in MiriMap to define the source memory points in a telemetry unit and the
required destination memory location.

Protocols
These are the languages used to allow different industrial devices to communicate and send data
across a network. Despite having the same essential end function, there are many different
protocols and the AD2000 units assist in allowing connection of different devices using different
protocols either via radio, cable or dialup modem connection.

PSTN Modems
These are otherwise referred to as dialup modems. These use the Public Switched Telephone
Network used for normal voice telephony. The digital data is MODulated to an analogue form to be
transmitted across the telephone network then dEModulated (hence the name MODEM) to return
the digital signalling. The connection to the telephone network is via a certain command known as
Hayes AT commands.

Report By Exception (RBE)


This refers to Report By Exception, or “event triggered” systems. The Slave station monitors its
own inputs for a change of state (digital) or percentage change in value (analogue). When such a
change is detected, the Slave unit initiates a transmission to the Master unit and transfers that
data. Some form of recovery process to cope with collisions is necessary. When multiple Slaves
require transmission at the same time an avalanche effect can result causing erratic system
operation and sometimes this will cause system failure. To cope with this a fall back process is
used so that if after all possible attempts to send the message have failed, each Slave stops trying
to transmit and waits until polled by the Master.
The advantages of this are:
‰ It reduces the unnecessary transfer of data at any particular time as in polled systems.
‰ Urgent status information is detected quickly.
‰ Allows Slave to Slave communications.
The disadvantages of this are:

© 2007 Miri Technologies All rights reserved. V3.00 10-5


Chapter 10 - Glossary

‰ The Master station may only detect a link failure after a period of time (the Master unit is
configured to poll all Slaves periodically for a complete system update, say every hour) due
to the infrequency of communication.
‰ The data can be configured as exception or non-exception and thus the non-exception data
will not be the latest value until the Master polls the Slave.
‰ There is effectively a filtering action on analogue values by the Master station as small
variations do not get reported. Only once the analogue values are outside the specified
percentage change limits are they reported.
‰ An operator must manually institute a system update to gain the latest value.
‰ If two or more Slaves initiate a transmission at the same time there will be a collision so data
from some Slaves will not be "real time".
‰ The system design becomes more complex since determination of exception data is
required, thus a thorough understanding of RBE is required.

RS232/422 & 485


RS stands for Recommended Standard. Newer designations use the EIA (Electronic Industry
Association) prefix. RS-232-C for example is Recommended Standard No. 232 Revision C. All
these are electrical standards only and do not define a protocol, a common misunderstanding.
The RS232 is a point to point interface and defines the electrical, mechanical and functional
parameters for an interface between Data Terminal Equipment (DTE) and Data Circuit Terminating
Equipment (DCE) employing serial binary data interchange.
The voltage levels of an RS232 receiver are:
Logic 0 - A voltage between +3V and +25V.
Logic 1 - A voltage between -3V and -25V.
Undefined - A voltage between -3V and +3V.
The voltage levels of an RS232 transmitter are:
Logic 0 - A voltage between +5V and +25V
Logic 1 - A voltage between -5 and -25V
to account for the voltage drop along the line.
The RS232 standard is useful only over tens of metres at high data rates.
The RS422 standard defines a balanced (or differential) communications interface using two
separate wires for each signal. This permits very high data rates and minimises noise problems
with varying ground potential because the ground is not used as a voltage reference. The line
voltages are between –1.5V and –6V for logic 1 and between +1.5 and +6V for logic 0. It is good
for data rates up to 10Mbps for distances of up to 1200m.
The RS485 standard permits multi–drop network connection on two wires. The line voltages are
between –1.5V and –6V for logic 1 and between +1.5 and +6V for logic 0. It is good for data rates
up to 10Mbps for distances of up to 1200m.
The term Programmable Logic Controller, PLC, defines the many industrial computers that have an
“real world” input and output interface to plant via digital and analogue modules. The modules are
mounted in a rack or a fixed I/O base and can also include remote I/O racks, all linked via a
suitable communications network. The operation or processing of the PLC is via the CPU and this
is programmed, more often than not, in relay ladder logic.
The AD2000 was designed specifically to interface with these HMIs/MMIs/DCSs and PLCs where
serial communications links are available, giving telemetry function to them (especially via radio).

© 2007 Miri Technologies All rights reserved. V3.00 10-6


Chapter 10 - Glossary

RTU
Refers to a Remote Terminal Unit which is the complete assembly of equipment at the field end
point of the SCADA system. This could be the valves, flow meters and alarms at a pump site for a
borefield or a PLC, or smart instrument in an industrial process or other sensors, transducers or
actuators and incorporates all the transceiver equipment and the communications interface
equipment. The AD2000 units can be described as RTUs.

SCADA
This refers to the combination of the fields of telemetry and data acquisition. SCADA encompasses
the collection of the information, transferring it back to a central site, carrying out any necessary
analysis and control and displaying this data on a number of operator screens. The Miri product
range allows all of these when used in conjunction with HMI/MMI/DCS software packages, typically
with the AD2000 unit as the interface point. (Miri has expertise in the design of SCADA systems
using several popular HMI/MMI/DCS software packages and can be contacted for further
information).

Spread Spectrum Wireless


Spread spectrum wireless based systems are often referred to as “Broad-Band” due to their
channel occupancy in the radio spectrum. There are two “world-wide” spread spectrum frequency
bands available 902MHz-928MHz and 2.4GHz-2.4835GHz. The major difference between 900MHz
and 2.4GHz wireless systems is range. While 900 MHz offers much greater range than the
2.4GHz, the 2.4Ghz system is more accepted internationally. License free operation of the 900MHz
spread spectrum systems is only approved in North America, Canada, Australia and Israel. There
is a 5.8Ghz band but few products use this band and it is for very short transmission distances and
generally used with cordless phone systems.
Both operate on a “shared spectrum” principle operating within the Industrial, Scientific and Medical
(ISM) bands that offer license free operation within certain frequencies. Their power levels are
restricted by regulatory agencies to 100mW or less (some countries are allowing 1W EIRP, which
is the power output at the antenna). Spread spectrum can either be done by frequency hopping or
by direct sequence. Frequency hopping consists of rapidly moving from one channel to the next
while maintaining synchronization with the receiver. Direct Sequence is more complex, but works
by slicing the carrier up with a code that can be decoded at the other end. The AD2000 uses the
frequency hopping as its method of spread spectrum in both the 900MHz and the 2.4GHz systems.
The principle behind spread spectrum wireless solutions is that anyone can access the
“broadband” but each uses only a small part of that band at any one time. Thus many users can
use the same broad band. That is spread spectrum’s basic weakness. The broad band, although
wide compared to narrow band solution, is fixed (2.4GHz to 2.4835GHz) and cannot be extended.
Nowadays, just about every wireless product is in this frequency band, ranging from a cordless
mouse to the more familiar WiFi wireless LAN networking products. As soon as you have many
users accessing the same “broad” band then there is an inevitable battle to hop from channel to
channel to get a free one to transmit on. In high noise areas (e.g. cities and suburban or
commercial areas) this can mean that the data throughput is severely limited or even stopped. It all
depends on which device has the strongest signal. Normally within the confines of a building
(home, office, factory) this is not a problem and the spread spectrum device your are using can
remain the one with the strongest signal strength. As soon as you transmit longer distances (over a
few kilometres) you are also able to receive other devices on the same frequency (and interfere
with them) and thus the data throughput can be effected (often reduced). This is the reason that the
recommend is that 2.4GHz spread spectrum solutions be limited to systems where the distance is
under 1km.

© 2007 Miri Technologies All rights reserved. V3.00 10-7


Chapter 10 - Glossary

Store & Forward


This feature allows any station in the network to relay a message to another when direct
transmission is not possible. A common use of this is on radio networks when the Master station
does not have direct communications to a Slave due to either excessive distances causing poor
fade margins or due to obstructions preventing line of sight communications. Often other Slaves
are within range of the Master station and the Slave station concerned. This second Slave station
can be used to pass on or relay the message from the master station and process the reply. This
often removes the necessity to install talk-through repeaters and the costs and complexities caused
by such an arrangement.

Telemetry
This refers to the techniques used for transmitting and receiving data over physical media, the
protocols (languages) used to structure the communications in an orderly manner for accessing
multiple sites and the methods of interfacing between different communications media and data
acquisition systems. The Miri product range allows telemetry to function over radio, landline,
leased line, dialup modem links and cable interfaces such as RS232, RS422, RS485 via external
converters. It is also possible to link units via fibre optic using external converters.

© 2007 Miri Technologies All rights reserved. V3.00 10-8


Chapter 10 - Glossary

© 2007 Miri Technologies All rights reserved. V3.00 10-9

You might also like