Download CoDeSys Manual - Parkermotion.com
Transcript
IEC Operators and additional norm extending functions LOG Returns the logarithm of a number in base 10. IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL. Example in IL: LD 314.5 LOG ST q (*Result is 2.49762 *) Example in ST: q:=LOG(314.5); Example in FBD: EXP Returns the exponential function. IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL. Example in IL: LD 2 EXP ST q (* result is 7.389056099 *) Example in ST: q:=EXP(2); Example in FBD: SIN Returns the sine of a number. IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL. Example in IL: LD 0.5 SIN ST q (*Result is 0.479426 *) Example in ST: q:=SIN(0.5); CoDeSys V2.3 10-21