omron — Comparators

PMAC Product Guide Functions and operators can be used either in motion programs, PLCs or as online commands. For example, the following commands can be typed in a terminal window: P1=SIN (45) P1 ; Reports the sine value of a 45° angle I130=I130/2 ; Lower the proportional gain of Motor #1 by half I125=I125|$20000 ; Disable the end-of-travel limits of Motor #1 Comparators A comparator evaluates the relationship between two values (constants or expressions). It is used to determine the truth of a condition in a motion or PLC program. The valid comparators for PMAC are: = (equal to) != (not equal to) > (greater than) !> (not greater than; less than or equal to) !

~ (approximately equal to -- within one) !~ (not approximately equal to -- at least one apart) Note that and >= are not valid PMAC comparators. The comparators !> and ! , respectively, should be used in their place. 50 Programming PMAC SIN This is the standard trigonometric sine function. COS This is the standard trigonometric cosine function. TAN This is the standard trigonometric tangent function. ASIN This is the inverse sine (arc-sine) function with its range reduced to +/-90 degrees. ACOS This is the inverse cosine (arc-cosine) function with its range reduced to 0 -- 180 degrees. ATAN This is the standard inverse tangent (arc-tangent) function.

ATAN2 This is an expanded arctangent function, which returns the angle whose sine is the expression in parentheses and whose cosine is the value of Q0 for that coordinate system. If doing the calculation in a PLC program, make sure that the proper coordinate system has been addressed in that PLC program. (Actually, it is only the ratio of the magnitudes of the two values and their signs, that matter in this function). It is distinguished from the standard ATAN function by the use of two arguments. The advantage of this function is that it has a full 360-degree range, rather than the 180-degree range of the single-argument ATAN function. LN This is the natural logarithm function (log base e).

EXP This is the exponentiation function (ex). Note: To implement the yx function, use ex ln(y) instead. A sample PMAC expression would be EXP(P2*LN(P1)) to implement the function P1P2. SQRT This is the square root function. ABS This is the absolute value function. INT This is a truncation function which returns the greatest integer less than or equal to the argument (INT(2.5)=2, INT(-2.5)=-3).