[?]: How can I program a Timer in ST

CX-One, CX programmer, NTST, Syswin ....
Post Reply
Schtiel
Site Admin
Posts: 1121
Joined: Wed Sep 06, 2006 12:03 pm
Location: CIS

Post by Schtiel » Wed Dec 03, 2008 7:23 am

I did not work with OMRON, but for Modicon it is something like that (for OMRON it should be the same):
(* Declaration *)

VAR
My_Timer : TON;
END_VAR

(* Invocation *)

My_Timer (IN := timer_input,
PT := t#5s);

(* Assign outputs *)

timer_output := My_Timer.Q;

Dreamer76
Posts: 88
Joined: Sun Feb 18, 2007 10:47 am
Location: Europe

Post by Dreamer76 » Sun Dec 14, 2008 4:23 pm

Code: Select all

FUNCTION_BLOCK FB2
VAR
CurrTime : S5time;
BiVal : word;
ActFlag : bool;
END_VAR
BEGIN
CurrTime :=S_ODT (T_NO:= T10, S:=TRUE, TV:=T#1s, R:=FALSE,
BI:=biVal,Q:=actFlag);
END_FUNCTION_BLOCK
but why in st ??? :?: :?:

Schtiel
Site Admin
Posts: 1121
Joined: Wed Sep 06, 2006 12:03 pm
Location: CIS

Post by Schtiel » Sun Dec 14, 2008 8:08 pm

patricx wrote:st is the future
hmmm... that's a very doubtful statement...

Dreamer76
Posts: 88
Joined: Sun Feb 18, 2007 10:47 am
Location: Europe

Post by Dreamer76 » Mon Dec 15, 2008 7:13 pm

Schtiel wrote:
patricx wrote:st is the future
hmmm... that's a very doubtful statement...
schtiel right answer...
st is good for complex program codes but not for a timer or so...

Post Reply