beautypg.com

Function blocks, Atan2, Parameters – Yaskawa MotionWorks IEC Toolboxes User Manual

Page 326: Notes

background image

Math Toolbox

MotionWorks IEC61131-3 Toolboxes: 2013-09-13

313

Function Blocks

ATAN2

The ATAN2 function is useful in many applications involving vectors, such as finding the direction from one point
to another. This two argument function is a variation of the ATAN function. For any LREAL arguments x and y,
atan2(y, x) is the angle between the positive x-axis of a plane and the point given by the coordinates (x, y) on
it.

Parameters

*

Parameter

Data
Type

Description

VAR_INPUT

Default

B

EN

BOOL

This function will continue to calculate the ATAN2
result while EN is held high.

FALSE

V

X

LREAL

X coordinate

LREAL#0.0

V

Y

LREAL

Y coordinate

LREAL#0.0

V

Output_Format

INT

Format of the output value.
0: radians (-pi, pi]
1: radians [0, 2*pi)
2: degrees [0°, 360°)

INT#0

VAR_OUTPUT

B

ENO

BOOL

ENO will be high is EN is high and this function can calculate the
Angle

V

Angle

LREAL

The result of the ATAN2 calculation

Notes