DNP3 Object 40 from Reef

60 views
Skip to first unread message

Adam Todorski

unread,
Sep 22, 2012, 1:31:26 PM9/22/12
to reef-...@googlegroups.com
Hi All,

I'm having difficulty understanding how to get Reef to produce setpoint status objects through the DNP3 protocol connector.  Specifically I want the underlying DNP3 medium to produce object 40 analog outputs for setpoints configured by object 41 events.  If someone could point me in the right direction or show me a config snippet that accomplishes this I'd appreciate it.

Thanks!
Adam

Daniel Evans

unread,
Sep 23, 2012, 11:01:59 AM9/23/12
to reef-...@googlegroups.com
Hi Adam,

To clarify, I take it you are using the Reef DNP3 protocol adapter as a DNP3 slave to export data out of Reef to an external DNP3 master and accept setpoints from it?

Daniel
--

Daniel Evans

Software Engineer

Green Energy Corp

(919) 836-9916

dev...@greenenergycorp.com

 

Transforming the Smart Grid

www.greenenergycorp.com

 


Adam Todorski

unread,
Sep 23, 2012, 1:06:19 PM9/23/12
to reef-...@googlegroups.com

Hi Daniel,

That is correct.

Adam

Daniel Evans

unread,
Sep 23, 2012, 1:46:32 PM9/23/12
to reef-...@googlegroups.com
The short version: what you're trying to do is possible but not as simple as it should be.

The Reef DNP3 slave adapter actually fills opposite role from normal Reef protocol adapters: it subscribes to measurement updates and and handles command requests. The command request handling performs no logic inside the adapter itself, it just pushes the command request onto the message bus. Therefore, to have logic that actually responds to the command requires another bus component to be subscribing to the slave adapter's configured set of commands and responding to them. In your case that would involve taking the setpoint value and pushing it immediately into the corresponding Reef measurement value, where it would be picked up once again by the DNP3 slave adapter.

The simplest way to add such a component (one that accepts command requests and publishes measurements) would actually be by implementing a Reef protocol, because the protocol framework handles the details of addressing. An example of doing so is here: 


Obviously, this is a  round-about way to do something that's conceptually very simple, and in fact the new component/protocol to do this would end up being reusable. Immediately translating setpoint statuses into measurement updates ought to be treated as a special case and handled by the slave adapter. At the moment this isn't supported. I've created a ticket for this feature:


Daniel

Adam Todorski

unread,
Sep 23, 2012, 5:05:56 PM9/23/12
to reef-...@googlegroups.com

Thanks, Daniel. That is helpful. I had actually tried an experiment republishing measurements for the setpoints that I wanted to feed back, but I couldn't get it to generate object 40 responses to integrity scans. Is this a configuration issue for the points imn question maybe?

Daniel Evans

unread,
Sep 23, 2012, 5:22:38 PM9/23/12
to reef-...@googlegroups.com
In the DNP3 Slave XML, you can set the group/var to respond with for setpoint statuses in the SlaveConfig/StaticRsp element. If that's set and you have indexes configured to be setpoint statuses, I would expect it to respond correctly.

Daniel

Adam Todorski

unread,
Sep 23, 2012, 7:32:58 PM9/23/12
to reef-...@googlegroups.com
I had tried that, but was only able to get it to give me object 30 variants.  Maybe I have the wrong syntax:

In my Reef endpoint config:

        <eq:equipment name="XXX">
                <eq:equipment name="YYY">
                        <eq:analog name="XXXSetpointFeedback" unit="kW" />
                        <eq:setpoint name="XXXSetpoint" setpointType="integer" />
                </eq:equipment>
        </eq:equipment>
...
        <cm:endpoint name="XXX" >
            <cm:protocol name="dnp3-slave">
                <common:configFile fileName="slave.xml" />
            </cm:protocol>
            <cm:interface name="DNPIn" ip="10.0.0.2" port="10000" network="any" serverSocket="true"/>
            <cm:equipment name="XXXSite">
                <cm:equipment name="XXXEp">
                        <cm:analog name="XXXSetpointFeedback" unit="kW" index="10" />
                        <cm:setpoint name="XXXSetpoint" index="10" unit="kW" >
                                <cm:optionsDnp3 type="SETPOINT" onTime="1000" offTime="1000" count="1" />
                        </cm:setpoint>
                </cm:equipment>
            </cm:equipment>
        </cm:endpoint>

In my DNP3 slave config:

...
        <StaticRsp>
            <SetpointStatusGrpVar Grp="40" Var="1" />
        </StaticRsp>
        <EventRsp>
            <SetpointStatusGrpVar Grp="41" Var="1" />
        </EventRsp>
...

I feel like I'm missing something simple, as there's code in the inbuilt DNP3 adapter to (I think) do what I want:

SlaveXmlConfig.scala:55

      val name = e.getPointName
      e.getType match {
        case DataType.ANALOG => dt.getMAnalog.add(new DeadbandPointRecord(name, pointClass, 0.0))
        case DataType.BINARY => dt.getMBinary.add(new EventPointRecord(name, pointClass))
        case DataType.COUNTER => dt.getMCounter.add(new EventPointRecord(name, pointClass))
        case DataType.CONTROL_STATUS => dt.getMControlStatus.add(new PointRecord(name))
        case DataType.SETPOINT_STATUS => dt.getMSetpointStatus.add(new PointRecord(name))
        case _ => throw new RuntimeException("unknown meas type")

Daniel Evans

unread,
Sep 24, 2012, 6:07:58 PM9/24/12
to reef-...@googlegroups.com
The problem is in the fact that your points in the Reef XML config (i.e. "XXXSetpointFeedback") are "Analog" and analogs are always mapped in the XML loader to DNP3 analog points.

You can see the implementation code here:

https://github.com/gec/reef/blob/master/loader-xml/src/main/scala/org/totalgrid/reef/loader/CommunicationsLoader.scala#L614 

The bad news is the XML loader doesn't currently support mapping Reef points to DNP3 control statuses or setpoint statuses. I've opened a ticket: 


Daniel

Jennifer Worrall

unread,
May 6, 2014, 8:48:04 PM5/6/14
to reef-...@googlegroups.com
Hi there!  Opening up an old can of worms here.  If I am understanding this correctly, there is no way to read in a value from a setpoint with REEF currently?  Our RTU is the DNP3 master for a device and uses AnalogOutput/setpoints to control the device.  I need to see what it does from a supervisory control standpoint. I don't see any movement on the ticket, but was it fixed in a later version or maybe I'm misinterpreting this question (crossing fingers)?

Daniel Evans

unread,
May 7, 2014, 9:42:13 AM5/7/14
to reef-...@googlegroups.com
Jennifer,

This has been fixed in the 0.6.x branch. Mappings are no longer inferred from "binary/analog/counter". Setpoint statuses and control statuses can be mapped directly to any point of your choice.

This question applies specifically to DNP3 configurations that use the setpoint/control status data types (one of the 5 core DNP types) to provide the current value (the most recent input) for controls or setpoints that do not have sufficient representation in the binary/analog/counter types. It doesn't affect the issuing of setpoints/controls.


On Tue, May 6, 2014 at 8:48 PM, Jennifer Worrall <jennifer....@gmail.com> wrote:
Hi there!  Opening up an old can of worms here.  If I am understanding this correctly, there is no way to read in a value from a setpoint with REEF currently?  Our RTU is the DNP3 master for a device and uses AnalogOutput/setpoints to control the device.  I need to see what it does from a supervisory control standpoint. I don't see any movement on the ticket, but was it fixed in a later version or maybe I'm misinterpreting this question (crossing fingers)?

--
You received this message because you are subscribed to the Google Groups "Reef Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reef-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jennifer Worrall

unread,
May 7, 2014, 12:03:25 PM5/7/14
to reef-...@googlegroups.com
Is the 0.6.x branch stable / available at this point?  I didn't see anything in Github or the Artifactory repository.

I know the 0.6 branch is significantly different from the 0.5 branch.  Is this a fix that could be ported backwards (by me) or will I need to wait to use 0.6?  This is unfortunately a show stopper for us, so I will have to get creative soon.

Thanks!


Daniel Evans

unread,
May 8, 2014, 5:52:53 PM5/8/14
to reef-...@googlegroups.com
The problem is with the XML schema itself and the way the loader creates the DNP mapping. It creates a ConfigFile for every DNP endpoint that uses the IndexMapping proto (you can see in MeasurementMapping.proto). This proto has the ability to support control and setpoint statuses, but the loader doesn't use them--mainly because it tries to infer the type from the Reef point type (binary/analog/counter) and there was no way to infer an analog was a setpoint status as opposed to a DNP analog input. 

One fix would be to modify the loader xml schema to provide some way to specify if a Reef point should be mapped to a DNP setpoint status. A hack to fix the problem would be the get the ConfigFile, change the contents of the IndexMapping, and upload it back.

Reef 0.6 deprecates index mapping in the communication model in favor of protocol-specific mapping files, however the APIs to do loading have changed and 0.6.x is not yet stable and still on a private branch for the moment.



--
You received this message because you are subscribed to the Google Groups "Reef Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reef-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages