Multiple Commands; Parenthesis; Quotation Marks; Remarks - Omron CX-Supervisor Reference Manual

Script language reference
Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

Punctuation
4-5-3

Multiple Commands

4-5-4

Parenthesis

4-5-5

Quotation Marks

4-5-6

Remarks

ELSE
IF altitude > 140 THEN
lift = lift - 0.2
ENDIF
ENDIF
IF burner AND fuel > 0 AND rate > 0 THEN
lift = lift + rate/5
ELSE
IF altitude > 140 THEN
lift = lift - 0.2
ENDIF
ENDIF
Both examples provide identical functionality, but the use of indentation, either
spaces or tabs to show the construction of the statements aids readability.
The use of the ELSEIF statement in this example was omitted for clarity.
Typical Examples
count = 75
result = log(count)
count = 75 : result = log(count)
Both examples provide identical functionality, but the use of the colon between
statements allows both to reside on the same line.
Typical Examples
result = 20 + 30 * 40
The result is 1220.
result = (20 + 30) * 40
The values in parenthesis are calculated first. The result is 2000.
References
Refer to chapter 4, Logic and Arithmetic, Arithmetric Operations for further
details.
Typical Examples
name = "Valve position"
The Text point 'name' is assigned associated text, contained within quotation
marks. Quotation marks must be used in this instance.
Message("This text to be displayed as a message.")
Passing static text as arguments to functions.
BlueCarsAck = IsAlarmAcknowledged("BLUEPAINT")
The point 'BlueCarsAck' is assigned a Boolean state based on the alarm
'BLUEPAINT'. Quotation marks must be used for an alarm name.
Syntax
REM | rem comment
or
'comment
SECTION 4 CX-Supervisor Script Language
31

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents