tchampagne
UPDATED: I found my bug/mistake. I've added it to the code below in red/bold. Maybe this will help some other newbie like me.
 
I have written a couple of sample programs to try and learn OpenPLC and structured text. One of my sample apps is using ladder logic with a TP/Pulse Timer and it seems to be working/firing as expected. I have another sample program using only structured text and the TP/Pule Timer doesn't seem to be working (for some strange reason). I realize that everything gets converted to structured text underneath and then compiled so I can't really see/tell any difference.
 
The thing that I noticed is the TP0.CURRENT_TIME does not seem to be increasing where in the ladder logic version it does increase as expected. Has anyone seen something like this and/or what could I be doing wrong?
 
Here is the code that I'm using.
IF STOP THEN
  START := False;
  STARTED := False;
END_IF;


IF STARTED = True THEN
  
(* THIS WAS MY MISTAKE. NOT CALLING TP0() *
TP0(IN := TRUE, PT := T#5s);

  IF TP0.Q THEN
    QTriggered := True;
  ELSIF QTriggered THEN
    (* Q was previously high and is now low *)
    STOP := True;
  END_IF;  
  
END_IF;


IF START = True AND STARTED = False THEN
  STARTED := True;
  
  (* Intitialize the timer test *)
  TP0(IN := TRUE, PT := T#5s);

END_IF;
Reply 0 0
Reply