Sign in to follow this  
Followers 0
Daniel Alejandro Martinez

Help with a FB

5 posts in this topic

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

Share this post


Link to post
Share on other sites

What PLC?  What does X equal on the first operation?  

1 person likes this

Share this post


Link to post
Share on other sites

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

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
Sign in to follow this  
Followers 0