plc.myforum.ro Forum Index plc.myforum.ro
PLCs users www.plc.myforum.ro!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Siemens FC Smooth Analog Input

 
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> PLC Tutorials
View previous topic :: View next topic  
Author Message
mascalzone
Junior
Junior


Joined: 20 Nov 2016
Posts: 11

PostPosted: 14/01/2017 19:18    Post subject: Siemens FC Smooth Analog Input Reply with quote

FC Smooth Analog Input

Siemens FC Smooth Analog Input Siemens FC Smooth Analog Input

This function provide to smooth a analog input.
FC5
Code:
The function calculate the smooth value by add S/16 of previous value with (16-S)/16 of actual value the formula used is
Out = ([Smooth_factor]/16)*[Prev_value]+((16-[Smooth_factor])/16)*[Input_value]
S = smoothing factor
X1 = initial value/previous output
X2 = new input from I/O table

Valid entries for S smooth factor
If you want to..... then enter.....
Prevent the smoothing process 0
Provide minimal smoothing 1
provide maximum smoothing 15


Segmento: 1 Timing
This network manage the timing of function
U #CLK
FP #Dummy_bit_1
= #Calc_ON // One-shot clock
UN #Calc_ON //Timng calculation
BEB


Segmento: 2 Formula
This network apply the smoothing formula
L #Smooth_factor
L 1.600000e+001
/R // [Smooth_factor]/16
L #Prev_value
*R // ([Smooth_factor]/16)*[Prev_value]
T #Dummy_real_1
//
L 1.600000e+001
L #Smooth_factor
-R // 16-[Smooth_factor]
L 1.600000e+001
/R // (16-[Smooth_factor])/16
L #Input_value
*R // ((16-[Smooth_factor])/16)*[Input_value]
T #Dummy_real_2
//
L #Dummy_real_1
L #Dummy_real_2
+R // ([Smooth_factor]/16)*[Prev_value] + ((16-[Smooth_factor])/16)*[Input_val
ue]
T #Out_smoothed
T #Prev_value // Save previous value
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> PLC Tutorials All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro