Posted 21 Feb 2019 Hello, I'd like some help with using timers in structured text, how to make block independent timers like in Ladder function blocks in ST? like IF condition THEN enabledTimerVar; END_IF; IF timerFired THEN doStuff; END_IF; CX-Programmer says I cant use the TIMER datatype. //Kind Regards. Share this post Link to post Share on other sites
Posted 21 Feb 2019 ST TIMER not supported on CP1L http://forums.mrplc.com/index.php?/topic/28706-timer-in-function-block-with-cp1l-e/#comment-136695 Share this post Link to post Share on other sites
Posted 21 Feb 2019 Thank you. After some searching I managed to make a workaround. The TIMERS.zip file referenced in the linked thread is not available to me, so had to figure out how to do it myself. :) //Kind regards Share this post Link to post Share on other sites
Posted 22 Feb 2019 So how about showing us all how you did it? Sharing feedback on posts is one way of showing gratitude and helping other MRPLC members who may have similar problems. Share this post Link to post Share on other sites
Posted 23 Feb 2019 I'll post it when back to work, whenever that happens, I seem to have gotten sick. Share this post Link to post Share on other sites
Posted 5 Mar 2019 As promised, here is the solution: Input Variables: Output Variables: And to call that from ST when programming for a CP1L CPU : Create a variable with a function block reference of the Timer Ladder Function Block. timerVariable(EN:= EN, TON:= condition, TimerValue:= number_or_variable, Out=>boolOutFlag); //Regards Share this post Link to post Share on other sites