Getting outstation to respond to Group50Var1

204 views
Skip to first unread message

Wayne Johnson

unread,
Nov 23, 2016, 10:51:02 AM11/23/16
to automatak-dnp3
My Master code is polling the outstation for:
ms(166535798) <-AL--  CBC-8024 - 050,001 - Time and Date - Absolute Time - all objects
ms(166535800) <-AL--  CBC-8024 - 060,002 - Class Data - Class 1 - all objects
ms(166535802) <-AL--  CBC-8024 - 060,003 - Class Data - Class 2 - all objects
ms(166535804) <-AL--  CBC-8024 - 060,004 - Class Data - Class 3 - all objects
ms(166535806) <-AL--  CBC-8024 - 060,001 - Class Data - Class 0 - all objects

How do I write a MeasUpdate to set the proper time.  What I have is:

    MeasUpdate tx(dnp->outstations[device->deviceId]);
    DNPTime time(std::time(nullptr));
    TimeAndInterval ti(time, 0, 0);
    tx.Update(ti, 0);

But that seems to generate:

ms(166776039) --AL->  CBC-8024 - 050,004 Time and Date - Indexed absolute time and long interval, 8-bit start stop [0, 0]

Thanks for any help you can give.

J Adam Crain

unread,
Nov 23, 2016, 10:53:44 AM11/23/16
to automatak-dnp3
Hi Wayne,

The master supports receiving g50v1, but the outstation does not support reading them.

We'd have to add support for this. I think it would be most natural to add a method to IOutstationApplication allowing the user to control what time the outstation reports.

-Adam

Wayne Johnson

unread,
Nov 23, 2016, 4:39:28 PM11/23/16
to automatak-dnp3
OK, so I have DatabaseBuffers::Load generating a single Group50Var1 element in the output when we've received a read with Group50Var1 (really don't know what I'm doing here, so correct me if I'm wrong).

I'm assuming that there should only be one Group50Var1 element returned, so I'm not burring it in the LoadFun functions lambda.  As I read the spec, it looks like there is only one value to send/receive.

The next problem I'm running into is trying to connect to the pApplication object (to use a yet to be added overload in IOutstationApplication to control the source (if any) of the time, much like SupportsWriteAbsoluteTime() and WriteAbsoluteTime() do.  Should I poke the address of pApplication into the HeaderWriter somewhere up the stack?  Preferences as to where?

J Adam Crain

unread,
Nov 23, 2016, 5:33:53 PM11/23/16
to automatak-dnp3
Hi Wayne,

I wouldn't try to do this via the DatabaseBuffers. g50v1 doesn't have an "index". There's only one time per outstation. We should just be able to have a single flag somewhere that gets set when the time is requested, and cleared when the value is reported.

Let me go refresh my memory and I'll try to figure out the best way to add this.

-Adam

Wayne Johnson

unread,
Nov 23, 2016, 6:05:55 PM11/23/16
to J Adam Crain, automatak-dnp3
That's pretty much what I have, but at the level of DataBuffers.  Let me see if I can move it up a bit.
 
---
Wayne Johnson,             | There are two kinds of people: Those
                           | who say to God, "Thy will be done,"
                           | and those to whom God says, "All right,
                           | then, have it your way." --C.S. Lewis



From: J Adam Crain <jadam...@gmail.com>
To: automatak-dnp3 <automat...@googlegroups.com>
Sent: Wednesday, November 23, 2016 4:33 PM
Subject: [opendnp3] Re: Getting outstation to respond to Group50Var1

J Adam Crain

unread,
Nov 25, 2016, 12:27:22 PM11/25/16
to automatak-dnp3, jadam...@gmail.com, wd...@yahoo.com
In ReadHandler.cpp, we have the concepts of IStaticSelector and IEventSelector. Then in ResponseContext we have (staticLoader IResponseLoader&, eventLoader& IResponseLoader).

g50v1 is "informational", so I think we need corresponding IInfoSelector and a loader for informational type objects.

The response context could implement IInfoSelector, and then just have the flag internally.

-Adam




On Wednesday, November 23, 2016 at 6:05:55 PM UTC-5, Wayne Johnson wrote:
That's pretty much what I have, but at the level of DataBuffers.  Let me see if I can move it up a bit.
 
---
Wayne Johnson,             | There are two kinds of people: Those
                           | who say to God, "Thy will be done,"
                           | and those to whom God says, "All right,
                           | then, have it your way." --C.S. Lewis



From: J Adam Crain <jadam...@gmail.com>
To: automatak-dnp3 <automatak-dnp3@googlegroups.com>

Wayne Johnson

unread,
Nov 28, 2016, 10:15:46 AM11/28/16
to J Adam Crain, automatak-dnp3
Ok, found the code you referred to. I had considered putting the changes there before, but figured it would be easier elsewhere.

I'm looking at adding this code to DatabaseBuffers.cpp:

++        case(GroupVariation::Group50Var1):
 ++           return this->SelectAllUsing<AbsoluteTime>(StaticAbsoluteTimeVariation::Group50Var1);
        case(GroupVariation::Group50Var4):
            return this->SelectAllUsing<TimeAndInterval>(StaticTimeAndIntervalVariation::Group50Var4);

Problem is, I'll have to create a StaticAbsoluteTimeVariation.  In looking at StaticTimeAndIntervalVariation (is this really a Static), I noticed the header has:

// This file is auto-generated. Do not edit manually

Is there a master configuration file somewhere that needs to be changed to create this new StaticAbsoluteTimeVariation class?
 
---
Wayne Johnson,             | There are two kinds of people: Those
                           | who say to God, "Thy will be done,"
                           | and those to whom God says, "All right,
                           | then, have it your way." --C.S. Lewis



From: J Adam Crain <jadam...@gmail.com>
To: automatak-dnp3 <automat...@googlegroups.com>
Cc: jadam...@gmail.com; wd...@yahoo.com
Sent: Friday, November 25, 2016 11:27 AM
Subject: Re: [opendnp3] Re: Getting outstation to respond to Group50Var1

Wayne Johnson

unread,
Nov 29, 2016, 12:37:30 PM11/29/16
to automatak-dnp3
Well, I started on these changes, but unfortunately my contract is coming to an end tomorrow.  I'll turn over what I have to my successor and let him work on it.

It's been great working with you folks.  If I ever get into a position that uses DNP3 again, I'll be back.

Thanks.

J Adam Crain

unread,
Nov 29, 2016, 12:47:40 PM11/29/16
to automatak-dnp3
Ok, best of luck on your next contract Wayne.

Be sure to let the organization know that they can always contract features as well.

Cheers,
Adam
Reply all
Reply to author
Forward
0 new messages