Jump to content

Recommended Posts

Posted (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 by Daniel Alejandro Martinez

Posted

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

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...