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

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

Post by Schtiel »

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 »

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: 1122
Joined: Wed Sep 06, 2006 12:03 pm
Location: CIS

Post by Schtiel »

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 »

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...