EasyManuals Logo
Home>Omron>Controller>NX1P

Omron NX1P User Manual

Omron NX1P
106 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #99 background imageLoading...
Page #99 background image
99
6-1-3 Structure of ST and Example
Using general expressions, ST programming requires no special knowledge.
Remember the following two rules:
(1) Use a colon and an equals sign (:=) to assign a value to a variable.
(2) Statements must end with a semicolon (;).
Example
An example of the statement to calculate the distance between two points using Pythagoras'
theorem is shown below.
Just apply the formula.
■ Formula
𝐋𝐞𝐧𝐠𝐭𝐡 =
(𝐗𝟏 𝐗𝟎)
𝟐
+ (𝐘𝟏 𝐘𝟎)
𝟐
■ ST program
Length := SQRT((X1-X0)**2+(Y1-Y0)**2);
* SQRT: Square Root
6-1-4 Operators
Operator Operation Notation example Priority
()
First priority
Value := (1+2)*(3+4); // Value is 21
1
-, + Sign +100, -100
2
NOT
Logical NOT
Value := NOT TRUE; // Value is FALSE
** Exponent Value := 2**8; // Value is 256 3
*
Multiplication
Value := 8*100; // Value is 800
4 / Division Value := 200/25; // Value is 8
MOD
Remainder
Value := 10 MOD 6; // Value is 4
+ Addition Value := 200+25; // Value is 225
5
-
Subtraction
Value := 200-25; // Value is 175
<, >, <=, >= Comparison Value := 60>10; // Value is TRUE 6
=
Matches
Value := 8=7; // Value is FALSE
7
<> Does not match Value := 8<>7; // Value is TRUE
&, AND
Logical AND
Value := 2#1001 AND 2#1100; // Value is 2#1000
8
XOR Logical exclusive OR Value := 2#1001 XOR 2#1100; // Value is 2#0101 9
OR
Logical OR
Value := 2#1001 XOR 2#1100; // Value is 2#1101
10

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NX1P and is the answer not in the manual?

Omron NX1P Specifications

General IconGeneral
BrandOmron
ModelNX1P
CategoryController
LanguageEnglish

Related product manuals