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
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
Outputs the area and perimeter of a polygon connecting up to 10 points on the coordinate plane

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
Outputs the radius and area of the circumscribed circle of a triangle with the three side lengths specified

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
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 of the line through two points on plane coordinates

Intersection and angle of two lines
Intersection coordinates and crossing angle of two lines on plane coordinates

Center of the circle through three points
Find the center and radius of the circle through three points on a plane
3D calculation

Center of the circle through three points
Calculate the center of the circle through three points in space
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
| 2D | Plot2D_fins.py |
| 3D | Plot3D_fins.py |
| Vectors | vector3D_fins.py |
| Hyperbolic / inverse hyperbolic functions | graph_fins.py |
Related samples
| python3d | Sample for calculating Euler angles and quaternions in Python | |
| FinsCommand | Sample for sending and receiving FINS commands over UDP |















