首页 > 其他分享 >DLMS Activity Calendar CIMA / SIERRA

DLMS Activity Calendar CIMA / SIERRA

时间:2023-07-19 11:46:34浏览次数:32  
标签:profile passive used name day DLMS SIERRA Calendar Bit

www.daq-iot.com  [email protected]

__________________________________________________________

1.1 Activity Calendar

The activity calendar class is typically used to handle different tariffication structures. It is a definition of scheduled actions inside the meter, which follows the classical way of calendar based schedules. It can coexist with the more general COSEM class schedule and can even overlap with it (not used in CIMA). The activity calendar defines the activation of certain scripts (see COSEM class [id:9] Script Table), which can perform different activities inside the meter. CIMA / SIERRA: No real scripts are implemented in CIMA / SIERRA. Instead, the state of the 16 signals TOU1..TOU16 in Tariff Application (see  Tariff Application) are set.

This class has two calendar tables which are marked with the suffix “_active” and “_passive”. Their attributes are identical and therefore they are described only once in this document.

After a power failure, the TOU signals must be set to the current state as required by the calender. There is no need to run over all states that were due during the power failure.

The activity calendar allows references for special days as defined in Monitor Register.

Activity Calendar

0..1

Class_id=20, Version=0, OwnClassVersion=1

Attributes

Data Type

Min

Max

Def

1 Logical_name

(static)

octetstring

 

 

 

2 Calendar_name_active

(static)

octetstring

 

 

 

3 Season_profile_active

(static)

array

 

 

 

4 Week_profile_table_active

(static)

array

 

 

 

5 Day_profile_table_active

(static)

array

 

 

 

6 Calendar_name_passive

(static)

octetstring

 

 

 

7 Season_profile_passive

(static)

array

 

 

 

8 Week_profile_table_passive

(static)

array

 

 

 

9 day_profile_table_passive

(static)

array

 

 

 

10 ActivatePassiveCalendarTime

(static)

UTC

 

 

 

Specific Method(s)

m / o

 

11 activate_passive_calendar ()

 

 

Proprietary Attributes

 

 

 

 

12 OwnClassVersion

(const)

Unsigned8

 

 

1

13 IdString

(static)

octetstring

 

 

 

14 AttrVaaAccList

(static)

octetstring

 

 

 

15 EmergencyScript

(static)

struct

 

 

 

 

Attribute Description

The attributes with the suffix “_active” are those which are normaly used when the meter is in operation; attributes with the suffix “_passive” will be used after they are activated. Activation occurs when the current date equals or exceeds the commuting date (ActivatePassiveCalendarTime).

 

calendar_nameType: octetstring[8]

Typically contains an identifier, which is descriptive to the set of scripts which are activated by the object. This attribute is used by the firmware only for display and readout. If the activity calendar is included in the readout or display list, the active calendar_name will be displayed (also known as TOU id).

 

season_profileType: Array[12] of Season

Contains a list (array) defining seasons, classified by their starting dates. Each season has a reference to a table of weekly profiles. The season_profile list is sorted according to season_start: earlier dates come first. With this attribute, a calendar year is subdivided in seasons which differ by the week_profile they activate. Each element of the season_profile array is structured as follows:

 

 

Byte 1

Bytes 2  … Byte 13

Byte14

 

 

season_profile_name

season_start

week_name

 

 

season_profile_name Type: octetstring[1]

A octetstring containing a user defined name for identifying the current season_profile. This attribute is not used by the firmware. Implementation note: The name is restricted to 1 octet. The effective naming shall be resolved by another general mechanism applicable to all names assigned by the user to help identify the meaning of the objects.

season_start Type: UTC

Defines the date in UTC format when a season starts. The end of a season is given by the start of the next season. Implementation note: From the UTC data type only month and day are considered; the other elements are ignored by the firmware, and are read back as “undefined” (usually coded as 0xFF according to COSEM). Wild cards are not allowed for day and month.

UTC: octet-string { year highbyte, year lowbyte, month, day of month, day of week, hour, minute, second, hundredths, deviation, clock status }

 

Attribute

Type

Range

Coding / Remarks

year:

Unsigned16

 0..big, FFFF

not used. Read as 0xFFFF

month:

Unsigned8

 1..12

1 is January. Wild cards not allowed

dayOfMonth:

Unsigned8

 1..31

Wild cards not allowed

dayOfWeek:

Unsigned8

 1..7

not used. Read as 0xFF

hour:

Unsigned8

 0..23, 0xFF

not used. Read as 0xFF

minute:

Unsigned8

 0..59, 0xFF

not used. Read as 0xFF

second:

Unsigned8

 0..59, 0xFF

not used. Read as 0xFF

hundredths:

Unsigned8

 0..99, 0xFF

not used. Read as 0xFF

deviation

Integer16

-720 .. +720, 0x8000

not used. Read as 0x8000

clock status:

Unsigned8

 

not used. Read as 0xFF

Shaded fileds are ignored by the firmware, and are read back as “undefined”.

 

week_name Type: octetstring[1]

Used to set a reference to the corresponding week_profile selected for the present season. The name chosen must correspond to one given in week_profile_name of attribute week_profile_table. Implementation note: The name is restricted to 1 octet. The effective naming shall be resolved by another general mechanism applicable to all names assigned by the user to help identify the meaning of the objects.

 

week_profile_tableType: Array[12] of Week_profile

Contains an array holding the day_id for every day of the week that are used for different seasons. A day_id references an entry in the day_profile_table. Each array element of week_profile_table is structured as follows:

 

 

Byte 1

Byte 2

Byte 3

Byte 4

Byte 5

Byte 6

Byte 7

Byte 8

 

week_profile_name

monday

tuesday

wednesday

thursday

friday

saturday

sunday

 

Week_profile_name Type: octetstring [1]

Is a user defined name identifying the week profile and is used as link to the attribute season profile (week_name).

Monday .. sunday Type: Unsigned8

Contains a reference (day_id) to the day_profile (of the day_profile_table attribute) valid for the specified day of the week (Monday .. Sunday);

 

day_profile_tableType: Array[8] of Day_profile

Contains a list, arranged as an array, of day profiles with their corresponding identifiers. It is organized as follows:

 

 

1st array element

2nd array element

 

8th array element

day_profile_table

day_id

1st  day_profile

day_id

2nd day_profile

 

day_id

8th day_profile

 

day_id: Type: Unsigned8

Is a user defined byte identifying the corresponding day_profile and is used as a reference in the attribute week_profile_table.

day_profile: Type: array[10] of day_profile_action

Each day profile has a list of scripts and the corresponding activation times. Within each day_profile the list is sorted according to start_time. Implementation note: The first entry must start with start_time 00:00.

 

 

octetstring [4]

octetstring [6]

Unsigned16

 

day_profile

start_time

Script_logical_name

Script_selector

 

 

1st byte

 

last byte

 

 

start_time: Type: time

Specifies the time of day when scripts are executed. Time is an octet string whose format is defined by the COSEM time type [Ref. 2]. The internal resolution of the schedule is the minute, thus the seconds and hundredths are ignored and set to 00 (i.e. writing to these fields is disregarded and the values are read as 00). It is coded as follows:

octet-string {hour, minute, second, hundredths}

 

Attribute

Type

Range

hour:

Unsigned8

 0..23

minute:

Unsigned8

 0..59

second:

Unsigned8

Not used. Read as 00

hundredths:

Unsigned8

Not used. Read as 00

 

Implementation note: Entries have to be sorted by their time of occurrence: earlier entries first. The start time of the first entry of each day profile must always be 00:00. “Empty” or not used days must be placed at the end of the array.

 

script_logical_name: octetstring [6]

The script_logical_name is used as reference to select the desired script table from the Script Table class (not included in the present version of this document).

 

Implementation note: No real scripts are implemented in CIMA / SIERRA. Instead, the state of the 16 signals TOU1..TOU16 in Tariff Application is set using the script_selector below. The script_logical_name for all day_profiles is always the same and is set (fixed) to: 00 00 0A 00 64 FF. The firmware ignores the contents of the script_logical_name. Its value must be parameterised in the production to that value.

 

 

octetstring [6]

script_logical_name

00  00  0A  00  64  FF

 

1st byte last byte

 

script_selector: Unsigned16

Used to define the script identifier of the script to be executed.

Implementation note: As no real scripts are implemented in CIMA / SIERRA script_selector is used to define  the state of the 16 signals TOU1..TOU16 in Tariff Application.

Definition of the bits :

Bit 15

Bit 14

Bit 13

Bit 12

Bit 11

Bit 10

Bit 9

Bit 8

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

TOU16

TOU15

TOU14

TOU13

TOU12

TOU11

TOU10

TOU9

TOU8

TOU7

TOU6

TOU5

TOU4

TOU3

TOU2

TOU1

 

ActivatePassiveCalendarTimeType: UTC

Defines the time when the object itself activates the passive calendar.

Implementation notes:

  • COSEM defines the switching from passive to active by copying the values of all attributes with suffix “_passive” to the attributes with suffix “_active”. The firmware does not do the described copy process due to the large amount of EEPROM data involved. Instead, it only switches pointers from passive to active and vice versa. Because of this, the behaviour is not exactly the same but fulfills the requirement.
  • From the UTC data type only year, month and day are evaluated by the firmware; all other elements (DayOfWeek, hour, minute, second, hundredths, deviation and clock_status) are ignored.
  • the method activate_passive_calendar(data) which is normally used to activate the passive calendar will not be implemented. Immediate activation can be achieved by setting the value of ActivatePassiveCalendarTime to a date in the past.
  • The firmware has a mechanism to internally avoid unwanted switching from passive to active. This mechanism is implemented with a flag that definines whether the attribute ActivatePassiveCalendarTime is enabled. When the flag is set and the date equals the value of active_passive_calender_time then the passive values will become the active values and the flag is cleared. The following rules apply to control the flag:
    • The flag will be cleared on writing to any attribute with suffix _passive.
    • The flag will be cleared after activating the passive values.
    • The flag will be cleared after writing a value with the "not specified" notation (0xFF) in any of the considered UTC fields of active_passive_calender_time.
    • The flag will be set after writing a valid value to active_passive_calendar_time (valid means without “not specified” in the considered UTC fields). If setting a new passive calendar, this attribute hence must be written last.

When the flag is set, the firmware compares active_passive_calender_time against the system time on the following cases:

  • after a day overflow (every day at 00:00)
  • after a power up
  • after writing a valid value to active_passive_calendar_time.

If the current date equals or exceeds the value of active_passive_calender_time, then the passive values will become the active values (and the flag will be cleared).

After activating a passive calendar, all _passive attributes will be set to “array of 0 elements”, and the ActivatePassiveCalendarTime will return all octets as “undefined” (mostly 0xFF; see UTC definition in season_start above).

 

EmergencyScriptType: struct

EmergencyScript is used to define the script which is executed in case that the internal clock is not operating (e.g. due to lost of power of the clock system), or if there is an invalid entry in the activity calendar. Once the problem ceases, the scripts are executed from the corresponding day_profile. EmergencyScript contains the the logical name of the script and the script to be executed. This information is organized in a struct with two elements: Script_logical_name and Script_selector.  

 

 

octetstring [6]

Unsigned16

 

 

Script_logical_name

Script_selector

 

 

 

 

 

 

script_logical_name: octetstring [6]

The script_logical_name is used as reference to select the desired script table from the Script Table class (not included in the present version of this document).

 

Implementation note: No real scripts are implemented in CIMA / SIERRA. Instead, the state of the 16 signals TOU1..TOU16 in Tariff Application is set using the script_selector below. The script_logical_name is equal to that of day_profiles and is always the same, set (fixed) to: 00 00 0A 00 64 FF. The firmware ignores the contents of the script_logical_name. Its value must be parameterised in the production to that value.

 

 

octetstring [6]

script_logical_name

00  00  0A  00  64  FF

 

1st byte last byte

 

script_selector: Unsigned16

Used to define the script identifier of the script to be executed.

Implementation note: As no real scripts are implemented in CIMA / SIERRA script_selector is used to define  the state of the 16 signals TOU1..TOU16 in Tariff Application.

Definition of the bits :

Bit 15

Bit 14

Bit 13

Bit 12

Bit 11

Bit 10

Bit 9

Bit 8

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

TOU16

TOU15

TOU14

TOU13

TOU12

TOU11

TOU10

TOU9

TOU8

TOU7

TOU6

TOU5

TOU4

TOU3

TOU2

TOU1

标签:profile,passive,used,name,day,DLMS,SIERRA,Calendar,Bit
From: https://www.cnblogs.com/DAQ-IOT/p/17565167.html

相关文章

  • 2023年7月13日,Stream流,Stream流的获取,Stream流中间聚合操作,Stream流终结操作,Calendar
    Stream流1.单列集合的Stream流获取packagecom.wz.stream01;importjava.util.Arrays;importjava.util.HashSet;importjava.util.List;importjava.util.function.Consumer;importjava.util.function.Predicate;importjava.util.stream.Stream;publicclassstreamDe......
  • python: calendar
     importcalendaryy=int(input("请输入年份:"))calendar.setfirstweekday(firstweekday=0)#为了符合习惯,指定日历的第一天是星期一calendar.prcal(yy,w=0,l=0,c=0,m=4)#显示日历,c=0为一周的第一天为星期一,与上面对应结果:#倒计时nowtime......
  • 使用java中的Calendar遇到的时区问题
    项目中有一个增加1小时的工具函数结果今天测试出现了一个问题原因是1986年的9月13号到14号之间会有一个时区的转换需要程序特殊处理下这是原函数的结果SatSep1322:00:00CDT1986SatSep1323:00:00CDT1986SatSep1323:00:00CST1986SunSep1400:0......
  • 【每日一题】Problem 331C1. The Great Julya Calendar
    原题解决思路寻求减到0所需的最小次数,即\(Num(n)\RightarrowNum(n-x)+1\)当存在一个x使得(n-x)%10=0时,那么(n-x)到下一次个位为0时至少需要两次,即该过程至少需要3次如果存在一个x'>x,那么上述过程可以简化到至少需要2次一般情况下,当n中的前面一段(百位......
  • 传统时间:Calendar
         ......
  • 3.3. 日期与时间类(Date、Calendar、LocalDate等)
    在Java中,我们经常需要处理日期和时间。Java提供了一些类来帮助我们完成这些任务,如Date、Calendar、LocalDate、LocalTime、LocalDateTime和ZonedDateTime等。我们将分别介绍这些类,并给出相应的示例。1.Date类Date类是Java提供的一个表示日期和时间的类。但是,由于设计上的缺陷,许......
  • 不推荐使用Date日期和Calendar日期
    很神奇,为什么java中不推荐使用Date与Calendar日期了,很多时候初学者在刚学习java时,大部分使用的日期都是Date与Calendar,只有及少数个别使用的LocalDateTime日期Date与Calendar存在的共性问题毫秒值与日期直接转换麻烦和繁琐,然后通过毫秒值来计算时间的差额步骤较多,并且......
  • Date 和 Calendar
    //在Java平台首次发布时,它唯一支持日历计算类的就是Date类。//这个类在能力方面是受限的,特别是当需要支持国际化时,它就暴露出了一个基本的设计缺陷:Date 实例是易变的。//在1.1版中,Calendar类被添加到了Java平台中,以矫正Date的缺点,由此大部分的Date方法就都被弃用了。//Date......
  • POJ 2080 Calendar
    题目链接:http://poj.org/problem?id=2080题目不是很难,也没什么说的,直接看代码吧:#include<iostream>#include<stdio.h>usingnamespacestd;intyear(intm){ if(m%4==0&&m%100!=0||m%400==0) return1; else return0;}intmain(){ intn,i,j......
  • angular中使用full-calendar
    版本信息"@fullcalendar/angular":"^5.11.0","@fullcalendar/common":"^5.11.0","@fullcalendar/core":"^5.11.0","@fullcalendar/daygrid":"^5.11.0","@ful......