Posted 3 Oct 2017 (edited) Good day I need help to program this formula in a funtion Block y= (Rf + (X*w-n))/w where Y= avarege of of a analog signal Rf = My analag imput signal X = Previus Y value w = Constant n = Constant Trigger I need make this operation every 0.1s Please Help me. Edited 3 Oct 2017 by Daniel Alejandro Martinez Share this post Link to post Share on other sites
Posted 3 Oct 2017 What PLC? What does X equal on the first operation? 1 person likes this Share this post Link to post Share on other sites
Posted 4 Oct 2017 This should do it. I made up initial values for your constants (see internal variables in the function block). I also made the Y variable retentive. It will be zero only for the very first time that the function block is ran. Then it will remember the last value each time that power is turned off. I still do not know what PLC, so I just chose the CJ2H. This should be a good sample for you so that you can create your own function block next time. Mr PLC Formula_FB.cxf MrPLC calculation FB.cxp 1 person likes this Share this post Link to post Share on other sites