Monday, May 7, 2012

IEC1107

IEC1107 PROTOCOL DATA EXCHANGE FOR METER READING TARIFF AND LOAD CONTROL



 Introduction

This international Standard describes a method for direct local data exchange, where the Tariff device is read and programmed using a handheld unit directly connected to the meter.In 2002 the IEC1107 standard was renamed as IEC62056-21:2002( International Electrotechnical Commission document 62056-21:2002). Many manufacturers, continue to refer to IEC1107 rather than the newer and less-memorable document number.

This Standard describes the software protocols and hardware for exchanging data with utility tariff meters. The hardware of a two-way optical interface is described; its mechanical and optical parameters.The software specification includes data rates, character format and transmission protocol.The IEC standard has been adopted by meter manufacturers throughout Europe and in some other territories.Ferranti and Landis And Gyre were early proponents of an interface standard that became similar to IEC1107.
IEC document is copyright and cannot be reproduced .

Scope and Object
This international standard presents hardware and protocol specifications for local Systems, while specifications for a remote system falls within the scope of another document. This standard deals with direct local system. In which the hand-held unit (HHU) is connected to one tariff device only at a time. Connection can be permanent or disconnectable through an electrical or optical coupling. The protocol took as its basis the basic reference model  for communication between open systems (OSI).  
Electrical Interface
a) Type of signal: 20ma current loop (ISO 7498 potential separation)
b) Power Supply: On the tariff device side the interface is passive(ISO 7498). The HHU supplies the necessary power.
c) Connection: Via terminals or suitable connectors

Character Transmission
Asynchronous serial bit (Start - Stop) transmission according to ISO1177,half- duplex.
Transmission   speed: 
Initial baud rate – 300
 Standard baud rates – 300, 600, 1 200,2 400, 4 800, 9 600
Special baud rate - as desired.
NOTE - The maximum speed may be limited by the reading head.
Signal  quality 
According to ISO 7480 (1984) - Category  PI  for the transmitter-Category PA for the transmitter
Character format
Character format  to ISO 1177(1 start bit. 7 data bits. 1 parity bit. 1 stop bit).
Character code
Character  code to ISO 646 International  reference version. For local use, National replacement code can be used.
Character security
With parity bit :Even parity  according  to ISO 1177.

Data transmission protocol

The data transmission protocol consists of four alternative modes of operation (modes A, B, C, D)(mode E  also there). All modes offer the provision of automatic data readout. In addition, Mode C allows for programming of the tariff device. The data exchange is a subset of the basic mode control procedures, ISO 1745. Communication in modes A,' Band C is bi-directional and is initiated by the transmission of a request message to the tariff device. Communication in mode D is uni-directional. With signals flowing from the tariff device only. This transmission is initiated by operating a push button or other sensor on the tariff device. The mode being used by the tariff device is indicated by the baud rate identification character in the identification message from the tariff device

• Mode A supports bi-directional data exchange at 300 baud without baud rate switching. This protocol mode permits data readout and programming with optional password protection;
• Mode B supports bi-directional data exchange with baud rate switching. This protocol mode permits data readout and programming with optional password protection;
• Mode C supports bi-directional data exchange with baud rate switching and permits data readout, programming with enhanced security and manufacturer-specific modes;
• Mode D supports unidirectional data exchange at a fixed baud rate of 2400 baud and permits data readout only;
• Mode E supports advanced protocols, like DLMS/COSEM.
The mode can be negotiated by the HHU and the meter. A meter can support more than one
mode: today, support of Mode C and Mode E with DLMS/COSEM is common practice.

Saturday, March 24, 2012

Simple GNU Make File


GNU Make contains many default rules, referred to as implicit rules, to simplify the construction of makefiles. For example, these specify that ‘.o’ files can be obtained from ‘.c’ files by compilation, and that an executable can be made by linking together ‘.o’ files. Implicit rules are defined in terms of make variables, such as CC (the C compiler) and CFLAGS (the compilation options for C programs), which can be set using VARIABLE=VALUE lines in the makefile.

A simple ‘Makefile’ for the project above can be written as follows:

CC=gcc
CFLAGS=-Wall
main: main.o hai.o hello.o
clean:
rm -f main main.o hello.o hai.o


The meaning of make file is like :
1) Using the C compiler gcc, with compilation option -Wall,
2)Build the target executable main from the object files ‘main.o’ ,‘hello.o and’hai.o'
3)These, in turn, will be built from ‘main.c’ ,'hai.c'and ‘hello.c’.
4)The target clean has no dependencies and simply removes all the compiled files.
The option -f (force) on the rm command suppresses any error messages if the files do not exist.
To use the makefile, simply type make.
 When called with no arguments, the first target in the makefile is built, producing the executable ‘main’:
To remove the generated files, type make clean:

Another example of make file:

CC = gcc
CFLAGS = -g -W -Wall
OBJ = main.o hai.o hello.o
.c.o:
$(CC) $(CFLAGS) $<

all: $(OBJ)

clean:

rm -f *.o

Followers