日本語 English

Calculation Library Samples

This page provides a calculation library for the OMRON NX/NJ series.
You can download samples for 2D geometry, 3D coordinate calculation, vector operations, matrix operations, quaternions, attitude control and more.

Samples

2D calculation

Right triangle

Right triangle

Enter any two of side ab, height, side ca and the angle at a, then execute to calculate and output the items not entered

Polygon enclosed by points

Polygon enclosed by points

Outputs the area and perimeter of a polygon connecting up to 10 points on the coordinate plane

Inscribed circle of a triangle

Inscribed circle of a triangle

Outputs the radius and area of the inscribed circle of a triangle with the three side lengths specified

Circumscribed circle of a triangle

Circumscribed circle of a triangle

Outputs the radius and area of the circumscribed circle of a triangle with the three side lengths specified

Inscribed circle of a regular polygon

Inscribed circle of a regular polygon

Outputs the radius and area of the inscribed circle of a regular polygon with the side length specified

Circumscribed circle of a regular polygon

Circumscribed circle of a regular polygon

Outputs the radius and area of the circumscribed circle of a regular polygon with the side length specified

Distance and angle between two points

Distance and angle between two points

Distance and angle of the line through two points on plane coordinates

Intersection and angle of two lines

Intersection and angle of two lines

Intersection coordinates and crossing angle of two lines on plane coordinates

Rotation around the origin

Rotation about the origin

Rotation around the origin on plane coordinates

Cartesian to polar coordinates

Cartesian to polar coordinates

Converts Cartesian coordinates to polar coordinates

Center of a circle through three points

Center of the circle through three points

Find the center and radius of the circle through three points on a plane

3D calculation

Distance between two points in space

Distance between two points

Calculate the distance between two points in space coordinates

Center of the circle through three points in space

Center of the circle through three points

Calculate the center of the circle through three points in space

Rotation around the X, Y and Z axes

Rotation about X, Y, Z axes

Rotation around the X, Y or Z axis

Rotation with Euler angles

Rotation by Euler angles

Converts Euler angles to a rotation matrix and rotates

Rotation with quaternions

Rotation by quaternion

Rotation around a rotation axis

Vectors

Other

Vector creation, scalar multiplication, Hadamard product, comparison, dot product, norm

Rotation conversion

Hyperbolic / Inverse Hyperbolic Functions

Matrices

Quaternions

Other

Attitude control

Download

By downloading, you are deemed to have agreed to the Terms of Use

Graph display with Python

The Python 3 program that graphs the calculation library results is pythonTestView.zip
It uses the Python libraries socket, numpy and matplotlib, so please install them

[How to check with graphs]

With the PLC and PC connected via Ethernet,
on the PLC, run "Calculation library source (keisan.csm2)" and turn ON the trigger of the ladder program you want to run to set the calculation results in the PC read area
on the PC, run the corresponding program such as "Plot2D_fins.py" to read the PLC values and display a graph

2DPlot2D_fins.py
3DPlot3D_fins.py
Vectorsvector3D_fins.py
Hyperbolic / inverse hyperbolic functionsgraph_fins.py

Related samples

GitHub links
python3d Sample for calculating Euler angles and quaternions in Python
FinsCommand Sample for sending and receiving FINS commands over UDP

Comments