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 

ANALOGIC FLOW TRANSMETER FUNCTION BLOC

 
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> Schneider_Electric Reg. U
View previous topic :: View next topic  
Author Message
nehidjayounes
Junior
Junior


Joined: 13 May 2014
Posts: 3

PostPosted: 20/08/2014 11:59    Post subject: ANALOGIC FLOW TRANSMETER FUNCTION BLOC Reply with quote

CAN ANYONE HELP ME TO UNDERSTAND THIS FUNCTION BLOC
OUT:=REAL_TO_INT ((YMAX-YMIN)/(XMAX-XMIN)*(INT_TO_REAL(IN)-XMIN)+YMIN);

IF INT_TO_REAL(IN) <XMIN> XMAX THEN
OUT:=REAL_TO_INT(YMAX);
END_IF;

:whistle:
Back to top
View user's profile Send private message
zeck
Member 2
Member 2


Joined: 08 Mar 2014
Posts: 308

PostPosted: 20/08/2014 20:24    Post subject: Re: ANALOGIC FLOW TRANSMETER FUNCTION BLOC Reply with quote

nehidjayounes wrote:
CAN ANYONE HELP ME TO UNDERSTAND THIS FUNCTION BLOC
OUT:=REAL_TO_INT ((YMAX-YMIN)/(XMAX-XMIN)*(INT_TO_REAL(IN)-XMIN)+YMIN);

IF INT_TO_REAL(IN) <XMIN> XMAX THEN
OUT:=REAL_TO_INT(YMAX);
END_IF;

:whistle:


what you not understand...?
OUT:=REAL_TO_INT ((YMAX-YMIN)/(XMAX-XMIN)*(INT_TO_REAL(IN)-XMIN)+YMIN);
This is for scaling the analog value.

IF INT_TO_REAL(IN) <XMIN> XMAX THEN
If the value goes under min_value or over max_value then
at output the max-value.
OUT:=REAL_TO_INT(YMAX);

REAL_TO_INT and others are cast operators...convert real to integer for example...
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 -> Schneider_Electric Reg. U 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