Skip to main content
Home
for DLMS smart meters

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
  • Gurux Club
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Activity calendar
gxdn
Profile picture for user Administrator
By Administrator, 23 January, 2018
Activity calendar is used to handle tariff structures in the meter.

Properties

  • 1. Logical Name
    Logical name of the object.
  • 2. Calendar name active
    Active calendar name
  • 3. Season profile active
    Season profile defines seasons when Week profile table is called.
  • 4.Week profile table active
    Week profile table defines week days when given Day profile table is executed.
  • 5. Day profile table active
    Day profile table defines executed script and time when it's executed.
    Writing an active table directly is not allowed. Write new settings for the passive day profile and then activate the new profile with Activate passive calendar -action.
  • 6. Calendar name passive
    Passive calendar name
  • 7. Season profile passive Season profile defines seasons when Week profile table is called.
  • 8.Week profile table passive
    Week profile table defines week days when given Day profile table is executed.
  • 9. Day profile table passive
    Day profile table defines executed script and time when it's executed.

Actions

  • 1. Activate passive calendar
    Copy all passive calendar targets to active.

Access data from ANSI C

  • Season Profile
  • Week Profile
  • Day Profile
  • Passive calendar
//How to loop through all active season profiles.
int pos;
gxSeasonProfile* it;
gxActivityCalendar* ac = (gxActivityCalendar*)object;
for (pos = 0; pos != ac->seasonProfileActive.size; ++pos)
{
    ret = arr_getByIndex(arr, pos, (void**)& it);
    if (ret != DLMS_ERROR_CODE_OK)
    {
        return ret;
    }
    printf("Name: %.*s\n", it->name.size, it->name.data));
    time_print(it->start);
    printf("Name: %.*s\n", it->weekName.size, it->weekName.data));
}
//How to loop through all active week profiles.
int pos;
gxActivityCalendar* ac = (gxActivityCalendar*)object;
gxWeekProfile* it;
int pos, ret;
for (pos = 0; pos != ac->weekProfileTableActive->.size; ++pos)
{
    ret = arr_getByIndex(arr, pos, (void**)& it);
    if (ret != DLMS_ERROR_CODE_OK)
    {
        return ret;
    }
    printf("Name: %.*s\n", it->name.size, it->name.data));
    printf("Monday: %d\n", it>monday);
    printf("Tuesday: %d\n", it>tuesday);
    printf("Wednesday: %d\n", it>wednesday);
    printf("Thursday: %d\n", it>thursday);
    printf("Friday: %d\n", it>friday);
    printf("Saturday: %d\n", it>saturday);
    printf("Sunday: %d\n", it>sunday);
}
//How to loop through all active day profiles.
int pos;
gxActivityCalendar* ac = (gxActivityCalendar*)object;
gxDayProfile* dp;
gxDayProfileAction *it; 
int pos, pos2, ret;
for (pos = 0; pos != ac->dayProfileTableActive.size; ++pos)
{
    ret = arr_getByIndex(arr, pos, (void**)&dp);
    if (ret != DLMS_ERROR_CODE_OK)
    {
        return ret;
    }
    printf("DayId: %d\n", dp-> dayId);
    for (pos2 = 0; pos2 != dp->daySchedules.size; ++pos2)
    {
        ret = arr_getByIndex(& dp-> daySchedules, pos2, (void**)&it);
        if (ret != DLMS_ERROR_CODE_OK)
        {
            return ret;
        }
        printf("Logical name: %.*s\n", it->scriptLogicalName.size, it->scriptLogicalName.data));
        printf("%d\n"it - > scriptSelector);
        time_print(it->startTime);
    }
}

gxDayProfile* dp;
gxSeasonProfile* sp;
gxWeekProfile* wp;
gxDayProfileAction* act;
int ret;
const unsigned char ln[6] = { 0,0,13,0,0,255 };
if ((ret = cosem_init2((gxObject*)&activityCalendar, DLMS_OBJECT_TYPE_ACTIVITY_CALENDAR, ln)) == 0)
{
    bb_addString(&activityCalendar.calendarNamePassive, "Passive");
    sp = (gxSeasonProfile*)malloc(sizeof(gxSeasonProfile));
    bb_init(&sp->name);
    bb_addString(&sp->name, "Winter time");
    time_init(&sp->start, -1, 10, 30, 1, 0, 0, -1, -1);
    bb_init(&sp->weekName);
    arr_push(&activityCalendar.seasonProfilePassive, sp);
    //Add week profile.
    wp = (gxWeekProfile*)malloc(sizeof(gxWeekProfile));
    bb_init(&wp->name);
    bb_addString(&wp->name, "Tuesday");
    wp->monday = wp->tuesday = wp->wednesday = wp->thursday = wp->friday = wp->saturday = wp->sunday = 1;
    arr_push(&activityCalendar.weekProfileTablePassive, wp);

    //Add day profile.
    dp = (gxDayProfile*)malloc(sizeof(gxDayProfile));
    arr_init(&dp->daySchedules);
    dp->dayId = 1;
    act = (gxDayProfileAction*)malloc(sizeof(gxDayProfileAction));
    time_init(&act->startTime, -1, -1, 1, 1, 0, 0, -1, -1);
    act->script = BASE(actionSchedule);
    act->scriptSelector = 1;
    arr_push(&dp->daySchedules, act);
    arr_push(&activityCalendar.dayProfileTablePassive, dp);
}

Book traversal links for Activity calendar

  • Gurux.DLMS.Objects
  • Up
  • Association Logical Name
  • Create new account
  • Reset your password

Book navigation

  • Activity calendar
  • Association Logical Name
  • Auto Connect
  • Auto answer
  • Clock
  • Compact data
  • Data
  • Demand register
  • Disconnect control
  • Extended register
  • GPRS modem setup
  • GSM diagnostic
  • IEC HDLC setup
  • IEC local port setup
  • IPv4 setup
  • IPv6 setup
  • Image transfer
  • Limiter
  • M-Bus Client
  • M-Bus master port setup
  • M-Bus slave port setup
  • MAC address setup
  • Modem configuration
  • PPP setup
  • Profile generic
  • Push Setup
  • Register
  • Register Monitor
  • Register activation
  • Register table
  • SAP assignment
  • Script table
  • Security setup
  • Single action schedule
  • Special days table
  • Status mapping
  • Tcp Udp Setup
  • Utility tables

Hire Us!

Latest Releases

Fri, 03/24/2023 - 14:22
gurux.dlms.c 20230324.1
Thu, 03/23/2023 - 11:01
GXDLMSDirector 9.0.2303.2301
Thu, 03/23/2023 - 09:10
Gurux.DLMS.Python 1.0.142
Wed, 03/22/2023 - 13:51
Gurux.DLMS.Net 9.0.2303.2201
Wed, 03/22/2023 - 10:15
gurux.dlms.c 20230322.1

Open bugs

Gurux.DLMS.AMI4
1
Gurux.DLMS.Android
1
gurux.dlms.c
3
gurux.dlms.cpp
3
gurux.dlms.delphi
1
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin