+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Junior Member level 2
    Points: 2,116, Level: 10
    Achievements:
    7 years registered

    Join Date
    Oct 2008
    Location
    KERALA, INDIA
    Posts
    22
    Helped
    5 / 5
    Points
    2,116
    Level
    10

    PIC and Modbus Energy Meter Interfacing

    Can somebody please suggest me to where to start from the PIC and ModBus energy meter interfacing?

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 3
    Points: 7,837, Level: 21
    milind.a.kulkarni's Avatar
    Join Date
    Oct 2011
    Location
    Bangalore
    Posts
    923
    Helped
    215 / 215
    Points
    7,837
    Level
    21
    Blog Entries
    1

    Re: 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....
    Hope the post will be helpful to you....
    "Sharing is the best way of Learning"


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Junior Member level 2
    Points: 2,116, Level: 10
    Achievements:
    7 years registered

    Join Date
    Oct 2008
    Location
    KERALA, INDIA
    Posts
    22
    Helped
    5 / 5
    Points
    2,116
    Level
    10

    Re: PIC and Modbus Energy Meter Interfacing

    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



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 3
    Points: 7,837, Level: 21
    milind.a.kulkarni's Avatar
    Join Date
    Oct 2011
    Location
    Bangalore
    Posts
    923
    Helped
    215 / 215
    Points
    7,837
    Level
    21
    Blog Entries
    1

    Re: PIC and Modbus Energy Meter Interfacing

    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 -
    http://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
    Hope the post will be helpful to you....
    "Sharing is the best way of Learning"



  5. #5
    Junior Member level 2
    Points: 2,116, Level: 10
    Achievements:
    7 years registered

    Join Date
    Oct 2008
    Location
    KERALA, INDIA
    Posts
    22
    Helped
    5 / 5
    Points
    2,116
    Level
    10

    Re: PIC and Modbus Energy Meter Interfacing

    Quote Originally Posted by milind.a.kulkarni View Post
    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 -
    http://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



    •   AltAdvertisement

        
       

  6. #6
    Advanced Member level 3
    Points: 7,837, Level: 21
    milind.a.kulkarni's Avatar
    Join Date
    Oct 2011
    Location
    Bangalore
    Posts
    923
    Helped
    215 / 215
    Points
    7,837
    Level
    21
    Blog Entries
    1

    Re: PIC and Modbus Energy Meter Interfacing

    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
    Hope the post will be helpful to you....
    "Sharing is the best way of Learning"



  7. #7
    Junior Member level 2
    Points: 2,116, Level: 10
    Achievements:
    7 years registered

    Join Date
    Oct 2008
    Location
    KERALA, INDIA
    Posts
    22
    Helped
    5 / 5
    Points
    2,116
    Level
    10

    Re: PIC and Modbus Energy Meter Interfacing

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



--[[ ]]--