April 21st, 2007, 09:14 AM
I am using S7 300 CPU 315-2 PN/DP. I can use only 0-511 timers in that plc. In my project i have to use more then 800 timers.
Is there any way.
April 21st, 2007, 10:11 AM
You could roll your own timers using a clock pulse and count
April 21st, 2007, 10:23 AM
Here you go, i kenw i had read a post on here before about roll your on on S7
If you do want to roll you own - try this , I posted it before , but I can't find where :-
You need to sub M10.0 for your first cycle flag , and MD58 is your last scan time - you may find it gives you what you want .
FUNCTION "TON" : VOID
TITLE =TON - Timer On Delay
//If the enable condition go true, timer TON starts incrementing according with
//the last CPU cycle time. When the accumulated value is greater than or equal to
//the preset value, the timer stops and sets the timer done bit.
NAME : TON
VERSION : 0.1
EN : BOOL ; //Timer Enabled
Pre : TIME ; //Timer Preset
TT : BOOL ; //Timer Timing
DN : BOOL ; //Timer Done
Acc : TIME ; //Timer Accumulator
TITLE =Reset Accumulator Value If Timer Not Enabled Or First CPU Cycle
O M 10.0;
_001: NOP 0;
TITLE =Accumulator Value Increasing
L MD 58;
_002: NOP 0;
TITLE =Timer Done
TITLE =Timer Timing
TITLE =ENO Setting
April 21st, 2007, 10:47 AM
Check out this thread. I would use SFB4 (TON) as a multi-instance block and you can have thousands in use. You can also use FC80 also located in TI->S7 Library