Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:software:qview:qview_6:qcl_library:vc10mktime [2017/02/03 16:40] – [VC10MkTime] qem103 | en:software:qview:qview_6:qcl_library:vc10mktime [2019/08/29 17:01] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== VC10MkTime ====== | ||
+ | |||
+ | Introducing a date and time (day, mounth, year, hours, minutes, seconds) the **VC10MkTime** function __gives the number of seconds elapsed from 00:00 of the 1 January 1970 until the introduced date__.\\ | ||
+ | This is useful to be able to make comparisons between dates.\\ | ||
+ | The function also runs day and month values greater than its natural limits (day > 31 or mounth > 12), automatically calculating the date. | ||
+ | |||
+ | ===== IMPLEMENTATION ===== | ||
+ | |||
+ | **VC10MkTime (aglParam, glSumSec)** | ||
+ | |||
+ | Parameters: | ||
+ | |||
+ | ^IN/ | ||
+ | | IN | ARRGBL | ||
+ | | IN | ARRGBL | ||
+ | | IN | ARRGBL | ||
+ | | IN | ARRGBL | ||
+ | | IN | ARRGBL | ||
+ | | IN | ARRGBL | ||
+ | | OUT | ARRGBL | ||
+ | | OUT | ARRGBL | ||
+ | | OUT | ARRGBL | ||
+ | | OUT | GLOBAL | ||
+ | |||
+ | === Example === | ||
+ | |||
+ | You want to activate a digital output (ofUscita01) When the date and current time exceeds a previously set date and time. | ||
+ | |||
+ | <code QCL> | ||
+ | ;Current Date | ||
+ | aglParam[1] = 25 | ||
+ | aglParam[2] = 6 | ||
+ | aglParam[3] = 2009 | ||
+ | aglParam[4] = 15 | ||
+ | aglParam[5] = 30 | ||
+ | aglParam[6] = 55 | ||
+ | VC10MkTime (aglParam, glSumSec) | ||
+ | glSecActual = glSumSec ; | ||
+ | |||
+ | ;Data to compare | ||
+ | aglParam[1] = 1 | ||
+ | aglParam[2] = 1 | ||
+ | aglParam[3] = 2010 | ||
+ | aglParam[4] = 18 | ||
+ | aglParam[5] = 00 | ||
+ | aglParam[6] = 00 | ||
+ | VC10MkTime (aglParam, glSumSec) | ||
+ | glSecExpiry = glSumSec ; | ||
+ | |||
+ | IF glSecActual GT glSecExpiry | ||
+ | SETOUT ofUscita01 | ||
+ | ENDIF | ||
+ | </ | ||
+ | |||
+ | === Operation notes === | ||
+ | |||
+ | *By setting a month value greater than 12 function calculates the date and place it in the year or in subsequent years in relation to that introduced (example: 10/14/2010 will match the date 10/2/2011) | ||
+ | *By setting a day value greater than the number of days supported by the set month, the function calculates the time and place it in the month or in the following months than that introduced (example: 50/5/2010 will match the date 19/6/2010) | ||