====== PC (PLC) Time ====== {{:en:mervis-ide:35-help:b99.png}} ===== Block name ===== B99_PCTIMENODE ===== ST call ===== PROGRAM TEST B99 VAR LINT1 : LINT; // CAS V SEKUNDáCH SINT1,SINT2,SINT3 :SINT; END_VAR LINT1 := LIB.CORE.V1_0.B99_PCTIMENODE(LOCAL:=TRUE, SEC=>SINT1,MIN=>SINT2,HOUR=>SINT3); END_PROGRAM ===== Library ===== LIB\CORE ===== Version ===== V1.0 ===== Description ===== The block returns UTC or local time, together with iother time units. ===== Inputs ===== |Input|Type|Description |Default value| |LOCAL|BOOL|Local or UTC time? (UTC = false, Local = true)|True | ===== Outputs ===== |Output |Type|Description | |=> |LINT|Time in //s// | |MSEC |INT |Milliseconds (May not be supported for certain platforms) | |SEC |SINT|Seconds | |MIN |SINT|Minutes | |HOUR |SINT|Hours | |DAY |SINT|Days | |WDAY |SINT|Day of week (//0// = Sunday, //1// = Monday, ..., //6// = Saturday) | |MON |SINT|Months | |YEAR |INT |Years | |DAYLIGHT |BOOL|daylight=true means that the Daylight saving time (DST) is active (only makes sense for local time)| |REMAINDAY|SINT|Remaining days until end of the month (last day: remainday = 0) | ===== Function ===== The block outputs the real time of the SoftPLC. The output //=>// gives total time in seconds starting at 1.1.1970, 0:00, and the //wday// output indicates the day of week (//0// = Sunday, 1 = Monday, ..., 6 = Saturday). The parameter //local// specifies if the time to consider is UTC or local time (//local=true// means time of the PC or PLC-preset time zone). ===== Poznámka ===== For MiniPLC platform-based controllers, the //msec// output //= 0//. ===== Application example ===== {{:en:mervis-ide:35-help:b99_example.png}} The block is used for periodical launching of programs and events, such as meter reading (e.g. last day of the month at 23:00), or for general time/date based calculations.