Questions about 'UpdateBuilder::FreezeCounter'

103 views
Skip to first unread message

Jensen

unread,
Jan 30, 2021, 12:04:14 PM1/30/21
to opendnp3
Hello all,

I found that OUTSTATION 3.x.x version UpdateBuilder has a 'FreezeCounter' method (not in 2.x.x version). Does this method use OUTSATION to execute this command to freeze without MASTER triggering?

I use 'UpdateBuilder::FreezeCounter' in OUTSTATION to freeze the value of the specified index and read it through MASTER, but I send the function code IMMED_FREEZE through MASTER, and then read the value of FrozenCounter, but there is still no change. I am confused about this.
微信截图_20210129135829.png

BR

Ovidiu Adam

unread,
Feb 2, 2022, 1:37:08 PM2/2/22
to opendnp3
Hi all,

I am also confused about how Frozen Counters should be implemented by the Outstation.
Can anyone please explain when should the Outstation application call the UpdateBuilder::FreezeCounter  method? 
Based on the below declaration, I understand the UpdateBuilder::FreezeCounter()  freezes and maybe clears (resets?) a counter.  How is the counter unfrozen after that?
    /**
     * Freeze a Counter measurement
     * @param index index of the measurement
     * @param clear clear the original counter
     * @param mode Describes how event generation is handled for this method
     * @return true if the value exists and it was updated
     */
    virtual bool FreezeCounter(uint16_t index, bool clear = false, EventMode mode = EventMode::Detect) = 0;

DatabaseConfig::DatabaseConfig(uint16_t all_types)
{
...
initialize(this->counter, all_types);  
initialize(this->frozen_counter, all_types);
...
};  
initializes a collection of this->frozen_counter  ,   which I assume must match (same size and same indexes)  as the associated collection of counters. 

What values get loaded in the collection of frozen_counter?  who loads them?  when?   and how? 

Does the Opnednp3_3.x_3.0.1  library implement the IMMED_FREEZE  request?  How?
If so how does the library address the conflict between the IMMED_FREEZE  request  and the UpdateBuilder::FreezeCounter () call from the Outstation application?

Thank you,
Ovidiu Adam

Parker McCauley

unread,
Feb 5, 2022, 9:03:36 AM2/5/22
to Ovidiu Adam, opendnp3
Each frozen counter has a running counter associated with it. When you issue a freeze command from the master the outstation copies the current value of the running counter into the frozen value and then marks the frozen counter as having “changed”. In this case the “change” is determined/generated from the freeze command /event and not the value of the counter changing.

Think of an electric meter on your house with a mechanical spinning wheel that monitors and measured energy usage and each revolution increments a counter. Consider that this corresponds to a unit of measurement (KW for example) and the master issues a freeze once an hour. The result would be the amount of energy used over the last hour. A freeze and clear command would clear the running counter and start accumulating again from zero, where as an immediate freeze command will capture the current count (master will do the delta calculation of appropriate)

Counters and controls are a bit messy. Westronics, the now defunct company (bought by Harris and then bought by GE) was a RTU vendor so it was in their best interest to be able to support all of the counter and control models they had run across which is why there are so many variations (most it which accomplish the same thing)

I hope this helps.

Cheers,

-Parker 

-Parker
_________________________
Charles “Parker” McCauley
cell    :   906.440.2746

From: automat...@googlegroups.com <automat...@googlegroups.com> on behalf of Ovidiu Adam <ovidi...@gmail.com>
Sent: Wednesday, February 2, 2022 1:37:08 PM
To: opendnp3 <automat...@googlegroups.com>
Subject: [opendnp3] Re: Questions about 'UpdateBuilder::FreezeCounter'
 
--
You received this message because you are subscribed to the Google Groups "opendnp3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automatak-dnp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automatak-dnp3/5b3ec478-6151-4252-94b9-41a5411e5bb7n%40googlegroups.com.

Ovidiu Adam

unread,
Feb 7, 2022, 7:32:03 PM2/7/22
to opendnp3
Hi Parker, - thanks for the overview.

I seem to have eventually found answers to my specific questions, and I now have an idea on how the   OUTSTATION 3.x.x  implements the Frozen Counters.

I am now able to use 'UpdateBuilder::FreezeCounter' in OUTSTATION to freeze the value of the specified index and read it through MASTER, just like Jensen describes, but it seems to me that the OUTSTATION 3.x.x version  does not process  IMMED_FREEZE requests from master.  Is that true? 

Ovidiu

Émile Grégoire

unread,
Feb 7, 2022, 8:15:02 PM2/7/22
to opendnp3
Hi,

OpenDNP3 3.x does support IMMED_FREEZE (0x07). There's a test case here: https://github.com/dnp3/opendnp3/blob/132f2fdb62ad9325efa8293fb122800ee2476aa2/cpp/tests/unit/TestOutstationFrozenCounters.cpp#L108-L111 and it is also tested by the conformance tests here: https://dnp3.github.io/conformance/8.16.2.2.2/log.html

As Parker explained, it will copy the current value of the counter(s) into their frozen counter(s) equivalent, leaving the original counter untouched.

Émile Grégoire, P. Eng.
Step Function I/O
Reply all
Reply to author
Forward
0 new messages