I have to make a FB or PRG which will initialise only on PLC start, that will start only once, not in the cycle. In the PRG will be system timer which can not be reset with task cycle.
Any suggestions?
Thanks in advance!
Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello!
I have to make a FB or PRG which will initialise only on PLC start, that will start only once, not in the cycle. In the PRG will be system timer which can not be reset with task cycle.
Any suggestions?
Thanks in advance!
Alex
Hi Alex!
To make a first scan is easy, but in my examples the code doesn't execute more than one scan
cycle. So to have a system timer here doesn't work.
I usually do a like to use a trigger, TRUE will be active when the system start and to it stops.
R_TRIG(CLK:=TRUE, Q=>);
or if you are making funktionblocks I do this:
IF EN AND NOT ENO THEN
...firstscan code
END_IF;
code
...
ENO:=EN;
( You need to make the input EN and the output ENO first. )
in source there is a special task for this called start
hmmm......
It's not realy "system timer", it is timer for dislpay lightning. I have in mind this option, but it doesn't really work:
IF done THEN
RETURN;
END_IF
(NetzDummy;)
SysSetLighting(disp_time:=30);
(SystemSetParameter(3010, rgb);)
done:=TRUE;
If i put only SysSetLighting in FB, the FB resets timer every cycle.
regards, alex