beautypg.com

2 writing expressions, 2 writing expressions -6, 2 wrtng expressons – Yokogawa Button Operated MV2000 User Manual

Page 226: Common items

background image

10-6

IM MV1000-01E

10.2 Wrtng Expressons

This section defines expressions and explains how to write them.

Common Items

Follow the rules below when writing expressions.
• Use up to 120 characters to write expressions.
• Use parentheses to indicate the order of mathematical functions.
• Specify channels in an expression using channel numbers.
Examples: 1, 12, 101, and 201
• You can write the one digit numbers of constants (K), communication input data (C),

remote input terminal statuses (D), pulse inputs (P, Q), internal switch statuses (S),
alarm output relay statuses (I), and flags (F) in an expression using two digits or one
digit. For example: 01 or 1.

Examples: K01, K1, C01, C1, D01, D1, P01, P1, Q01, Q1, S01, S1, I01, I1, F01, and F1
• Be aware that the data of the previous scan is used for the computation channel’s

value and for the values of channels with numbers that are greater than the
computation channel’s number.

• Write special computations (HOLD, RESET, and CARRY) and conditional expressions

at the beginning of an expression.

Order of Precedence for Computatons

The order of precedence for computations in an expression is as follows:

Type

Operators and Functons

(High order of precedence)

Functions

ABS(), SQR(), LOG(), LN(), EXP(), TLOG.MAX(), TLOG.MIN(),

TLOG.AVE(), TLOG.SUM(), TLOG.P-P(), CLOG.MAX(), CLOG.

MIN(), CLOG.AVE(), CLOG.SUM(), CLOG.P-P()

Special computations and conditional expressions

PRE, HOLD, RESET, CARRY, [a?b:c]

Power

**

Logical negation

NOT

Multiplication and division

*, /

Addition and subtraction

+, –

Greater than and less than

.GT., .LT., GE., LE.

Equal and not equal

.EQ., .NE.

Logical product

AND

Logical sum and exclusive logical sum OR, XOR

(Low order of precedence)

Lmtatons

Expressions have these limitations.

Expresson

Lmtatons

TLOG computation

An operator or function cannot be written inside the parentheses.
An expression can contain only one TLOG function.

CLOG computation

The maximum number of channels that can be written in the parentheses is 30.
An operator or function cannot be written inside the parentheses.
An expression can contain only one CLOG function.

PRE

An operator or function cannot be written inside the parentheses.

HOLD(a):b

Can only be written at the beginning of an expression.
An expression can contain only one HOLD function.

RESET(a):b

Can only be written at the beginning of an expression.
An expression can contain only one RESET function.

CARRY(a):b

Can only be written at the beginning of an expression.
An expression can contain only one CARRY function.
Only TLOG.SUM can be specified for b.

Conditional

expressions [a?b:c]

RESET, CARRY, and HOLD cannot be specified for a, b, and c.
Conditional expressions cannot be combined with other operators or functions ([a?b:

c]+001 for example). However, a conditional expression can be specified for a, b, and c.

This manual is related to the following products: