Posted 26 Oct 2021 New in Omron, I am trying to use R_TRIG and F_TRIG in Omron Symatic Studio, but I don't get to activate the output. I declare R_TRIG and F_TRIG as internals variables as RisingEdge and FallingEdge. I want to activate an output with a rising edge of a the variable which is activated with a falling edge of another variable. I don't get to activate the last variable, is it possible that the scan cycle doesn´t led me to do that?? Does anybody know what am I doing wrong? here I attached a screenshot of the problem. Share this post Link to post Share on other sites
Posted 26 Oct 2021 You are using RisingEdge twice here where I think you wanted falling edge first. A little synopsis might help with the variable names and the desired operation. I think I see what you are trying to do, is there any reason you want RearmingRelay true for a single scan cycle? If this is indeed a mechanical relay they often need ~20ms to engage. Share this post Link to post Share on other sites
Posted 26 Oct 2021 6 hours ago, photovoltaic said: You are using RisingEdge twice here where I think you wanted falling edge first. A little synopsis might help with the variable names and the desired operation. I think I see what you are trying to do, is there any reason you want RearmingRelay true for a single scan cycle? If this is indeed a mechanical relay they often need ~20ms to engage. Yes, the first edge was a fallingEdge, sorry. The rearming relay sshould be maintened until tthere is an error again, I thought using the rearrming this way, although the rearming will go to false when the cycle scan finishes, the RearmingRelay will mantein in True if there isn't any error, but to set the Rearmingf Relay I need to do those edges. I have this FB Share this post Link to post Share on other sites
Posted 26 Oct 2021 (edited) I feel like your ELSE should just be RearmingRelay:=TRUE; You would get the same result, no? This logic may not be working because of the instruction. F_TRIG needs a previous state to act off. Your ELSE logic will always have a FALSE value for VariatorError therefor it will never detect an edge. Try running it outside of the IF statement all together. The IF Rearming THEN will catch it on the next scan and turn on RearmingRelay. Edited 26 Oct 2021 by photovoltaic 1 person likes this Share this post Link to post Share on other sites
Posted 26 Oct 2021 (edited) oo should be a set output instruction. Right click on the coil and choose set instruction. You won't see it otherwise, but you can at least confirm the bit changes this way Edited 26 Oct 2021 by photovoltaic Share this post Link to post Share on other sites
Posted 26 Oct 2021 36 minutes ago, photovoltaic said: I feel like your ELSE should just be RearmingRelay:=TRUE; You would get the same result, no? This logic may not be working because of the instruction. F_TRIG needs a previous state to act off. Your ELSE logic will always have a FALSE value for VariatorError therefor it will never detect an edge. Try running it outside of the IF statement all together. The IF Rearming THEN will catch it on the next scan and turn on RearmingRelay. Thank you for being patient and the fast answers, I finally get to solve it putting it outside, I though about that solution, but I though that it wouldn't work. Thank you very much. Share this post Link to post Share on other sites
Posted 27 Oct 2021 13 hours ago, J.S.A said: Yes, the first edge was a fallingEdge, sorry. The rearming relay sshould be maintened until tthere is an error again, I thought using the rearrming this way, although the rearming will go to false when the cycle scan finishes, the RearmingRelay will mantein in True if there isn't any error, but to set the Rearmingf Relay I need to do those edges. I have this FB Am i missing something? Nice comments but what are you trying to achieve? RearmingRelay:=Not VariatorError VariatorError:-=PositiveHardwareLimit OR NegativeHardwareLimit OR OvercurrentError Share this post Link to post Share on other sites
Posted 27 Oct 2021 19 minutes ago, chelton said: Am i missing something? Nice comments but what are you trying to achieve? RearmingRelay:=Not VariatorError VariatorError:-=PositiveHardwareLimit OR NegativeHardwareLimit OR OvercurrentError Yes, you are right but I needed to use the edge of ResetVariatorBit4, that's the reason I needed to do that variables "connection". I finally solve the problem with photvoltaics help, taking the edges out of the IF condition. Share this post Link to post Share on other sites