Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC and Modbus Energy Meter Interfacing

Status
Not open for further replies.

vigyanabikshu

Member level 1
Joined
Oct 2, 2008
Messages
32
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Location
KERALA, INDIA
Activity points
1,528
Can somebody please suggest me to where to start from the PIC and ModBus energy meter interfacing?
 

As per I know Mod-bus specification are there on wiki it is multi-drop rs-485 half-duplex interface.....related to PIC you will get lot of article on net....but as per your interfacing is concern you need to first work on UART....and then you need to connect RS232/RS485 converter on UART and implement the MODBUS in the PIC.... One more thing you need to know about energry meter registers too....I think most of smart meter comes with mod-bus....

Good Luck....
 
Thanks Mr. kulkarni,

Now I can interfacing with the EAPL's EMS17 modbus energy meter and the PIC using their RS485 converter (EA232/485).

I want to avoid the converter and use MAX485 IC instead of the converter (it Costs nearly Rs.2600 while MAX484 costs Rs.25)

I tried MAX485 and the meter's RS485 IC receives exact that I send through my MAX485 in PIC side. But the meter not responding.

I have noted that the converter send to the RS485 line something different bytes than that I send from the PIC.

I don't know What is the reason

Any help is really appreciated
Thanks in advance
 

In my view couple of things that you need to explore-

1) Did you configure the meter properly for data transfer.... I mean....password and other parameters like ID, baud rate etc. for meter. This is one time process in case of many other meters.... you need to download the datasheet and try to follow how to configure the meter from data transmission.
2) As per mod bus protocol is concern you need to follow the command sequence given by the protocol - refer -
https://en.wikipedia.org/wiki/Modbus
3) You need to even look at the Max485 input and check for the loop back to conform that what ever command/Data that you send to Max485 get received properly.
4) Most of the time it happens that in case of PIC micro-controller the RX interrupt of UART is used for data reception detection but if the PIC micro-controller is using some other interrupt then one need to set the high priority for this RX interrupt at Data capture is important event. This is right way but What I can suggest you to go initally to be in polling mode for data reception and making other interrupts to be masked to start with.

I hope this will help you to resolve the problem.

good luck

milind
 

In my view couple of things that you need to explore-

1) Did you configure the meter properly for data transfer.... I mean....password and other parameters like ID, baud rate etc. for meter. This is one time process in case of many other meters.... you need to download the datasheet and try to follow how to configure the meter from data transmission.
2) As per mod bus protocol is concern you need to follow the command sequence given by the protocol - refer -
https://en.wikipedia.org/wiki/Modbus
3) You need to even look at the Max485 input and check for the loop back to conform that what ever command/Data that you send to Max485 get received properly.
4) Most of the time it happens that in case of PIC micro-controller the RX interrupt of UART is used for data reception detection but if the PIC micro-controller is using some other interrupt then one need to set the high priority for this RX interrupt at Data capture is important event. This is right way but What I can suggest you to go initally to be in polling mode for data reception and making other interrupts to be masked to start with.

I hope this will help you to resolve the problem.

good luck

milind



Thank you very much for your kind reply

1. I have no idea on why the password is for in the meter. It shows the password '1000' in my device. Slave Address is 0001 and the Baud Rate is: 9600

2. Modbus protocol command sequence is as per the protocol. Sample I send from the PIC through the converter is [01][03][00][00][00][0A][C5][CD] and the response is [01][03][14][00][00][42][48][00][00][00][00][00][00][00][00][00][00][00][00][00][00][00][00][A1][1D]
Same data send through the MAX485 (also through a hexin converter) not working. But the exact send data is reaching at the meter's RS485 IC's USART Tx pin.

3. Every data I send through MAX485 reaches at the energy meter. I have checked its RS485 IC's(ADM2483) UART Tx Pin and Rx Pin. But while sending through their converter the meter receives something different bytes. Is there some encryption/decryption to be done with password?

4. My USART Rx is correct

Thanks again for you time

Vigyanabikshu
 

My doubt is most of the meters as per my knowledge support ModBus-RTU protocol in your case I think you are using Modbus-ASCII protocol you need to do bit more exploration and make sure that the protocol that you are using is right....there is catch is 3.5 cycle idel time in the ModBus-RTU protocol thus you need to have that to be maintained. The second point is one need to have which register that you are using and what is the ID of the meter and what should be the default values of them work with some fixed value registers will help but.....you need to figure it out..

Good Luck

Milind
 

I contacted the manufacturer of the meter.
They are saying about some inverted signals to the meter is applied.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top