01.07.2013 Views

Library manual M238 system functions | 2 MB - BERGER - POSITEC

Library manual M238 system functions | 2 MB - BERGER - POSITEC

Library manual M238 system functions | 2 MB - BERGER - POSITEC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>M238</strong> System Functions<br />

Example<br />

The following table describes the output variable:<br />

Output Type Comment<br />

SetRTCDrift WORD Returns 00 hex if command is okay<br />

otherwise returns the ID code of the<br />

detected error.<br />

In this example, the function is called only once during the first MAST task cycle, 20<br />

seconds is added to the RTC every Tuesday at 5:45:00 a.m.:<br />

VAR<br />

MyRTCDrift : SINT (-59..59) := 0;<br />

MyDay : DAY_OF_WEEK;<br />

MyHour : HOUR;<br />

MyMinute : MINUTE;<br />

END_VAR<br />

IF IsFirstMastCycle() THEN<br />

MyRTCDrift := 20;<br />

MyDay := TUESDAY;<br />

MyHour := 5;<br />

MyMinute := 45;<br />

SetRTCDrift(MyRTCDrift, MyDay, MyHour, MyMinute);<br />

END_IF<br />

50 EIO0000000364 04/2012

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!