Thursday, November 22, 2012

Wireless Modules

Recently I found this word press blog describing about different Rf modules and which was useful to me.

Friday, October 5, 2012

IEC1107 mode D


Data exchange is unidirectional in protocol mode D and permits readout only. The information flows from the tariff device to the HHU. Data transmission is initiated, for example by operating a push button or other  sensor on the tariff device.

The protocol mode used by the tariff device is indicated to the HHU by the identification message. Protocol modes A to D are identified by the baud rate identification character ,while protocol mode E is identified by an escape sequence.


Protocol mode B (with baud rate changeover, without acknowledgement/option select message)

Protocol mode C and protocol mode E (with baud rate changeover, with acknowledgement / option select message or other protocols)

Wednesday, October 3, 2012

Couldn't read IEC1107/IEC62056 meter through USB

In most of the case, people couldn't read 1107 meter through USB  to serial converter because ,there will be baud rate negotiation in between the communication and at that time IR LED will not get enough power in between the communication.
This problem arising because most of optical reading unit uses RTS some other pin for powering IR.But when baud rate changes ,this pin also get affected in case of USB-Serial converter.  

Saturday, July 14, 2012

Time synchronization using IEC1107

Most of the automated metering projects procuring meters with built in IEC1107 driver and an optical port.
In this case while reading data from meters, its very difficult to process if meter is not in time synchronization with the data concentrator unit. But its possible synchronize the time between meter and DCU through IEC1107 protocol .Most of the meter support time sync facility. The sequence of steps include normal iec1107 procedure,
/?!<0D><0A> could be the first command for initiate the data read.
Then  meter will respond with identification response and it may like ,
/LTA4L0506272    
After that we have to give a command to enter in programming mode and command will be like
<06>041<0D><0A>
and meter will respond with an acknowledgement and after that it should follow the sequence of procedures specified by meter manufacture.

Friday, May 25, 2012

Serial Communication:- Applications


In computing, a serial port is a serial communication physical interface through which information transfers in or out one bit at a time (in contrast to a parallel port). Throughout most of the history of personal computers, data transfer through serial ports connected the computer to devices such as terminals and various peripherals.
While such interfaces as Ethernet, FireWire, and USB all send data as a serial stream, the term "serial port" usually identifies hardware more or less compliant to the RS-232 standard, intended to interface with a modem or with a similar communication device.
Modern computers without serial ports may require serial-to-USB converters to allow compatibility with RS 232 serial devices. Serial ports are still used in applications such as industrial automation systems, scientific instruments, shop till systems and some industrial and consumer products.
There are lot of application which enables you to test,transfer data from one system to another .
1) The most common application used in windows is Hyper terminal

2) In linux Cutecom is most common application available in all Linux versions

3) Hercules is another application run in windows platform which can be used as serial terminal as well as tcp/ip clients and server.
4) Dock light is very good serial terminal which has several additional features useful for developers.
5) Realterm is a terminal program specially designed for capturing, controlling and debugging binary and other difficult data streams. It is far better for debugging comms than Hyperterminal.

6)Terminal is a simple serial port (COM) terminal emulation program. It can be used for communication with different devices such as modems, routers, embedded uC systems, GSM phones,... It is very useful debugging tool for serial communication applications.

Saturday, May 12, 2012

IEC 62056-21 “Flag”


 Introduction 

IEC 62056-21 is the third edition of the well-known IEC 1107 standard, also known as the “Flag protocol”. Although it was intended for local data exchange using hand held units (HHU), it is also widely used for remote data exchange with PSTN and GSM modems.It specifies three local physical interfaces: optical, current loop and V.24 / V.28, as well as a data transmission protocol. The protocol permits reading and programming of devices, basically by reading and sending information represented by ASCII characters to / from given memory locations.
Like 1107 ,the following communication modes are available: 
• 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. 

Status of standardization  
The current standard has been established by IEC 62056-21 WG 14:. IEC 62056-21 Ed. 1.0:2002,  Electricity metering – Data exchange for meter reading, tariff and load control – Part 21: Direct local data exchange (third edition of IEC 61107) The standard is open and widely used. However, the memory mapping is not standardized, therefore data exchange requires manufacturer specific information. Meters of different types or from different manufacturers are not readily inter-operable: each meter type needs a specific driver. Annex C of the standard specifies formatted codes, but these are not widely used. 
Support organization 
The mandatory three-letter manufacturer identifiers are allocated by the FLAG Association, in co-operation with the DLMS User Association. The same identifiers are also used for DLMS/COSEM. Some three hundred manufacturers have obtained their manufacturer ID. 


Data model 
Not available in modes A to D, data are located and manufacturer specific memory addresses.  In Mode E, the COSEM data model and protocol stacks are used. 
Communication media supported 
The current loop is a local bus supporting up to eight meters. PSTN and GSM are supported with appropriate modems. 
Summary 
This protocol was the first standard protocol for meter data exchange and is globally used. 
Today, its main use is for local data exchange. 





Thursday, May 10, 2012

IEC1107 Sample Output From the Meter-IEC1107 File Format

The Optical Port Reader IEC1107 is a device enabling communication between any type of electricity meter equipped with a port according to the IEC1107 standard and a reading device equipped with RS232 or USB 2.0 port.The data read from meter will in the form of a  file similar to following. But the standard does not specified more about the format and length of data and most of those are manufacture specific.
But it defines that data should be :
V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  ) in this format. where V specifies the type of data in that line.




==> /?!<0D><0A>
<== /LTA4 NP-1111-C      
==> <06>040<0D><0A>
<==  -- STX -- 
<== H(Larsen & Toubro Limited)
<== H(NP-1111-C        )
<== H(02-05-99  Tue 12:51:01  )
<== H(5 1.00 1.00 1 0  )
<== H(verAD01.02 )
<== H(V2000  )
<== H( 02-05-99  Tue 12:51:01  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V( NP-1111-C        +01471.8  +00032.3  +00011.4   )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 12  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 11  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 10  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 09  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 08  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 07  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 06  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 05  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 04  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 03  )
<== V(00 +00.00 08 00 +00.00 08 00 +00.00 08 00 +00.00 02  )
<== V(00 +00.00 08 38 +00.00 09 32 +00.00 01 34 +00.00 01  )
<== V(00 +00.00 08 00 +00.00 08 31 +00.00 09   )
<== !
<==  -- ETX -- 
<==  -- BCC -- 

Manual Reading of IEC1107 meter

The optical read-out head is used for data communication between a PC or hand-held terminal to energy meters, electricity meters and similar metering equipment with optical data port according to IEC 1107/EN 61107(according to the IEC1107 standard and a reading device equipped with RS232 or USB 2.0 port.). Applications range from simple data readings e.g. for billing purposes and comprehensive programming of meters.
An application("IEC1107 testing software Test1107pack.exe") from http://www.meter-test-equipment.com/index.php?page=download&lng=en  can be used for reading data from meter supporting  IEC1107  protocol.
Meter with optical port
Connect the cable's optical 'port end to the meter and RS232 DB9 cable to the PC. Through a any serial port emulator or Hyper terminal in windows,  enter the command according to IEC1107 protocol to read the meter data, most probably which may contains the historical data. But unfortunately the data or meter file read from different meters were different for different manufactures and make. 
/?!<0D><0A> could be the first command for initiate the data read.
Then  meter will respond with identification response and it may like ,
/LTA4L0506272    
After that we have to give a command to read meter file an that may be like
<06>040<0D><0A>
After  that we will receive  a series of characters which collectively forms the the historical reading of the mater. 
HHU(Hand held unit) for reading meter data

Some meters like LnT 's ERP300 comes with rs485 port that support IEC1107 protocol ,in that case command needs a device address to read the meter. Which supports  multidroping  and all.  

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

Wednesday, March 21, 2012

Linux Makefile

COPY FROM: http://forum.codecall.net ->linux-tutorials-guides-tips->17681-linux-makefile-tutorial
Introduction
The make program essentially is used to update targets (exe or object files) according to the dependency instructions, typically present in a file called makefile. The program automatically can link dependent modules and also decide which files are to be (re)compiled by looking at the object code timestamps. Essentially make allows the compilation process to be a breeze.

Makefile Description
The makefile contains all the dependency information required for compiling. The file is typically denoted as makefile or Makefile. This however can be overridden by specifying the file name with the -f switch. The instructions are written in single lines and interpreted accordingly. A backslash (\) can be used to signify continuation of the line.
The target is the final output that is required at the end of the make process. It typically is reliant on many other files to have compiled successfully. Target compilation are carried out by a series of actions called as command. Rule can be composed of multiple commands but each starting with a tab character.
Makefile has the feature of using variables, like in other programming languages. A variable is defined as:
variable_name = variable_definition
$(variable_name) is used to use its value.
Make software also has set of internal macros:
$+
List of all the defined dependencies, space separated, with duplicates
$^
List of all the defined dependencies, space separated, without duplicates
$@
Contains the name of the current target
$<
Current prerequisite modified later than the current target  ie..  the name of the related file that caused the action.
$* 
the prefix shared by target and dependent files. 
Make Options
The makefile typically has the contents are specified below:
Empty Lines
Lines with no text are ignored
#
Pound acts as a start of comments (single-line) indicator
Dependencies
targets: dependency; commands
Here the targets and their dependencies are specified. If the dependent files have not been created or a newer version of their source code exists, then the files are regenerated. These can be followed by one or more commands. If there are no dependencies then the commands are executed always.

Make Options
-f makefile
The specified makefile is used as the description file
-h
Print the help information
-i
Ignore any errors
-n
Prints the command that will be executed. For testing the flow of the compilation process.
-q
Returns 0 if the target file is up to date; non-zero if otherwise
-p
Prints out the variables and settings existing by default

Running Make
Now to put all the above options to use. We will build a descriptor file to build an exe called sampleexec. Also assume that it needs two source files src1.c and src2.c. To build a descriptor for this and save it in a file called makefile.

The makefile will look like this
Code:
     sampleexec : src1.o src2.o 
             gcc -o sampleexec src1.o src2.o
     src1.o : src1.c 
             gcc -c src1.c
     src2.o : src2.c 
             gcc -c src2.c

To compile just run:
Code:
# make
Steps make takes to compile sampleexec:

sees that sampleexec depends on the object files src1.o src2.o
looks for the target definition of the two object files.
sees that src1.o depends on the file src1.c
executes the commands given in src1.o's rule and compiles src1.c to get the object file.
similarly looks at the target src2.o and compiles the object files
prepares sampleexc by combining the two object files


Common implicit rule is for the construction of .o (object) files out of .cpp (source files):


.o.cpp:
        $(CC) $(CFLAGS) -c $<
alternatively
.o.cpp:
        $(CC) $(CFLAGS) -c $*.c




Monday, January 30, 2012

Drag and Drop Not Working in Windows 7

If you could not  drag and drop your files and folders in Windows Explorer:
                    Just try this->
In Windows Explorer, click a file with the left mouse button and keep the button held down. Then press the Escape key. Drag and drop is miraculously re-enabled.



Friday, January 27, 2012

What Is Embedded Linux?


Embedded Linux typically refers to a complete system, or in the Linux vendor, to a distribution targeted at embedded devices.there is no special form of the Linux kernel targeted at embedded applications. Instead, the same Linux kernel source code is intended to be built for the widest range of devices, workstations,and servers imaginable, although obviously it is possible to configure a variety of op-tional features according to the intended use of the kernel. For example, it is unlikely that your embedded device will feature 128 processors and terrabytes of memory, and so it is possible to configure out support for certain features typically found only on larger Linux systems.

What Is Linux?


Linux was first released into an unsuspecting world in the summer of 1991.Linux refers only to an operating system kernel originally written by Linus Torvalds. The Linux kernel provides a variety of core system facilities required for any system based upon Linux to operate correctly. Application software relies upon specific features of the Linux kernel, such as its handling of hardware devices and its provision of a variety of fundamental abstractions, such as virtual memory, tasks (known to users as processes), sockets, files, and the like. The Linux kernel is typically started by a bootloader or system firmware.

 The term “Linux” has become somewhat overloaded in everyday commu-nication. In large part, this is due to its growing popularity—people might not know what an operating system kernel is or does, but they will have perhaps heard of the term Linux. In fact, Linux is often used interchangeably in reference to the Linux kernel itself, a Linux system, or an entire prebuilt (or source) software distribution built upon the Linux kernel and related software. Such widely varying usage can lead to difficulties when providing technical explanations. For example, if you were to say, “Linux pro-vides TCP/IP networking,” do you mean the TCP/IP stack implementation in the Linux kernel itself, or the TCP/IP utilities provided by a Linux distribution using the Linux kernel, or all of the above?

The broadness of the usage of the term has led to calls for a greater distinction between uses of the term “Linux.” For example, Richard Stallman and the Free Software Foun-dation often prefix “GNU/” (as in “GNU/Linux”) in order to refer to a complete system running a Linux kernel and a wide variety of GNU software. But even terms such as these can be misleading—it’s theoretically possible to build a complete Linux-based system without GNU software (albeit with great difficulty), and most practical Linux systems make use of a variety of both GNU and non-GNU software.

Despite the con-fusion, as more people continue to hear of Linux, the trend is toward a generalization of the term as a reference to a complete system or distribution, running both GNU and non-GNU software on a Linux kernel.  The most famous desktop linux distributions are  Red Hat Enterprise Linux (RHEL), SuSE Linux Enterprise Server (SLES), Ubuntu Linux, or Debian GNU/Linux.And all of these provide the user with a pre-packaged, shrinkwrapped set of files and an installation procedure to get the kernel and various overlaid software installed on a certain type of hardware for a certain pur-pose.

Linux


I am not posting my own work here ,most of the contents about linux taken from Building Embedded Linux Systems by
 Karim Yaghmour, Jon Masters, Gilad Ben-Yossef, and  Philippe Gerum

Tuesday, January 17, 2012

Combining two Internet Connections



 Combining Bandwidth, or and Load Balancing of two Internet connections.
It is not a secret (and not necessarily a bad thing) that most of us are possessed with Speed. The fastest Car, the fastest Video for game, the fastest hard Drive, and now the fastest Internet download.
With the availability of many Internet connections a lot of people might have two broadband connections available, or Broadband + Dialup connection, or other combinations. One of the first thing that comes into their mind is:  Can I combine the two connections and get a faster Download of flies and media?

First let clarify that we are talking about two independent connections. Some people try to put two modems on one DSL line,  or two modems on one Cable Internet account.
It does not work this way.  If by a mere “fluke” some thing is wrong with the ISP authentication system and it does work, it is illegal to do so and the ISP will caught you very fast.

So you have two independent legal Broadband accounts (can be two DSL two Cable or one of each.)
There are two terms that might be associated with using two independent Internet connections.
1. Combining Bandwidth.
2. Load Balancing two connections.

Let assume that you have two 3Mb/sec. connections each capable to download at 300KB/sec.
With Combined Bandwidth you should be able to download one file at 600KB/sec.
With Load Balancing one single file will not exceed download speed of 300KB/sec.  However you can download 2 files at 300KB/sec. or 4 files at 150KB/sec. etc.

Unfortunately Combining Bandwidth can not be done without the ISP providing such a specific service.

Computers are Not mind readers. If the two connections are not synchronized at the source your computer would know how to combine it to a coherent page.
Any if and but about it is just Wishful thinking.
The price of such a service (if available) is usually much more expensive than upgrading your connection from the basic service to a faster business or corporate service. 

If you do have two independent services you can achieve Load Balancing by using a Dual WAN Router.
This type of Cable/DSL Routers have two WAN connections for two Broadband Modems and they would mange the Internet traffic to the LAN to be used in the most efficient way.

taken from :ezlan.net/loadbalance.html

ForceBindIP

ForceBindIP is a freeware Windows application that will inject itself into another application and alter how certain Windows Sockets calls are made, allowing you to force the other application to use a specific network interface / IP address. This is useful if you are in an environment with multiple interfaces and your application has no such option for binding to a specific interface. ForceBindIP works in two stages - the loader, ForceBindIP.exe will load the target application in a suspended state. It will then inject a DLL (BindIP.dll) which loads WS2_32.DLL into memory and intercepts the bind(), connect(), sendto(), WSAConnect() and WSASendTo() functions, redirecting them to code in the DLL which verifies which interface they will be bound to and if not the one specified, (re)binds the socket. Once the function intercepts are complete, the target application is resumed. Note that some applications with anti-debugger / injection techniques may not work correctly when an injected DLL is present; for the vast majority of applications though this technique should work fine. As of version 1.2, all known functions in WS2_32.DLL that either explicitly or implicitly bind to an interface are intercepted. Please note however that certain programs may still end up using the default interface if they implement connections that do not use the standard winsock functions.

Followers