Is there a library that contains a function for motorized potentiometer?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-11-30
Originally created by: scott_cunningham
Here is a FB you can use where the input priority is (reset, inc, dec) (I only lightly tested it - so double check it):
FUNCTION_BLOCKMotorPotVAR_INPUT
  Inc  : BOOL :=FALSE;
  Dec  : BOOL :=FALSE;
  Reset : BOOL :=FALSE;
  Rate : REAL :=0.1;END_VARVAR_OUTPUT
  Cmd : REAL;END_VARVARCONSTANT
  MIN_CMD : REAL :=-100.0;
  MAX_CMD : REAL :=100.0;END_VARIFResetTHEN
  Cmd :=0.0;ELSIFIncTHEN
  Cmd :=MIN(Cmd+Rate, MAX_CMD);ELSIFDecTHEN
  Cmd :=MAX(Cmd-Rate, MIN_CMD);END_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a library that contains a function for motorized potentiometer?
Originally created by: scott_cunningham
Here is a FB you can use where the input priority is (reset, inc, dec) (I only lightly tested it - so double check it):