Posted 15 Sep 2006 This is what I need to do. I want to control a fail to start/stop output with the TONR timer. when a local or remote start signal is generated and the pump is not running I need the TONR timer to start. If the pump starts before my TONR PRE, I need the ACC or accuulated time to reset to zero. If pump does not start I need the timer DN to go high. How do I acheive this in structured text using RSlogix5000? Any tips.. anything will be greatly appreciated.. This is what I have so far... //Once start command is issued, start time delay for timer timing if Pump.StrtCmd AND NOT Pump.Running then Pump.FailToStrtTMR.TimerEnable := 1; Pump.FailToStrtTMR.PRE := 50; end_if; //Generate fail to start alarm if pump start fails. if Pump.FailToStrtTMR.DN then Pump.FailToStrtALM := 1; Pump.FailToStrtTMR.TimerEnable := 0; end_if; Share this post Link to post Share on other sites
Posted 19 Sep 2006 You'll need to add the line: TONR(Pump.FailToStrtTMR); somewhere where it will be passed over in the scan. Also make sure that you have the line: Pump.FailToStrtTMR.Reset := 0; in the first if-then block, and Pump.FailToStrtTMR.Reset := 1; in the second if-then block. Matt Share this post Link to post Share on other sites
Posted 19 Sep 2006 Just curious why structured text? The logic you are trying to implement seems so simple to do in ladder logic and easier to troubleshoot. Wht not just do it in Ladder logic? Share this post Link to post Share on other sites
Posted 20 Sep 2006 I've found myself in similar situations where the overall process the routine is handling is much better suited to structured text (or any language besides ladder), but there's a couple of things that are a pain in that chosen language. Kind of a "lesser of two evils" thing. Matt Share this post Link to post Share on other sites