MCO 305 Design Guide__ How to Program __MG.33.L5.02 – VLT® is a registered Danfoss trademark 167long a,b,c,ddouble u,v,y,z// x is not allowed, because it is used for axes notification x(n)It is recommended that NOIMPLICIT be used since this avoids the creation of unwanted definitions of newLONG variables by mistake (e.g. a misspelled variable name).NB!:Pragmas are supported starting with MCO 5.00.Variable TypesVariable types are available starting with MCO 5.00.APOSS supports variables of type LONG and DOUBLE. LONG variables can be defined implicitly by just usingthem (unless the NOIMPLICIT pragma is used). DOUBLE variables must be declared before they are used.Declaration of those variables looks like:long a,b,c,ddouble u,v,y,z// x is not allowed, because it is used for axes notification x(n)Implementation of DOUBLE variables is hardware and firmware dependent. MCO305 (firmware > 5.00) –uses 64 bit precision (some double functions like sqrt, sin, cos .. are only 32 bit precision).Additionally, the following DOUBLE functions are supported:sqrt, sin, cos, tan, acos, asin, atan, grad, rad, ln, exp, as well as the constant PI. These functions are only32-bit precision for some hardware (MCO305). They can be used as follows:y = sqrt(x) // returns the square root of xy = sin(x) // returns the sine of x (this also works for cos, tan, acos, asin, atan)y = grad(x) // converts x (radians) into degrees (0..360)y = rad(x) // converts degrees into radians (0.. 2 *pi)x = pi * 0.5 // Pi is 3.1415….y = ln (x) // returns the natural logarithm of xy = x exp u // returns x raised to u (xu)The double functions can be used: FABS returns the floating point absolute value of a floating pointargument.double dx, dydy = -100.00 % 15.0 // this will be -6.6666..dx = fabs(dx) // this gives back 6.6666..ROUND rounds the floating point argument to the closest integer. This function still returns a double.dx = round(dy) // this will be -7.0000The RND command for integers also works for negative numbers.a = -100b = a rnd 15 // now correctly delivers –7Furthermore, a cast operator is supported. So you can explicit cast expressions like:a = ((long) y) – 4y = (double) aIf necessary, the compiler will internally cast expressions. Ify = a * 2.0