gxdn

Activity calendar

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.
  • 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

//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);
    }
}