timedFuncEvents()

The function timedFuncEvents() returns up to a given max_count all planned start_times (occurrences) when WinCC OA timedFunc would trigger a (start-)event. This function also handles the time periods (broadcast periods) (see Timed function extension) within the range defined by ’r;valid from’ and ’r;valid until’.

Synopsis

timedFuncEvents(string dp, time start_check, unsigned max_count, dyn_time &occurrences);

Parameters

Parameter Meaning
dp Data point of type _TimedFunc that contains the schedule meaning when the timedFunc() would trigger a (start) event.
start_check The time the check is started.
max_count Maximum count of all planned start times.
occurrences The start time occurrences.

Return value

Return value Meaning
0 OK
-1 Error (lastError is set, see getLastError())

Errors

See above

EXAMPLE

Example with the following _TimedFunc DP "dp1":

Valid from: 20.9.07 17:16:36

Valid until: 1. 1.1970 1:00:00 (meaning no limit, zerohour)

Interval: 3600 (60 minutes)

Time: 70000, 77000 (times when the workFunc is called, specified as seconds since 00:00)

Mode 1: The mode 1 means Timing periods. See Timed function extension

Weekday: -2 ; -2 (meaning weekdays)

main()
{
  int rc;
  dyn_time dt;
  time tHelp;
  tHelp = makeTime(2007, 10, 10, 17 );
  rc = timedFuncEvents( "dp1", tHelp, 10, dt ); 
  /* timedFunc dp: "dp1", start_check: 10.10.07 17:00,maxCount: 
  10*/
  DebugN( rc, tHelp, dt);
}

The timedFuncEvents would return the following occurrences:

WCCOActrl2:[0][Wed Oct 10 17:00:00 2007 000][dyn_time 10 items

WCCOActrl2: 1:Wed Oct 10 19:26:40 2007 000

WCCOActrl2: 2:Wed Oct 10 20:26:40 2007 000

WCCOActrl2: 3:Wed Oct 10 21:23:20 2007 000

WCCOActrl2: 4:Thu Oct 11 19:26:40 2007 000

WCCOActrl2: 5:Thu Oct 11 20:26:40 2007 000

WCCOActrl2: 6:Thu Oct 11 21:23:20 2007 000

WCCOActrl2: 7:Fri Oct 12 19:26:40 2007 000

WCCOActrl2: 8:Fri Oct 12 20:26:40 2007 000

WCCOActrl2: 9:Fri Oct 12 21:23:20 2007 000

WCCOActrl2: 10:Mon Oct 15 19:26:40 2007 000

WCCOActrl2:]

Assignment

Miscellaneous functions

Availability

CTRL