Main page
PLC functions
Small tools
Technical links
Other links
Some information
Back to home
 Reactions: E-mail

Working people make mistakes, some people do never make mistakes! Working people
I work to live, my boss thinks I live to work!

In this section I want to explain the internal function SFC 64 "TIME_TCK". I'm using the function to make a replacement for the internal timer functions. The system time is a "time counter" counting cyclically from 0 to a maximum of 2147483647 ms (more then 24H). In case of an overflow the system time is counted again starting with 0. (this means that all my functions have a problem if the PLC is running longer then 1 day!! But the most machines run not that long. In that case you can use the normal functions.)
If you now the internal functions SFB 4 "TON" and SFB 5 "TOF", you would say WHY? Well using the "Ton" or "Tof" you have to reserve 22 bytes in a DB per timer! My function are using 1 TIME value (4bytes!). The 400 series has a accuracy of 1ms, the 300serie has 10ms. (But thats enough.)

download awl source (incl. functions.)

Symbol table:
TIME_TCK SFC 64SFC 64Read the System Time.
Output (SFC64) FC 2011FC 2011Output block FC using SFC 64 as timer
Input delay (SFC64) FC 2012FC 2012Input on/off delay using SFC 64 as timer
Timer ODT (SFC64) FC 2013FC 2013Timer using IEC SFC64
Elapsed Time (SFC64) FC 2014FC 2014Elapsed Time for TimeValue using SFC64
8 Input delay (SFC64)FB 2012FB 20128 on - off delay timer (same in and same out time)

SFC 64: SFC 64 : Read the System Time.

Input: EN Enable function
Output: RET_VAL The RET_VAL parameter contains the read system time in the range from 0 to 231-1 ms.
ENO ??
top

FC 2013: FC 2013 : Timer using IEC SFB64.

Input: EN Enable function
Input Start timer. (Current time is stored in TimeValue on positive flank of signal.)
Time_on The time before ENO becomes high.
In/Output: TimeValue See above. Comparing this value with the current time the function determines if the time has elapsed.
Output: ENO High if time elapsed and the input is high.
top

FC 2014: FC 2014 : Elapsed time using timer SFC 64.

Input: EN Enable function
TimeValue Start timer. (Current time is stored in TimeValue on positive flank of signal.)
Output: Elpased Comparing this value with the current time the function determines how long the time has elapsed. (Useful for debug or monitor function.)
ENO High if time elapsed and the input is high.
top