Accessing Schneider PM810MG via Modbus RTU

Forum Home Forums Communicating with Devices Modbus Accessing Schneider PM810MG via Modbus RTU

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8019
    Avatarkumajaya
    Participant

    Device template:

    <?xml version="1.0" encoding="utf-8"?>
    <DevTemplate>
      <Settings>
        <ZeroAddr>true</ZeroAddr>
        <DecAddr>true</DecAddr>
        <DefByteOrder2 />
        <DefByteOrder4 />
        <DefByteOrder8 />
      </Settings>
      <ElemGroups>
        <ElemGroup active="true" tableType="InputRegisters" address="1104" name="Current">
          <Elem name="Average Current" type="ushort" byteOrder="" />
        </ElemGroup>
        <ElemGroup active="true" tableType="InputRegisters" address="1122" name="Voltage LL">
          <Elem name="Average Voltage LL" type="ushort" byteOrder="" />
        </ElemGroup>
        <ElemGroup active="true" tableType="InputRegisters" address="1127" name="Voltage LN">
          <Elem name="Average Voltage LN" type="ushort" byteOrder="" />
        </ElemGroup>
        <ElemGroup active="true" tableType="InputRegisters" address="1142" name="Power">
          <Elem name="Total Power" type="ushort" byteOrder="" />
        </ElemGroup>
        <ElemGroup active="true" tableType="InputRegisters" address="1179" name="Frequency">
          <Elem name="Frequency" type="ushort" byteOrder="" />
        </ElemGroup>
        <ElemGroup active="true" tableType="InputRegisters" address="1699" name="Energy">
          <Elem name="Energy" type="ulong" byteOrder="67452301" />
        </ElemGroup>
      </ElemGroups>
      <Cmds />
    </DevTemplate>

    Formula to convert energy register based on https://www.se.com/id/en/faqs/FA212766/ info:
    double Mod10(double val) {
    ulong v = Convert.ToUInt64(val);
    return ((v >> 48) * 1000000000000) + (((v >> 32) & 0xFFFF) * 100000000) + (((v >> 16) & 0xFFFF) * 10000) + (v & 0xFFFF);
    }


    @Mikhail
    Am I doing right? Or is there a better solution?

    #8024
    MikhailMikhail
    Moderator

    Who are crazy authors of such algorithms…

    Please scroll down this Russian version the article, there is a formula:

    double Convert(double x)
    {
        return x<32768 ? x*760/32767 : -(double)(ushort)(~(ushort)x|128+1)*210/9182;
    }

    May be it can be example.
    To be honest, I didn’t understand Mod10 calculations. If you change your question to something more specific, what calculation do you need, I’ll try to help.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.