CX-Supervisor - Man Script Language W909-E2-01.gb
CX-Supervisor - Man Script Language W909-E2-01.gb
Script Language
Software Release 1.1
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CX-Supervisor – Script Language
Notice
OMRON products are manufactured for use according to proper procedures by a qualified operator
and only for the purposes described in this manual.
The following conventions are used to indicate and classify precautions in this manual. Always heed
the information provided in them. Failure to heed precautions can result in injury to people or damage
to the product.
DANGER! Indicates information that, if not heeded, is likely to result in loss of life or
serious injury.
WARNING Indicates information that, if not heeded, could possibly result in loss of life
or serious injury.
Caution Indicates information that, if not heeded, could result in relatively serious or
minor injury, damage to the product, or faulty operation.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CX-Supervisor – Script Language
Visual Aids
The following headings appear in the left column of the manual to help you locate different types of
information.
Indicates information of particular interest for efficient and convenient operation of the
product.
1, 2, 3… Indicates lists of one sort or another, such as procedures, checklists etc.
Represents a shortcut on the Toolbar to one of the options available on the
menu of the same window.
OMRON, 2001
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or
transmitted, in any form, or by any means, mechanical, electronic, photocopying, recording, or
otherwise, without the prior written permission of OMRON.
All copyright and trademarks acknowledged.
No patent liability is assumed with respect to the use of the information contained herein. Moreover,
because OMRON is constantly striving to improve its high-quality products, the information contained
in this manual is subject to change without notice. Every precaution has been taken in the preparation
of this manual. Nevertheless, OMRON assumes no responsibility for errors or omissions. Neither is
any liability assumed for damages resulting from the use of the information contained in this
publication.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CX-Supervisor – Script Language
♦ Chapter 5 - Script Examples. A description of the script language in practice, using some
examples.
♦ Chapter 6 - Colour Palette. A description of the colour palette that can be applied to certain
script statements.
♦ Appendix A - OPC Communications Control. This appendix contains a list of the available
component properties and gives details of the Visual Basic script interface.
♦ Appendix B - Lite Communications Control. This appendix contains a list of the available
component properties and gives details of the Visual Basic script interface.
♦ Appendix C - VBScript Features. This appendix provides a summary of the VBScript features
available for use with the ExecuteVBScript and ExecuteVBScriptFile script functions.
♦ Appendix D - Jscript Features. This appendix provides a summary of the JScript features
available for use with the ExecuteJScript and ExecuteJScriptFile script functions.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CX-Supervisor – Script Language
TABLE OF CONTENTS
CX-Supervisor Page
Chapter 1 – Introduction.....................................................6
Chapter 2 – Expressions ....................................................7
Chapter 3 – Scripts ...........................................................10
Object...................................................................................................................................10
Page.....................................................................................................................................10
Project ..................................................................................................................................10
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 1 - Introduction
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 1 - Introduction
CHAPTER 1
Introduction
This reference manual describes the script language syntax as a supplement to the CX-Supervisor
User Manual. It provides detailed definition of the syntax of CX-Supervisor scripts that drive project,
page, object actions and CX-Supervisor expressions as used by objects and scripts.
Typographic conventions used in the examples in this reference manual are as follows:
♦ Script commands and reserved words are shown in the preferred case, which may be either
lower-, upper- or mixed-case.
♦ Points are shown in lower-case. Objects are shown in upper-case.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
CHAPTER 2
Expressions
This chapter describes the use of expressions within scripts.
Expressions consist of operators and operands:
♦ Operators are relational, arithmetic, logical and include many functions.
♦ Operands are constants or point variables.
Expressions can be used in a script as part of a statement (refer to chapter 3, Scripts and chapter 4,
Functions and Methods). However expressions can be applied to the following actions directly using
the associated Expression: or Digital Expression: field:
♦ Blink.
♦ Close page.
♦ Colour Change (Analogue).
♦ Colour Change (Digital).
♦ Display Status Text.
♦ Display Text Point.
♦ Display Value.
♦ Edit point value (Analogue).
♦ Edit point value (Digital).
♦ Edit point value (Text).
♦ Enable/Disable.
♦ Horizontal move.
♦ Horizontal percentage fill.
♦ Resize height.
♦ Resize width.
♦ Rotate.
♦ Show page.
♦ Vertical move.
♦ Vertical percentage fill.
♦ Visible.
The following example of a simple expression contains a point (‘redcars’) attached to a particular
object with an appropriate object action, Resize (Height). At runtime, once the value of the point has
been met within the attributes declared within the Active Expression Range/Required Height: fields,
the current object is resized accordingly. This example is an Integer or Real example, whereby the
value of the point either falls inside or outside the specified range. In this example, the point 'redcars'
must fall between 0 and 40 for the expression to be met.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
The following example of a more complex expression contains a test on point ‘position’. If ‘position’ is
more than 300 in value, and ‘position’ is less than 450 in value, i.e. the value of ‘position’ is between
300 and 450, then the expression has been met, and an action is initiated (in this instance the current
object is made visible if the expression is met). This example is a Boolean example, whereby either
the expression is met (‘TRUE’) or not met (‘FALSE’). A Boolean value is always returned from a
Digital Expression: field, as opposed to an Expression: field, which returns an Integer or Real value.
Operators used within this example are fully described in chapter 4, Logic and Arithmetic.
The following example of an expression contains a value point ‘prompt’ which is included at the value
position denoted by a ‘#’ symbol.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
CHAPTER 3
Scripts
A CX-Supervisor script is a simple programming language used to manipulate points. Scripts can be
created at different levels, at object level, page level or project level. Although the script code can be
applied to all levels of script, there are subtle differences, described in the following paragraphs.
Object
If a script is executed as a runtime action of an object, then the script can affect the object of the
action, or any other, depending on the actual content of the script.
Page
Page scripts are concerned with manipulating points and graphical objects that are used or included
within that page. In other words page scripts are used to drive a number of actions on the occurrence
of a particular event. These actions may manipulate several graphical objects on one page.
Project
Scripts can be applied to a project to manipulate points. These scripts are associated with events that
occur throughout the whole operating session
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
CHAPTER 4
Functions and Methods
This chapter describes the CX-Supervisor script language syntax. It provides a detailed definition of
the syntax of CX-Supervisor scripts that drive project, page and object actions, and CX-Supervisor
expressions as used by objects and scripts.
The following table describes the script language syntax at a glance.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
The ‘Type’ column refers to the types of script and expression the function can be applied to. ‘All’
refers to both expressions and scripts. ‘Scr’ refers to scripts only. ‘OP’ refers to Object and Page
scripts only.
The style of this annex is such that each element of the script language is described in turn, describing
scope, syntax with remarks, typical examples and references. References are always forward; for
instance, if an example contains elements not yet described, a suitable reference is included; however
if an example contains elements already described, no reference is made.
Points
Basic Point Assignment
Syntax
pointname = expression
Remarks
Argument Description
pointname The point name to be assigned a value.
expression The value to be assigned to pointname. The expression may be of
type Boolean, Integer, Real or Text.
Typical Examples
count = 100
The Integer or Real point ‘count’ is assigned the value 100.
result = TRUE
The Boolean point ‘result’ is assigned the state ‘‘TRUE’’.
name = "Valve position"
The Text point ‘name’ is assigned the associated text, contained within quotation marks.
References
Refer to chapter 4, Punctuation for details of the use of quotation marks.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Argument Description
pointname The point name to be assigned a value.
expression The value to be assigned to pointname. The expression may be of
type Boolean, Integer or Real and can include other points, logical or
arithmetical expressions. Mathematical precedence is applied as
follows:
• Parenthesis (highest).
• Unary minus and NOT logical operator.
• Multiplication, division and modulus.
• Addition and subtraction.
• Greater than, less than, greater than or equal to, and less than or
equal to relational operators.
• Shift Left (SHL) and Shift Right (SHR).
• Equal to and not equal to relational operators.
• Bitwise AND, XOR, OR.
• AND logical operator, OR logical operator (lowest).
Typical Examples
lift = height + rate/5.0
The Integer or Real point ‘lift’ is assigned the value calculated by the value of point ‘rate’ divided by 5,
plus the value of point ‘height’. Precedence can be changed by the introduction of parenthesis.
lift = lift - 0.2
The Integer or Real point ‘lift’ is assigned the value calculated by the current value of point ‘lift’ minus
0.2.
distance = distance * time
The Integer or Real point ‘distance’ is assigned the value calculated by the current value of point
‘distance’ multiplied by point ‘time’.
References
Refer to chapter 4, Logic and Arithmetic for details of the use of arithmetic and logic functions. Refer
to chapter 4, Punctuation for details of the use of parenthesis.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Argument Description
pointname The point name to be assigned a value based on an arithmetical
expression.
expression The value to be assigned to pointname. The expression may include
the following operators with points and constants:
• Addition ‘+’.
• Subtraction ‘-’.
• Multiplication ‘*’.
• Division ‘/’.
• Modulus ‘%’.
Typical Examples
result = 60 + 20/5
The Integer or Real point ‘result’ is assigned the value calculated by the value of 20 divided by 5, plus
60.
lift = height + rate/5.0
The Integer or Real point ‘lift’ is assigned the value calculated by the value of point ‘rate’ divided by 5,
plus the value of point ‘height’. Precedence can be changed by the introduction of parenthesis.
References
Refer to chapter 4, Punctuation for details of the use of parenthesis.
Bitwise Operators
Syntax
pointname = expression
or
IF expression
or
DO WHILE expression
or
DO UNTIL expression
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Argument Description
pointname The pointname to be assigned a value based on the bitwise operation.
expression The value to be assigned to pointname, or to be evaluated as a
Boolean expression. The expression can include the following
operators with points and constants:
• Bitwise AND, ‘BITAND’ or ‘&’.
• Bitwise OR, ‘BITOR’ or ‘|’.
• Bitwise XOR, ‘XOR’ or ‘^’.
• Bitwise Shift Left, ‘SHL’ or ‘<<’.
• Bitwise Shift Right, ‘SHR’ or ‘>>’.
Typical Examples
MSB = value & 128
The Boolean point ‘MSB’ is set ‘TRUE’ if the binary representation of ‘value’ has the bit set which is
worth 128.
Pattern = value << 2
The binary representation of ‘value’ is shifted left twice, and stored in ‘pattern’. Each Shift Left
operation has the effect of doubling the value, so two shifts quadruple the value.
Logical Operators
Syntax
pointname = expression
or
IF expression
or
DO WHILE expression
or
DO UNTIL expression
Remarks
Argument Description
Pointname The point name to be assigned a value based on a logical expression.
Expression The Boolean value to be assigned to pointname or the Boolean value
forming a conditional statement. The expression includes the
following operators with points and constants:
• And ‘AND’.
• Or ‘OR’.
• Not ‘NOT’.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Examples
flag = temp AND speed
The Boolean point ‘flag’ is assigned a value based on the logic of point ‘temp’ AND point ‘speed’. If
‘temp’ and ‘speed’ are both not zero, ‘flag’ is set to 1, or ‘‘TRUE’’. A value of zero in either ‘temp’ or
‘speed’ supplies ‘FALSE’ or 0 to ‘flag’.
IF flag AND temp AND speed THEN
flag = FALSE
ENDIF
The Boolean point ‘flag’ is assigned ‘FALSE’, on the condition that ‘flag’ AND point ‘temp’ AND point
‘speed’ are all not zero. If the condition fails, then ‘flag’ is not assigned ‘FALSE’.
References
Refer to chapter 4, Control Statements for details of the use of the IF THEN ELSE/ELSEIF ENDIF
statements.
Relational Operators
Syntax
IF expression
or
DO WHILE expression
or
DO UNTIL expression
Remarks
Argument Description
Expression The value forming a conditional statement. The expression may
include the following operators with points and constants:
• Greater than ‘>’.
• Less than ‘<’.
• Greater than or equal to ‘>=’.
• Less than or equal to ‘<=’.
• Not equal to ‘!=’.
• Equal to ‘==’.
Typical Example
IF fuel < 0 THEN
fuel = 0
ENDIF
The point ‘fuel’ is assigned the value 0 on the condition that currently, ‘fuel’ is less than 0. If ‘fuel’ is
not less than 0, then it is not assigned the new value.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
References
Refer to chapter 4, Control Statements for details of the use of the IF THEN ELSE/ELSEIF ENDIF
statements.
Control Statements
Simple Conditional Statements
Syntax
IF condition THEN
statementblock1
ENDIF
or
IF condition THEN
statementblock1
ELSE
statementblock2
ENDIF
Remarks
Argument Description
Condition The condition is made up of points and constants, using relational,
logical or arithmetical notation as a test. The condition can evaluate
Boolean state ‘TRUE’ and ‘FALSE’, Integer or Real numbers, or a text
string.
Statementblock1 One or more statements which are performed if the condition is met.
Statementblock2 One or more statements which are performed if the condition is not
met.
Typical Examples
IF fuel < 0 THEN
fuel = 0
ENDIF
Provided Integer point ‘fuel’ is less than 0, then it is assigned the value 0.
IF burner THEN
fuel = fuel - rate
ENDIF
Provided Boolean point ‘burner’ is ‘‘TRUE’’, then Integer point ‘fuel’ is assigned a new value. It is also
possible to apply ‘IF burner == TRUE THEN’ as the first line, with identical results.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
IF distance > 630 AND distance < 660 AND lift >= -3 THEN
winner = TRUE
burner = FALSE
ENDIF
Provided that Integer point ‘distance’ is greater in value than 630 AND ‘distance’ is less in value than
660 (i.e. ‘distance’ is a value between 630 and 660) AND point ‘lift’ is greater than or equal to -3, then
Boolean points ‘winner’ and ‘burner’ are assigned new values.
IF burner AND fuel > 0 AND rate > 0 THEN
fuel = fuel - rate
ELSE
lift = 0
altitude = 0
ENDIF
Provided that Boolean point ’burner’ is ‘‘TRUE’’ AND points ‘fuel’ and ‘rate’ are greater in value than 0,
then ‘fuel’ is assigned a new value. Otherwise points ‘lift’ and ‘altitude’ are assigned a new value.
References
Refer to chapter 2, Indentation for details on the layout of code.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
IF conditionA THEN
statementblock1
ELSEIF conditionB THEN
statementblock3
ENDIF
or
IF conditionA THEN
statementblock1
ELSE
statementblock2
IF conditionB THEN
statementblock3
ELSE
statementblock4
ENDIF
ENDIF
Remarks
Argument Description
conditionA The condition is made up of points and constants, using relational,
logical or arithmetical notation as a test. The condition can evaluate
Boolean state ‘TRUE’ and ‘FALSE’, Integer or Real numbers, or a text
string.
conditionB This condition is nested in the first condition, either on a successful or
unsuccessful evaluation of conditionA. The condition is made up of
points and constants, using relational, logical or arithmetical notation
as a test. The condition can evaluate Boolean state ‘TRUE’ and
‘FALSE’, Integer or Real numbers, or a text string. There is no limit to
the number of nested conditional statements.
statementblock1 One or more statements which are performed if conditionA is met.
statementblock2 One or more statements which are performed if conditionA is not met.
statementblock3 One or more statements which are performed if conditionB is met.
statementblock4 One or more statements which are performed if conditionB is not met.
Typical Examples
IF burner AND fuel > 0 AND rate > 0 THEN
lift = lift + rate/5
ELSE
count = 1
IF altitude > 140 THEN
lift = lift - 0.2
ENDIF
ENDIF
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Provided a successful evaluation has been made to points ‘burner’ AND ‘fuel’ AND ‘rate’, point ‘lift’ is
updated with the current value of rate divided by 5 plus ‘lift’. Otherwise, a further evaluation is
required on point ‘altitude’. If ‘altitude’ is currently greater than 140, then ‘lift’ is decremented by 0.2.
IF burner AND fuel > 0 AND rate > 0 THEN
lift = lift + rate/5
ELSE
IF altitude > 140 THEN
lift = lift - 0.2
ENDIF
ENDIF
IF burner AND fuel > 0 AND rate > 0 THEN
lift = lift + rate/5
ELSEIF altitude > 140 THEN
lift = lift - 0.2
ENDIF
These two examples are identical. The use of the ELSEIF statement combines the ELSE statement
and the IF/ENDIF statements for brevity. It is acceptable to have more than one ELSEIF statement in
an IF THEN ELSE/ELSEIF ENDIF construct.
References
Refer to chapter 4, Punctuation for details of the use of indentation.
Case Select
Syntax
SELECT CASE expression
CASE expression
statementblock1
CASE expression
statementblock2
CASE expression
statementblock3
END SELECT
or
SELECT CASE expression
CASE expression
statementblock1
CASE expression
statementblock2
CASE ELSE
statementblock3
END SELECT
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Argument Description
expression The expression may be a point, or a calculation of constants and/or
points that produces a result.
statementblock1 One or more statements that are only performed if the preceding
CASE expression is met.
statementblock2 One or more statements that are only performed if the preceding
CASE expression is met.
statementblock3 One or more statements that are only performed if the preceding
CASE expression is met.
Typical Examples
SELECT CASE colourvalue
CASE 1
colour (blue)
CASE 2
colour (green)
CASE 3
colour (cyan)
CASE ELSE
colour (0)
END SELECT
This example shows the assignment of a colour according to the value of a point. The value of Integer
point ‘colourvalue’ is evaluated and compared with each case until a match is found. When a match is
found, the sequence of actions associated with the CASE statement is performed. When ‘colourvalue’
is 1, the colour given to the current object is blue, when ‘colourvalue’ is 2, the colour given to the
current object is green, when ‘colourvalue’ is 3, the colour given to the current object is cyan. If
‘colourvalue’ falls outside the integer range 1—3, then the colour given is 0 (black). Like ELSE and
ELSEIF, the CASE ELSE statement is optional.
SELECT CASE TRUE
CASE temperature > 0 AND temperature <= 10
colour (blue)
CASE temperature > 10 AND temperature <= 20
colour (green)
CASE temperature > 20 AND temperature <= 30
colour (red)
CASE ELSE
colour (white)
ENDSELECT
In this example, instead of using a point as the condition as with the previous example, the value is the
condition — in this case Boolean state ‘‘TRUE’’ — with the integer point ‘temperature’ being tested at
each case. If it is ‘‘TRUE’’ that ‘temperature’ is between 0 and 10, then the current object is set to
blue, or if it is ‘‘TRUE’’ that ‘temperature’ is between 11 and 20, then the current object is set to green,
or if it is ‘‘TRUE’’ that ‘temperature’ is between 21 and 30, then the current object is set to red. If none
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
of these CASE statements are met, then the current object is set to white. Like ELSE and ELSEIF,
the CASE ELSE statement is optional.
References
Refer to chapter 4, Object Commands for details of applying attributes to an object and for the use of
the Colour object command. Refer to chapter 6, Colour Palette for details of the Colour Palette colour
designation.
Remarks
Argument Description
pointname The pointname to be used as the loop counter.
startpt The initial setting of pointname, and the first value to be used through
the loop.
endpt The last value to be used. The loop ends when pointname exceeds
this value.
steppt Amount to increase pointname by every pass of the loop. Steppt can
be negative to count backwards providing startpt is larger than endpt.
The STEP keyword and variable may be omitted in which case
pointname is incremented at each pass of the loop (identical to adding
STEP 1).
Typical Examples
FOR loopcount = 0 TO 100
RECTANGLE_1.vertical%fill = loopcount
NEXT
In this example, ‘RECTANGLE_1’ is gradually filled 100 times.
FOR loopcount = 100 TO 0 STEP -5
Ellipse_1.vertical%fill = loopcount
NEXT
In this example, the fill for ‘Ellipse_1’ is gradually removed 20 times (100 times/-5).
Note: Loop statements should be used with caution, as they consume processor time while
they are running and some other parts of the system may not be updated.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DO WHILE/UNTIL Loop
Syntax
DO WHILE expression
statementblock
LOOP
or
DO
statementblock
LOOP WHILE expression
or
DO UNTIL expression
statementblock
LOOP
or
DO
statementblock
LOOP UNTIL expression
Remarks
Argument Description
expression The expression may be a point, or a calculation of constants and/or
points that produces a result.
statementblock One or more statements to be executed multiple times depending on
expression.
Typical Example
DO WHILE dooropen == TRUE
Message (“You must shut the door before continuing”)
LOOP
DO
nextchar = Mid (Mystring, position, 1)
position = position + 1
LOOP UNTIL nextchar = “A”
Note: Loop statements should be used with caution, as they consume processor time while
they are running and some other parts of the system may not be updated.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Subroutines
Call
Syntax
CALL subroutine (arguments)
Remarks
Argument Description
subroutine The name of the subroutine defined at project level.
arguments The list of arguments required by the subroutine separated by
commas. Each argument may be a pointname, constant, arithmetical
or logical expression or any valid combination.
Typical Example
CALL MySub ($Second, “Default”, 2 + Int1)
Return
Syntax
RETURN
Typical Example
IF limit > 1000 THEN
RETURN
ELSE
value = limit
ENDIF
REM final part of script
POLYGON_1.COLOUR = red
ELLIPSE_5.WIDTH = value
The integer point ‘limit’ is tested for its value. If its value exceeds 1000, then the condition is met, and
the RETURN command is executed. All statements after the RETURN command are ignored. If the
value of integer point ‘limit’ does not exceed 1000, then the RETURN command is not executed, and
statements after the RETURN command are performed.
References
Refer to the CX-Supervisor User Manual for the use of the RETURN statement for Recipe validation.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Object Commands
Current Object
Syntax
objectcommand
Remarks
Argument Description
objectcommand • The expression can be made up of the following commands,
which are also described in chapter 4, Object Commands:
• Colour command.
• Disable command.
• Visible command.
• Move command.
• Rotate command.
• Vertical fill command.
• Horizontal fill command.
• Height command.
• Width command.
The content of the commands are made up of arithmetical or logical
expressions, x and y co-ordinates, or references, varying between
commands. The colour command requires a colour identifier.
Typical Example
colour (red)
The current object is specified as red in colour.
References
Refer to:
♦ Chapter 4, Blink for use of the blink command.
♦ Chapter 4, Colour for use of the colour command.
♦ Chapter 4, Disable for use of the disable command.
♦ Chapter 4, Height for use of the height command.
♦ Chapter 4, Horizontal Fill for use of the horizontal fill command.
♦ Chapter 4, Move for use of the move command.
♦ Chapter 4, Rotate for use of the rotate command.
♦ Chapter 4,Vertical Fill for use of the vertical fill command.
♦ Chapter 4, Visible for use of the visible command.
♦ Chapter 4, Width for use of the width command.
♦ The CX-Supervisor User Manual for details of the Animation Editor.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Other Objects
Syntax
objectname.objectcommand
pagename.objectname.objectcommand
Remarks
Argument Description
objectname This is the name of the object. The object is provided with a generic
name on creation, which can be amended later to something more
meaningful. The script is automatically updated following any
amendment to the object name.
objectcommand This can be made up of the following commands, which are described
in chapter 4, Object Commends:
• Blink command
• Colour command.
• Disable command.
• Visible command.
• Move command.
• Rotate command.
• Vertical fill command.
• Horizontal fill command.
• Height command.
• Width command.
The content of the commands are made up arithmetical or logical
expressions, x and y co-ordinates, or references, varying between
commands. The colour command requires a colour identifier.
Typical Examples
POLYGON_1.colour (red)
POLYGON_1.colour = red
The specified object, ‘POLYGON_1’ is set to be red in colour.
References
Refer to:
♦ CX-Supervisor User Manual for details of object names.
♦ Chapter 4, Blink for use of the blink command.
♦ Chapter 4, Colour for use of the colour command.
♦ Chapter 4, Disable for use of the disable command.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Blink
Syntax
objectname.blink (colour, status)
Remarks
Argument Description
objectname This is the name of the object. Where a script is directly attached to
an object, objectname is not required.
colour Colour to blink to. Some colour values within the colour palette have a
meaningful colourID. This takes the form of the colour name, e.g.,
‘black’ or ‘yellow’. Alternatively, an integer value of 0x1000000 can be
added to a number 0-65 to select a palette entry.
status This argument may be omitted. May be on of:
TRUE – turn blinking On.
FALSE – turn blinking Off.
If omitted, TRUE is assumed.
Typical Examples
blink (red, TRUE)
Start blinking red.
LINE_1.blink(OxFFFFOO, status)
The object LINE_1 starts or stops blinking yellow depending on value of Boolean point ‘status’.
Colour
Syntax
objectname.colour (expression, context)
colour (expression, context)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
or
objectname.colour (colourID, context)
colour (colourID, context)
An equals sign may be used as an alternative to brackets:
objectname.colour = expression
colour = expression
or
objectname.colour = colourID
colour = expression
Either spelling ‘colour’ or ‘color’ is acceptable.
Note: An equals sign may also be used for most other object commands, even if it is not directly
specified in this manual.
Remarks
Argument Description
objectname This is the name of the object. Where a script is directly attached to
an object, objectname is not required.
expression The expression may be an Integer point, or a calculation of constants
and/or points that produce an Integer value between 0 and 16777215.
This is the desired colour’s RGB value. (format is 0xBBGGRR).
colourID Some colour values within the colour palette have a meaningful
colourID. This takes the form of the colour name, e.g., ‘black’ or
‘yellow’. Alternatively, an integer value of 0x1000000 can be added to
a number 0-65 to select a palette entry.
context This argument is optional an may be omitted. It defines which part of
the object has it’s colour changed. May be one or more of:
@FILL – change fill colour
@FRAME – changes frame colour
If omitted both are changed. Equivalent to @FILL | @FRAME
Typical Examples
TEXT_3.colour (blue)
or
TEXT_3.colour = blue
The object ‘TEXT_3’ is set to blue.
BALL.color (35 + 0x1000000)
The object ‘BALL’ is set to colour 35 from the colour palette.
BALL.colour (0xFF0000,@FILL)
The object ‘BALL’ is set to blue.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
References
Refer to chapter 6, Colour Palette for details of colour names and colour numbers.
Disable
Syntax
objectname.disable (expression)
Remarks
Argument Description
objectname This is the name of the selectable object. Where a script is directly
attached to an object, objectname is not required.
expression The expression can be made up of points resulting in ‘TRUE’ or
‘FALSE’.
Typical Examples
disable (TRUE)
The current pushbutton object to which this example applies is disabled.
PUSH_8.disable (count AND flag)
The selectable object ‘PUSH_8’ is disabled provided Integer point ‘count’ AND Boolean point ‘flag’
return ‘‘TRUE’’.
Height
Syntax
objectname.height (expression, context)
objectname.height = expression
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Argument Description
objectname This is the name of the object, following any amendment to the object
name. Where a script is directly attached to an object, objectname is
not required.
expression This is a value, point or an arithmetic expression returning a new
height value in pixels.
context This argument is optional and may be omitted. It defines which part of
the object is the datum, and remains static. May be one of:
@TOP – uses object top as datum.
@CENTRE – uses object centre as datum
@BOTTOM – uses object bottom as datum
If omitted @CENTRE is assumed
Typical Examples
height (100)
or
height = 100
The height of the current object is set to 100.
LINE_1.height (stretch/offset, @top)
The height of object ‘LINE_1’ is changed to the value calculated by points ‘stretch’ and ‘offset’,
keeping the top where it is.
Horizontal Fill
Syntax
objectname.horizontal%fill (expression, context)
Remarks
Argument Description
objectname This is the name of the object. Where a script is directly attached to
an object, objectname is not required.
expression This is an arithmetic expression that must return a value between 0
and 100. On return of a valid result, the fill commences from left to
right.
context This argument is optional and may be omitted. It defines which side of
the object is filled from. May be one of:
@LEFT – fill from the left
@RIGHT – fill from the right
If omitted, @LEFT is assumed
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Examples
horizontal%fill (50)
The current object to which this example applies is filled by 50%.
ELLIPSE_1.horizontal%fill (GAS_LEVEL, @RIGHT)
The object ‘ELLIPSE_1’ is filled from the right, provided the point ‘GAS_LEVEL’ returns a valid result,
between 0 and 100.
Move
Syntax
objectname.move (x co-ordinate, y co-ordinate)
Remarks
Argument Description
objectname This is the name of the object. following any amendment to the object
name. Where a script is directly attached to an object, objectname is
not required.
x co-ordinate The x and y co-ordinates of the origin of the object at its resultant
y co-ordinate position in pixels are specified in the form (x, y). Points alone or as
part of an arithmetic expression may be used as a basis for this
expression.
Typical Examples
move (100, 200)
The current object to which this example applies is moved to the specified position.
POLYGON_1.move (xpos, ypos/5)
The object ‘POLYGON_1’ is moved to the position specified by points ‘xpos’ and ‘ypos’ divided by 5.
Rotate
Syntax
objectname.rotate (angle, context, fixed, xcoord, ycoord)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Argument Description
objectname This is the name of the object. Where a script is directly attached to
an object, objectname is not required.
angle The angle of rotation can range between 0 to 360 in a clockwise
direction. Points alone, or as part of an arithmetic expression may be
used as an angle.
context This argument is not required and may be omitted. May be one of:
@TOPLEFT – rotate around top left of object
@TOPCENTRE –rotate around top centre of object
@TOPRIGHT – rotate around top right of object
@CENTRELEFT – rotate around centre left of object
@CENTRE – rotate around centre of object
@CENTRERIGHT – rotate around centre right of object
@BOTTOMLEFT – rotate around bottom left of object
@BOTTEMCENTRE – rotate around bottom centre of object
@ BOTTOMRIGHT – rotate around bottom right of object
@USERDEFINED – user defined point specified in xcoord and ycoord.
fixed This argument may be omitted. If this boolean value is true, the
rotation origin is fixed to the screen, even if the object is moved.
Otherwise, the rotation origin is relative to object postion.
xcoord Only required if @USERDEFINED is specified. These integer
ycoord variables specify the rotation origin in pixels
Typical Examples
rotate (45)
The current object to which this example applies is rotated by 45°.
RECTANGLE_1.rotate(tilt, @USERDEFINED, 0, -100, 10)
The object ‘RECTANGLE_1’ is rotated by the value of ‘tilt’, abount a point –100, 10 relative to the
objects current posiotion.
rotate (a * sin(b))
The current object is rotated based on the result of an arithmetic expression involving points named ‘a
and ‘b’.
Vertical Fill
Syntax
objectname.vertical%fill (expression, context)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Argument Description
objectname This is the name of the object. Where a script is directly attached to
an object, objectname is not required.
expression This is an arithmetic expression that must return a value between 0
and 100. On return of a valid result, the fill commences from bottom to
top.
context This argument may be omitted. May be one of:
@DOWN – Fill object downwards
@UP – Fill object upwards
If omitted, @UP is assumed
Typical Examples
vertical%fill (50)
The current object to which this example applies is filled by 50%.
ELLIPSE_1.vertical%fill (OIL_QUANTITY, @DOWN)
The object ‘ELLIPSE_1’ is filled provided the point ‘OIL QUANTITY’ returns a valid result, between 0
and 100.
Visible
Syntax
objectname.visible (expression)
Remarks
Argument Description
objectname This is the name of the object. Where a script is directly attached to
an object, objectname is not required.
expression The expression can be made up of points resulting in ‘TRUE’ or
‘FALSE’.
Typical Examples
visible (TRUE)
The current object to which this example applies becomes visible.
POLYLINE_8.visible (count AND flag)
The object ‘POLYLINE_8’ is made visible provided Integer point ‘count’ AND Boolean point ‘flag’
return ‘‘TRUE’’.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Width
Syntax
objectname.width (expression, context)
Remarks
Argument Description
objectname This is the name of the object. Where a script is directly attached to
an object, objectname is not required.
expression This is a value, point or an arithmetic expression returning a new width
value in pixels.
context This argument may be omitted. May be one of:
@LEFT – use left of object as datum.
@CENTRE – use centre of object as datum.
@RIGHT – use right of object as datum.
If omitted, @CENTRE is assumed.
Typical Examples
width (150)
The width of the current object is set to 150.
LINE_1.width (squeeze/offset, @RIGHT)
The width of object ‘LINE_1’ is changed to the value calculated by points ‘squeeze’ and ‘offset’,
keeping the rightmost point fixed.
Page Commands
Display Page
Syntax
display ("pagename")
Remarks
Argument Description
pagename This is the name of the page for display, based on its filename without
the file extension, e.g. the pagename for CAR.PAG is simply ‘CAR’.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Examples
display ("CAR")
The page ‘CAR.PAG’ is displayed.
textpoint = “CAR”
display(textpoint)
The page ‘CAR.PAG’ is displayed.
Close Page
Syntax
close ("pagename")
Remarks
Argument Description
pagename This is the name of the page for closure, based on its filename without
the file extension, e.g. the pagename for CAR.PAG is simply ‘CAR’.
The pagename for closure must be currently open.
Typical Examples
close("CAR")
The page ‘CAR.PAG’ is closed.
textpoint = “CAR”
close(textpoint)
The page ‘CAR.PAG’ is closed.
General Commands
Exponential
Syntax
result = Exp (value, exponent)
Remarks
Argument Description
result Point name to receive returned result of value raised to the power of
exponent.
value Number to raise.
exponent Power to raise value by.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
MSBMask = Exp (2, 15)
15
In this example, ‘MSBMask’ is assigned the value 2 , i.e. 32,768.
PlayOLE
Syntax
returnstate = PlayOLE(“objectname”,OLEVerbNumber)
Remarks
Typical Example
PlayOLE(“ole_1”,0)
The object ‘ole_1’ is played using its primary verb.
PlaySound
Syntax
returnstate = PlaySound(“soundfile”)
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
PlaySound(“c:\noise.wav”)
The soundfile “c:\noise.wav” is played.
Rand
Syntax
pointname = Rand(upperlimit)
Remarks
Typical Example
randomnumber = Rand(upperlimit)
A random integer in the range 0 to upperlimit is returned and contained in the point ‘randomnumber’.
Maximum upperlimit is 32767.
Note: If ‘upperlimit’ is negative then the range is 0 to the negative number.
RunApplication
Syntax
returnstate = RunApplication(“executable”)
Remarks
Typical Example
RunApplication(“c:\myprog.exe”)
The executable file c:\myprog.exe is run.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
RunHelp
Syntax
returnstate = RunHelp(“helpfile”,helpindex)
Remarks
Typical Example
RunHelp(“c:\myhelp.hlp”,0)
The helpfile c:\myhelp.hlp is run, and topic 0 shown.
ShutDown
Syntax
returnstate = ShutDown()
Remarks
Typical Example
ShutDown()
CX-Supervisor runtime operation is terminated.
Sleep
Syntax
Sleep (duration)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
Sleep (1000)
CX-Supervisor waits 1 second.
Note: The sleep statement should be used with caution, as some other parts of the system
may not be updated while a script is sleeping.
Communications Commands
CloseComponent
Syntax
Returnstate = CloseComponent(ComponentName, PLCName)
Remarks
Typical Examples
CloseComponent(“PLC Data Monitor”, “MyPLC”)
In this example, the PLC Data Monitor component monitoring the PLC ‘MyPLC’ is closed.
Component = “Performance Monitor”
PLC = “PLC06”
OK = CloseComponent(Component, PLC)
In this example, the Performance Monitor component monitoring the PLC ‘PLC06’ is closed. ‘OK’ is
used to determine if the action was successful.
EnableDDE
Syntax
returnstate = EnableDDE(pointname)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
EnableDDE(result)
DDE functions are enabled based on the value of point ‘result’. If ‘point’ is ‘TRUE’, then DDE is
enabled, if ‘point’ is ‘FALSE’, then DDE is disabled.
EnableDDE(TRUE)
DDE functions can also be enabled directly without using a point to hold the desired status.
EnableOLE
Syntax
returnstate = EnableOLE(pointname)
Remarks
Typical Examples
EnableOLE(result)
OLE functions are enabled based on the value of point ‘result’. If result is ‘TRUE’, then OLE is
enabled. If result is ‘FALSE’, then OLE is disabled.
EnableOLE(TRUE)
OLE functions can also be enabled directly without using a point to hold the desired status.
EnablePLC
Syntax
returnstate = EnablePLC(pointname)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
EnablePLC(result)
PLC functions are enabled based on the value of point ‘result’. If result is ‘TRUE’, then PLC functions
are enabled. If result is ‘FALSE’, then they are disabled.
EnablePLC(TRUE)
PLC functions can also be enabled directly without using a point to hold the desired status.
OpenComponent
Syntax
Returnstate = OpenComponent(ComponentName, PLCName)
Remarks
Typical Examples
OpenComponent(“PLC Data Monitor”, “MyPLC”)
In this example, the PLC Data Monitor component monitoring the PLC ‘MyPLC’ is opened.
Component = “Performance Monitor”
PLC = “PLC06”
OK = OpenComponent(Component, PLC)
In this example, the Performance Monitor component monitoring the PLC ‘PLC06’ is opened. ‘OK’ is
used to determine if the action was successful.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Point Commands
CancelForce
Syntax
returnstate = CancelForce(pointname)
Remarks
Typical Example
CancelForce(point1)
The forcing of values on the point ‘point1’ is cancelled.
References
Refer to PLC operation manuals for a detailed description of Force Set, and Force Reset.
CopyArray
Syntax
CopyArray (SourceArray, DestArray)
Remarks
Typical Example
InitArray (DestArray, 0)
First initialise ‘DestArray’.
SourceArray [0] = 1
SourceArray [1] = 2
SourceArray [2] = 3
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DisableGroup
Syntax
returnstate = DisableGroup(groupname)
Remarks
Typical Example
DisableGroup(“<Default>“)
All points belonging to the <Default> group is disabled thus preventing values from being read\written.
DisablePoint
Syntax
returnstate = DisablePoint(pointname)
Remarks
Typical Example
DisablePoint(point1)
The point ‘point1’ is disabled thus preventing values to be read/written.
Note: This is useful for optimisation of communications.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
EnableGroup
Syntax
returnstate = EnableGroup(groupname)
Remarks
Typical Example
EnableGroup(“<Default>“)
All points belonging to the ‘<Default>’ group is enabled thus allowing values to be read\written.
EnablePoint
Syntax
returnstate = EnablePoint(pointname)
Remarks
Typical Example
EnablePoint(point1)
The point ‘point1’ is enabled thus allowing values to be read/written.
Force
Syntax
returnstate = Force(pointname)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
Force(point1)
The point ‘point1’ is locked in its current state. i.e. if it is currently set to 1 it cannot be changed until
the forced state is removed via the CancelForce command.
ForceReset
Syntax
returnstate = ForceReset(pointname)
Remarks
Typical Example
ForceReset(point1)
The Boolean point ‘point1’ has its value set to ‘FALSE’.
References
Refer to PLC operation manuals for a detailed description of ForceSet, and ForceReset.
ForceSet
Syntax
returnstate = ForceSet(pointname)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
ForceSet(point1)
The Boolean point ‘point1’ has its value set to ‘TRUE’.
References
Refer to PLC operation manuals for a detailed description of Force Set, and Force Reset.
GetBit
Syntax
returnpoint = GetBit(pointname,bit)
Remarks
Typical Example
pointname = 256;
returnpoint = GetBit(pointname,8)
The point ‘returnpoint’ contains ‘TRUE’.
GetPointValue
Syntax
returnpoint = GetPointValue(pointname,offset)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
pointname = 10;
returnpoint = GetPointValue(pointname,0)
The point ‘returnpoint’ contains the value 10. The offset is added to any offset specified for
pointname. For example:
returnpoint = GetPointValue(a[10],10)
Causes the 21st element (offsets begin at zero) of array ‘a’ to be retrieved.
Note: It is often simpler to access an array element directly, e.g. returnpoint = a[20].
InitialiseArray
Syntax
InitArray (arrayname, value)
Remarks
Typical Example
InitArray (MyArray, 0)
In this example, all elements of the array ‘MyArray’ are set to 0.
InputPoint
Syntax
returnstate = InputPoint(pointname, returnflag)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
InputPoint(point)
returnflag = FALSE
InputPoint(point, returnflag)
A request is made that the current value of point ‘point’ should be read. In the second example,
returnflag is set to ‘TRUE’ when the value is returned from the PLC.
Note: The value is not returned immediately - it is not possible to use the returned value in the
same script as the InputPoint command. Instead, the value should be accessed from
within an “On Condition” script which has an expression of ‘returnflag = TRUE’.
OutputPoint
Syntax
returnstate = OutputPoint(pointname)
Remarks
Typical Examples
OutputPoint(result)
The point ‘result’ is updated with its current value.
Note: The value of a point connected to a PLC is not be set if the point is currently in a
“forced” state.
PointExists
Syntax
returnpoint = PointExists(pointname)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
PointName=“Testpoint”
Exists=PointExists(PointName)
The Boolean point ‘Exists’ is set to ‘TRUE’ if a point called ‘TestPoint’ exists.
Note: “PointName” is a text point which can be set to any string value.
SetBit
Syntax
returnstate = SetBit(pointname,bit,value)
Remarks
Typical Example
testpoint = 0;
SetBit(testpoint,4,TRUE)
The point ‘testpoint’ contains the value 16.
SetPointValue
Syntax
returnstate = SetPointValue(pointname,offset,value)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
SetPointValue(value,0,10)
The point ‘value’ contains the value 10.
Note: The value of a point connected to a PLC is not set if the point is currently in a “forced”
state.
The offset is added to any offset specified for pointname. For instance:
SetPointValue(a[10],10,100)
Causes the 21st element (offsets begin at zero) of array ‘a’ to be set to 100. It is often simpler to
access an array element directly, for instance:
a[20] = 100
PLC Commands
ClosePLC
Syntax
returnstate = ClosePLC(“plcname”)
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
ClosePLC(“controlPLC”)
The PLC called controlPLC is closed. No further communications with the PLC will take place until it
is reopened.
DownloadPLCProgram
Syntax
returnstate = DownloadPLCProgram(plcname, filename, processed)
Remarks
Typical Example
DownloadPLCProgram(“controlPLC”, “Prog01.bin”, done)
DO UNTIL done or timeout > 5
Sleep(10)
timeout += 0.01
LOOP
The program stored in the file ‘Prog01.bin’ in the current directory is downloaded to the PLC
‘controlPLC’. Before continuing, the script waits up to five seconds for the action to succeed.
Note: The operation may not be complete immediately after the statement has been
executed. The processed flag ‘done’ is set at a later time when the operation has been
completed. Therefore, if using statements that require the upload to be completed,
either wait for the flag to be set (as shown) or create an On Condition script containing
the code to be executed after the upload, with the processed flag as the expression
(e.g. ‘done’).
Note: This command can only be used when the PLC is in ‘STOP’ mode. Refer to chapter 4,
GetPLCMode or chapter 4, SetPLCMode for further information.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
GetPLCMode
Syntax
mode = GetPLCMode(“plcname”)
Remarks
Typical Example
currentmode = GetPLCMode(“controlPLC”)
In this example, the current mode of the PLC ‘controlPLC’ is stored in the point ‘currentmode’.
OpenPLC
Syntax
Returnstate = OpenPLC(“plcname”, processed)
Remarks
Typical Example
OpenPLC(“controlPLC”, doneopen
DO UNTIL doneopen or timeout > 5
Sleep(10)
timeout += 0.01
LOOP
The PLC called controlPLC is opened for communication.
Note that the PLC may not be opened immediately after the statement has been executed. The
processed flag will be set at a later time when the operation has been completed. Therefore, if using
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
statements which require the operation to be completed, either wait for the flag to be set as shown
above, or create an On Condition script containing the code to be executed after the PLC is opened
with the ‘processed' flag as the expression (this is generally more efficient).
PLCCommsFailed
Syntax
returnstate = PLCCommsFailed(“plcname”)
Remarks
Typical Example
IsFailing = PLCCommsFailed (“controlPLC”)
The point IsFailing is set to true if the PLC called controlPLC is currently not communicating.
Otherwise it is set to false.
Note: This function returns to TRUE from the time when a communications timeout error with
the named PLC occurs, until successful communication with the PLC takes place.
PLCMonitor
Syntax
returnstate = PLCMonitor(“plcname”)
Remarks
Typical Example
PLCMonitor(“controlPLC”)
The monitor dialog for the PLC called controlPLC is invoked. This dialog can be used to check PLC
status, change mode, etc.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
SetPLCMode
Syntax
returnstate = SetPLCMode(“plcname”, mode, processed)
Remarks
Typical Examples
SetPLCMode(“controlPLC”, “STOP”, done)
DO UNTIL done or timeout > 5
Sleep(10)
timeout += 0.01
LOOP
In this example, the mode of the PLC called ‘controlPLC’ is changed to “STOP”. Before continuing,
the script waits up to five seconds for the action to succeed.
Note: The mode may not be changed immediately after the statement has been executed.
The processed flag ‘done’ is set at a later time when the operation has been completed.
Therefore, if using statements that require the operation to be completed, either wait for
the flag to be set (as shown) or create an On Condition script containing the code to be
executed after the mode is set, with the processed flag as the expression (e.g. ‘done’).
SetPLCPhoneNumber
Syntax
Returnstate = SetPLCPhoneNumber(“plcname”, numbertext)
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
SetPLCPhoneNumber(“controlPLC”, “01234 987654”)
The phone number for the PLC is changed to the required value.
UploadPLCProgram
Syntax
returnstate = UploadPLCProgram(plcname, filename, processed)
Remarks
Typical Example
UploadPLCProgram(“controlPLC”, “Prog01.bin”, done)
DO UNTIL done or timeout > 5
Sleep(10)
timeout += 0.01
LOOP
The program in the PLC ‘controlPLC’ is uploaded to the file ‘Prog01.bin’ in the current directory.
Before continuing, the script waits up to five seconds for the action to succeed.
Note: The operation may not be complete immediately after the statement has been
executed. The processed flag ‘done’ is set at a later time when the operation has been
completed. Therefore, if using statements that require the upload to be completed,
either wait for the flag to be set (as shown) or create an On Condition script containing
the code to be executed after the upload, with the processed flag as the expression
(e.g. ‘done’).
Note: This command can only be used when the PLC is in ‘STOP’ mode. Refer to chapter 4,
GetPLCMode or chapter 4, SetPLCMode for further information.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
temp1 = TCAutoTune(“e5ak”,temp2)
TCBackupMode
Syntax
returnstate = TCBackupMode(TController,mode)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
temp1 = TCBackupMode(“ea5k”,temp2)
TCGetStatusParameter
Syntax
returnstate = TCGetStatusParameter(TController,paramID,value)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
temp1 = TcGetStatusParameter(“e5ak”,temp2,temp3)
TCRemoteLocal
Syntax
returnstate = TCRemoteLocal(TController,mode)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
temp1 = TCRemoteLocal(“e5ak”,temp2)
Note: This command was previously called TCOperationalMode.
TCRequestStatus
Syntax
returnstate = TCRequestStatus(Tcontroller, returnflag)
Remarks
Typical Example
temp1 = TCRequestStatus(“e5ak”, temp2)
Note: The status information is NOT returned immediately - it is not possible to access the
status information in the same script as the TCRequestStatus command. Instead, the
status information should be accessed from within an “On Condition” script which has
an expression of “returnflag == TRUE”.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
TCRspLsp
Syntax
returnstate = TCRspLsp(Tcontroller,mode)
Remarks
Typical Example
temp1 = TCRspLsp(“e5ak”,temp2)
Note: This command was previously called TCSetpoint.
TCRunStop
Syntax
returnstate = TCRunStop(TController,mode)
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
temp1 = TCRunStop(“e5ak”,temp2)
Note: This command was previously called TCModeShift.
TCSaveData
Syntax
returnstate = TCSaveData(TController)
Remarks
Typical Example
temp1 = TCSaveData(“e5ak”,temp2)
TCSettingLevel1
Syntax
returnstate = TCSettingLevel1(TController)
Remarks
Typical Example
temp1 = TCSettingLevel1(“e5ak”)
TCReset
Syntax
returnstate = TCReset(TController)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
temp1 = TCReset(“e5ak”)
DDE Commands
DDEExecute
Syntax
returnstate = DDEExecute(channel, {command})
Remarks
Typical Example
channelname = DDEInitiate("Excel", "Sheet1.xls")
DDEExecute(channelname, {[OPEN("C:\EXCEL\WORK\SHEET2.XLS")]})
The file ‘SHEET2.XLS’ within path ‘C:\EXCEL\WORK’ is opened in Microsoft Excel, as specified by
the Integer point ‘channelname’. The file ‘SHEET1.XLS’ is already open in Microsoft Excel.
DDEInitiate
Syntax
channel = DDEInitiate("server", topic")
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
channelname = DDEInitiate("Excel", "Sheet1.xls")
The Integer point ‘channelname’ is provided with a DDE link to the application Microsoft Excel which is
run by the executable filename ‘EXCEL.EXE’, and to the file ‘SHEET1.XLS’ within that application.
DDEOpenLinks
Syntax
returnstate = DDEOpenLinks(channel)
Remarks
Typical Example
channelname = DDEInitiate("Excel", "Sheet1.xls")
DDEOpenLinks(channelname)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
The DDEOpenLinks command enables points which have been configured to communicate via DDE
to begin data transfer. Data transfer between CX-Supervisor and the application Microsoft Excel is
automatically maintained until the channel is closed either by Microsoft Excel or by the command
DDETerminate() using the Integer point ‘channelname’, or the command DDETerminateAll().
DDEPoke
Syntax
returnstate = DDEPoke(channel, "item", pointname)
Remarks
Typical Example
channelname = DDEInitiate("Excel", "Sheet1.xls")
DDEPoke(channelname, "R2C5", data)
The content of point ‘data’ is sent to row 2, column 5 of ‘SHEET1.XLS’ in the Microsoft Excel
application. The Microsoft Excel application, and ‘SHEET1.XLS’ are specified by Integer point
‘channelname’.
References
Refer to the CX-Supervisor User Manual for details of DDE Access.
DDERequest
Syntax
pointname = DDERequest(channel, "item")
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
channelname = DDEInitiate("Excel", "Sheet1.xls")
cellref = DDERequest(“channelname”, "R2C5")
The point ‘cellref’ is filled from a specific item, row 2, column 5 from ‘SHEET1.XLS’ from the Microsoft
Excel application, specified by the Integer point ‘channelname’.
References
Refer to the CX-Supervisor User Manual for details of DDE Access.
DDETerminate
Syntax
returnstate = DDETerminate(channel)
Remarks
Typical Example
DDETerminate(channelname)
The server and topic specified by Integer point ‘channelname’ is closed.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DDETerminateAll
Syntax
returnstate = DDETerminateAll()
Remarks
Typical Example
DDETerminateAll()
All previously initiated DDE links are closed.
Alarm Commands
AcknowledgeAlarm
Syntax
returnstate = AcknowledgeAlarm(“alarmname”)
Remarks
Typical Example
AcknowledgeAlarm(“temphigh”)
The alarm ‘temphigh’ is acknowledged.
References
Refer to the CX-Supervisor User Manual for details of alarms.
AcknowledgeAllAlarms
Syntax
returnstate = AcknowledgeAllAlarms()
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
AcknowledgeAllAlarms()
All alarms are acknowledged.
References
Refer to the CX-Supervisor User Manual for details of alarms.
AcknowledgeLatestAlarm
Syntax
returnstate = AcknowledgeLatestAlarm()
Remarks
Typical Example
AcknowledgeLatestAlarm()
The most current alarm of the highest priority is acknowledged.
References
Refer to the CX-Supervisor User Manual for details of alarms.
ClearAlarmHistory
Syntax
returnstate = ClearAlarmHistory()
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
ClearAlarmHistory()
The alarm history window is cleared and the log is cleared.
References
Refer to the CX-Supervisor User Manual for details of alarms.
CloseAlarmHistory
Syntax
returnstate = CloseAlarmHistory()
Remarks
Typical Example
CloseAlarmHistory()
The alarm history window is closed.
References
Refer to the CX-Supervisor User Manual for details of alarms
CloseAlarmStatus
Syntax
returnstate = CloseAlarmStatus()
Remarks
Typical Example
CloseAlarmStatus()
The current alarm status window is closed.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
References
Refer to the CX-Supervisor User Manual for details of alarms.
DisplayAlarmHistory
Syntax
returnstate = DisplayAlarmHistory()
Remarks
Typical Example
DisplayAlarmHistory()
The alarm history window is displayed.
References
Refer to the CX-Supervisor User Manual for details of alarms.
DisplayAlarmStatus
Syntax
returnstate = DisplayAlarmStatus()
Remarks
Typical Example
DisplayAlarmStatus()
The current alarm status is displayed.
References
Refer to the CX-Supervisor User Manual for details of alarms.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
EnableAlarms
Syntax
EnableAlarms (flag, “message”)
Remarks
Typical Example
EnableAlarms (TRUE, “Alarm logging enabled”)
References
Refer to the CX-Supervisor User Manual for details of alarms.
IsAlarmAcknowledged
Syntax
pointname = IsAlarmAcknowledged("alarmname")
Remarks
Typical Example
acknowledged = IsAlarmAcknowledged("temptoohigh")
The point ‘acknowledged’ is assigned Boolean state ‘‘TRUE’’ if the ‘temptoohigh’ alarm is currently
acknowledged. The point is assigned Boolean state ‘FALSE’ if the alarm is not currently
acknowledged.
References
Refer to the CX-Supervisor User Manual for details of alarms.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
IsAlarmActive
Syntax
pointname = IsAlarmActive("alarmname")
Remarks
Typical Example
active = IsAlarmActive("temptoohigh")
The point ‘active’ is assigned Boolean state ‘‘TRUE’’ if the ‘temptoohigh’ alarm is currently active. The
point is assigned Boolean state ‘FALSE’ if the alarm is not currently active.
References
Refer to the CX-Supervisor User Manual for details of alarms.
File Commands
CloseFile
Syntax
returnstate = CloseFile(pointname)
Remarks
Typical Examples
CloseFile(status)
The currently open file is closed. Blank spaces at the end of each line are stripped from the file if the
Boolean point ‘status’ is set to ‘TRUE’.
CloseFile(FALSE)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
In this example, the currently open file is closed and any blank spaces are not stripped from the file.
Note: If blank spaces are stripped from the file, then it greatly reduces in size but it takes
slightly longer to close. Blank spaces should not be stripped from the file if it is being
used on a network drive by more than one system at a time.
CopyFile
Syntax
returnstate = CopyFile(“sourcename”, “destname”)
Remarks
Typical Example
CopyFile(“c:\autoexec.bat”, “c:\autoexec.old”)
The file “c:\autoexec.bat” is copied to the file “c:\autoexec.old”.
CopyFile(“c:\logging\*.dlv”, “a:\backup”)
The data log files (ending in dlv) in “C:\logging” are copied to the “\backup” directory on drive A:
DeleteFile
Syntax
returnstate = DeleteFile(“filename”)
Remarks
Typical Example
DeleteFile(“c:\pagename.pag”)
The file “c:\pagename.pag” is deleted.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
EditFile
Syntax
returnstate = EditFile(“filename”)
Remarks
Typical Example
EditFile(“C:\report3.txt”)
FileExists
Syntax
returnpoint = FileExists (filename)
Remarks
Typical Example
FileName = “TEST.TXT”
Exists = FileExists(FileName)
The Boolean point ‘Exists’ is set to ‘TRUE’ if a file called ‘C:\TEST.TXT’ exists.
Note: “FileName” is a text point which can be set to any string value.
MoveFile
Syntax
returnstate = MoveFile(“sourcename”, “destname”)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
MoveFile(“c:\autoexec.bat”, “c:\autoexec.old”)
The file “c:\autoexec.bat” is moved to the file “c:\autoexec.old”.
OpenFile
Syntax
returnstate = OpenFile(“filename”)
Remarks
Typical Example
OpenFile(“c:\filename.csf”)
The file “c:\filename.csf” is opened and able to be accessed by the Read() and Write() script
commands. Only one file can be open at a time. Files can be shared (for instance located on a
network drive, and accessed by several running CX-Supervisor applications simultaneously - this can
be used for data exchange).
PrintFile
Syntax
returnstate = PrintFile(“filename”)
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
PrintFile(“c:\autoexec.bat”)
The file “c:\autoexec.bat” is sent to the currently configured printer.
Script commands that have textual arguments can take either literal strings within quotes or text
points.
Note: CX-Supervisor uses the OLE registration information (file extension associations) to
decide how to print a file. It invokes the parent application associated with a particular
file extension, instructing the application to start minimised and passing the “print”
command. For example, if the file extension .txt is associated with Notepad, then
Notepad is invoked to print the file.
Read
Syntax
returnstate = Read(RecordId, pointname, ...)
Remarks
Typical Examples
Read(1, value)
The point ‘value’ is loaded with the value read from the currently open file using the value of 1 as an
index into the file.
ReadOK = Read(indexno, value1, value2, value3)
The points ‘value1’, ‘value2’, ‘value’ are loaded using the value of indexno as an index into the file.
Pass or fail status is stored in ‘ReadOK’.
Note: It is advisable to use a RecordId less than 1024 whenever possible, in order to optimise
file access time (records 0 to 1023 are cached).
ReadMessage
Syntax
returnstate = ReadMessage (“filename”, offset, textpoint, noofchars)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
ReadMessage (“C:\CX-SUPERVISOR\TESTFILE.TXT”, 0, TextPoint, 20)
The first 20 characters are be read from the file “C:\CX-SUPERVISOR\TESTFILE.TXT” and stored in
the point ‘TextPoint’.
Note: Text points can hold up to 256 characters therefore a maximum of 256 characters can
be read from the file.
SelectFile
Syntax
filename = SelectFile (filter, path)
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
TFile = SelectFile()
The ‘File Open’ dialog will be displayed, showing all files in the current working directory. The users
choice will be stored in tFile.
TFile = SelectFile(“Text Files (*.txt)|*.txt||”)
The ‘File Open’ dialog will be displayed, showing just files with a .txt extension in the current working
directory.
TFile = SelectFile(“Text Files (*.txt; *.csv)|*.txt;*.csv||”)
The ‘File Open’ dialog will be displayed, showing files with either a .txt or .csv extension in the current
working directory.
TFile = SelectFile(“Text Files (*.txt;
*.csv)|*.txt;*.csv|Document Files (*.doc)|*.doc||”)
In this example, the ‘Files of type’ filter has 2 choices: one to show text files (i.e. both .txt and .csv
files), and one to show document files (just .doc files).
TFile = SelectFile(“”, “C:\WINDOWS”)
The ‘File Open’ dialog will be displyed, showing all files in the “C:\WINDOWS” directory.
Write
Syntax
returnstate = Write(RecordId, pointname, ...)
Remarks
Typical Examples
WroteOK = Write(indexno, $Second)
The point ‘$Second’ is written to the currently open file using the value of indexno as an index into the
file. Pass or fail status is stored in ‘WroteOK’.
Write(2, $Second, $Minute, $Hour)
The points ‘$Second’, ‘$Minute’, ‘$Hour’ are written to the currently open file using the value 2 as an
index into the file.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Note: It is advisable to use a RecordId less than 1024 whenever possible, in order to optimise
file access time (records 0 to 1023 are cached).
WriteMessage
Syntax
returnstate = WriteMessage(“filename”, offset, “text”, linefeed)
Remarks
Typical Example
WriteMessage(“C:\CX-SUPERVISOR\TESTFILE.TXT”, 0, “Hello World”, TRUE)
The text ‘Hello World’ is written at the start of the ‘C:\CX-SUPERVISOR\TESTFILE.TXT’ file and a
carriage return and line feed is appended which moves and subsequent text to the start of the next
line.
Note: When the text is written into the file it overwrites any existing text that may exist at this
location.
Graph Commands
ClearGraph
Syntax
returnstate = ClearGraph(“graphid”, ”pagename”)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
ClearGraph(“Graph_1”, “TestPage1”)
The trend or scatter graph on ‘TestPage1’ with the identifier ‘Graph_1’ has its data cleared.
ClearGraph (“Graph_2”)
The trend or scatter graph on the current page, with the identifier ‘Graph_2’, has its data cleared.
EditGraph
Syntax
returnstate = EditGraph(“graphid”)
Remarks
Typical Example
EditGraph(“Graph_1”)
The Edit Graph dialog is displayed offering options to view historical data for the chosen trend graph.
♦ Display Data loads the currently selected data sample i.e. either the current screen data or a
snapshot of the data, into the trend graph.
♦ Snapshot stores the current data buffer associated with the trend graph. The snapshot is given a
timestamped default description.
♦ Description provides the ability to change the description associated with the snapshot.
♦ Import Data provides the ability to load in a previously saved trend graph file.
♦ Export Data provides the ability to store a snapshot to a file, either in internal CX-Supervisor
format, or as a text file that can be imported into other applications.
♦ Delete removes the currently selected snapshot.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Note: This command is provided for compatability with SCS v2.0 applications. For newer
applications the data logging facilities should be used in preference.
Note: This command can only be used if the trend is set to log to a file.
SaveGraph
Syntax
returnstate = SaveGraph(“graphid”)
Remarks
Typical Examples
SaveGraph(“Graph_1”, “TestPage1”)
The trend graph on the page ‘TestPage’ with the identifier ‘Graph_1’ has its data saved to disc.
SaveGraph(“Graph_2”)
The trend graph on the current page with the identifier ‘Graph_2’ has its data saved to disc.
Snapshot
Syntax
returnstate = Snapshot(“graphid”, “pagename”)
Remarks
Typical Examples
Snapshot(“Graph_1”, “TestPage1”)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
The current data in trend graph ‘Graph1’ on ‘TestPage1’, is stored and is able to be viewed via the
EditGraph command.
Snapshot(“Graph_2”)
The current data in trend graph ‘Graph1’ on the current page, is stored and is able to be viewed via
the EditGraph command.
Note: This command is provided for compatability with SCS v2.0 applications. For newer
applications the data logging facilities should be used in preference.
StartGraph
Syntax
returnstate = StartGraph(“graphid”, “pagename”)
Remarks
Typical Examples
StartGraph(“Graph_1”, “TestPage1”)
The trend or scatter graph on ‘TestPage1’ with the identifier ‘Graph_1’ has its data logging started.
StartGraph(“Graph_2”)
The trend or scatter graph on the current page with the identifier ‘Graph_2’ has its data logging
started.
Note: This command is provided for compatability with SCS v2.0 applications. For newer
applications the data logging facilities should be used in preference.
StopGraph
Syntax
returnstate = StopGraph(“graphid”, “pagename”)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
StopGraph(“Graph_1”, “TestPage1”)
The trend or scatter graph on ‘TestPage1’ with the identifier ‘Graph_1’ has its data logging stopped.
StopGraph(“Graph_2”)
The trend or scatter graph on the current page with the identifier ‘Graph_2’ has its data logging
stopped.
Recipe Commands
DisplayRecipes
Syntax
returnstate = DisplayRecipes()
Remarks
Typical Example
DisplayRecipes()
The current recipes is displayed.
References
Refer to the CX-Supervisor User Manual for details of recipes.
DownloadRecipe
Syntax
returnstate = DownloadRecipe(“recipename”)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
DownloadRecipe(“recipe1”)
The recipe ‘recipe1’ is downloaded.
References
Refer to the CX-Supervisor User Manual for details of recipes.
UploadRecipe
Syntax
returnstate = UploadRecipe(“recipename”, processed)
Remarks
Typical Example
UploadRecipe(“recipe1”,done)
The recipe ‘recipe1’ is uploaded, and point ‘done’ is set True when the upload is complete.
References
Refer to the CX-Supervisor User Manual for details of recipes.
Report Commands
GenerateReport
Syntax
returnstate =
GenerateReport(ReportTemplateFile,ReportOutputFile)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
GenerateReport(“report3.txt”,“output.txt”)
PrintReport
Syntax
returnstate = Printreport(ReportTemplateFile)
Remarks
Typical Example
PrintReport(“report3.txt”)
The ReportTemplateFile report3.txt contains a predefined set of point names and text laid out exactly
as the report reader likes to view them. The point names contained within enclosing characters are
the CX-Supervisor names for the data that is required in the report.
The enclosing characters can be changed in the Project/Runtime Setting/Report setting dialog box,
but once set must be fixed for all reports generated by the project.
The file can be written using any ASCII text editor, for instance a Text file (.TXT), a Rich Text file
(.RTF) or a Hypertext file (.HTML) .
Examples of the way in which text is changed:
The shift foreman was ((ShiftForeman))
Becomes:
The shift foreman was Fred Smith
The shift output was ((ShiftOutput)) litres
Becomes:
The shift output was 5000 litres
Format specifiers can be used:
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
ViewReport
Syntax
returnstate = ViewReport(ReportTemplateFile)
Remarks
Typical Example
ViewReport(“report3.txt”)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Text Commands
BCD
Syntax
result = BCD (value)
Remarks
Typical Example
BCDStr = BCD(39)
In this example, ‘BCDstr’ contains ‘00111001’.
Bin
Syntax
result = Bin (value)
Remarks
Typical Example
BStr = Bin (20)
In this example, ‘Bstr’ contains ‘10100’.
Chr
Syntax
result = Chr (value)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
Char = Chr(65)
In this example, ‘Char’ contains ‘A’.
FormatText
Syntax
textpoint = FormatText (“formattext”, expression, ...)
Remarks
Typical Examples
TextPoint = FormatText (“Boiler temperature is %ld degrees.”,
BoilerTemp)
The value of the ‘BoilerTemp’ point is inserted into the specified text at the position marked by the
formatting characters (%ld) and then stored in the point ‘TextPoint’.
If the value of ‘BoilerTemp’ was 57 then the resultant text that is stored in ‘TextPoint’ is as follows:
“Boiler temperature is 57 degrees.”
TextPoint = FormatText (“Boiler %ld temperature is %ld degrees.”,
BoilerNo, BoilerTemp)
The value of ‘BoilerNo’ point is inserted at the first ‘%ld’ marker and the value of the ‘BoilerTemp’ point
is inserted at the second ‘%ld’ marker and the resulting string is stored in the point ‘TextPoint’.
If the value of ‘BoilerNo’ was 7 and the value of ‘BoilerTemp’ was 43 then the resultant text stored in
the ‘TextPoint’ is as follows:
“Boiler 7 temperature is 43 degrees.”
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Note: The formatting characters are standard ‘C’ formatting characters (as used by the C-
language sprintf function). Some commonly used types are:
♦ %ld. Insert integer value;
♦ %f. Insert decimal value. Prefix with decimal point and number to control position
(for instance ‘%.2f’ for 2 decimal places);
♦ %s. Insert string;
♦ %IX. Insert hexadecimal value (upper case HEX characters, for instance ‘FFFF’);
♦ %lx. Insert hexadecimal value (lower case HEX characters, for instance ‘ffff’);
♦ %c. Insert character (can be used to convert value to character, for instance to
insert control character).
With the text left aligned, and with a width field (for instance ‘%-6ld’ to insert a value left aligned with a
field 6 characters wide).
References
More complex expressions (for instance controlling justification, decimal places, number base, etc.)
are also possible. Refer to any C language reference book for full details of the format used by the
‘sprintf’ function.
GetTextLength
Syntax
value = GetTextLength (textpoint)
Remarks
Typical Example
textpoint = “Hello World”
count = GetTextLength (textpoint)
The number of characters in ‘textpoint’ is counted and the point ‘count’ is set to the value 11.
Hex
Syntax
result = Hex (value)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
HStr = Hex (44)
In this example, ‘Hstr’ contains ‘2C’.
Left
Syntax
lefttext = Left(textpoint,noofchars)
Remarks
Typical Example
textpoint = “abcdefgh”
lefttext = Left(textpoint,3)
The text point ‘lefttext’ contains the string ‘abc’.
Message
Syntax
Message(“message”)
Remarks
Typical Example
Message(“this is a message”)
The message ‘this is a message’ is displayed in a Message Box.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Mid
Syntax
midtext = Mid(textpoint,offset,noofchars)
Remarks
Typical Example
textpoint = “abcdefgh”
midtext = Mid(textpoint,3,2)
The text point ‘midtext’ contains the string ‘de’.
PrintMessage
Syntax
PrintMessage (“message”)
Remarks
Typical Example
PrintMessage (“Print this message”)
The message ‘print this message’ is printed to the configured ‘Alarm/message printer’, queued if
operating in page mode, or printing has been disabled by the EnablePrinting command.
References
Refer to the CX-Supervisor User Manual for further details to configure the ‘Alarm/message printer’.
Right
Syntax
righttext = Right(textpoint,noofchars)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
textpoint = “abcdefgh”
righttext = Right(textpoint,3)
The text point ‘righttext’ contains the string ‘fgh’.
TextToValue
Syntax
valuepoint = TextToValue(textpoint)
Remarks
Typical Examples
textpoint = “10”
valuepoint = TextToValue(textpoint)
The value 10 is assigned to the point ‘valuepoint’.
textpoint = “10.34”
realpoint = TextToValue(textpoint)
The real value 10.34 is assigned to the real point ‘realpoint’.
ValueToText
Syntax
textpoint = ValueToText(value)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
textpoint = ValueToText(10)
The value 10 is put into a string and assigned to the text point ‘textpoint’.
value = 10
textpoint = ValueToText(value)
This has the same effect as the previous example.
Event/Error Commands
ClearErrorLog
Syntax
ClearErrorLog()
Typical Example
ClearErrorLog()
The error list is cleared and the log deleted.
CloseErrorLog
Syntax
returnstate = CloseErrorLog()
Remarks
Typical Example
CloseErrorLog()
The list of all currently logged errors is closed.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DisplayErrorLog
Syntax
returnstate = DisplayErrorLog()
Remarks
Typical Example
DisplayErrorLog()
A list of all currently logged errors is displayed in a dialog.
EnableErrorLogging
Syntax
returnstate = EnableErrorLogging(pointname)
Remarks
Typical Example
EnableErrorLogging(flag)
Error Logging is enabled based on the Boolean point ‘flag’. If ‘flag’ is ‘TRUE’, then error logging is
enabled. If ‘flag’ is false, then error logging is disabled.
LogError
Syntax
returnstate = LogError(“message”, priority)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
LogError(“This is an error”, 1)
The message ‘This is an error’ appears as a medium priority error in the error log.
LogEvent
Syntax
returnstate = LogEvent(“message”)
Remarks
Typical Example
LogEvent(“this is an event”)
The message ‘this is an event’ appears as an event in the error log.
Printer Commands
ClearSpoolQueue
Syntax
returnstate = ClearSpoolQueue()
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
ClearSpoolQueue()
Any messages (typically printed alarms) that are queued up waiting to be sent to the CX-Supervisor
Alarm/Message printer is discarded.
EnablePrinting
Syntax
returnstate = EnablePrinting(flag)
Remarks
Typical Example
EnablePrinting(FALSE) - Disables printing
EnablePrinting(TRUE) - Enables printing
While alarm printing is disabled, any new messages are stored but not printed. When alarm printing is
re-enabled, any pending messages are printed (if in line mode) or added to the current page (if in
page mode).
GetSpoolCount
Syntax
returnstate = GetSpoolCount()
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
NumberMessages = GetSpoolCount()
The count of the number of messages (typically printed alarms) that are queued up waiting to be sent
to the CX-Supervisor Alarm/Message printer is returned.
PrintActivePage
Syntax
returnstate = PrintActivePage(flag)
Remarks
Typical Example
PrintActivePage(TRUE)
The currently active page is sent to the printer. The flag ‘TRUE’ indicates that the print dialog is
displayed. ‘FALSE’ causes the print dialog not to be shown.
PrintPage
Syntax
returnstate = PrintPage (“pagename”, flag)
Remarks
Typical Example
PrintPage(“page1”, TRUE)
The CX-Supervisor page is sent to the printer. The flag ‘TRUE’ indicates that the print dialog is
displayed first to allow for printer configuration. If ‘FALSE’ was specified instead of ‘TRUE’ then the
print dialog is not shown, the page is just printed.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
PrintScreen
Syntax
returnstate = PrintScreen(flag)
Remarks
Typical Example
PrintScreen(FALSE)
All CX-Supervisor pages currently on view is printed. The flag ‘FALSE’ indicates that the print dialog
is not displayed. A flag of ‘TRUE’ causes the print dialog to be shown, allowing the user to configure
or choose the printer.
PrintSpoolQueue
Syntax
returnstate = PrintspoolQueue()
Remarks
Typical Example
PrintSpoolQueue
Any message (typically printed alarms) that are queued up waiting to be sent to the CX-Supervisor
Alarm/Message printer is printed immediately.
SetPrinterConfig
Syntax
returnstate StePrintConfig(Driver, Device, Port)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
SetPrinterConfig(“SCSPRN”, “”, “LPT1:”)
This uses standard CX-Supervisor line print driver.
SetPrinterConfig(“”, “”, “”)
This uses default Windows printer driver.
SetPrinterConfig(“Epson9”, “”, “LPT2:”)
This uses Epson printer driver, attached to LPT2.
SetPrinterConfig(DriverNamePoint, DeviceNamePoint, PrintNamePoint)
This uses text points.
Terminator = FormatText(“%c%c”,13,10)
Character 10 is 'lf' (newline), character 13 is cr (carriage return).
SetPrinterConfig(“Epson9”,“”,“LPT1:”,Terminator)
Security Commands
Login
Syntax
returnstate = Login()
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
Login()
The Login dialog is displayed for user entry.
References
Refer to the CX-Supervisor User Manual for details of Login.
Logout
Syntax
returnstate = Logout()
Remarks
Typical Example
Logout()
The user is logged out.
References
Refer to the CX-Supervisor User Manual for details of Logout.
Setup Users
Syntax
returnstate = SetupUsers()
Remarks
Typical Example
SetupUsers()
The Setup Users dialog is displayed for user entry.
References
Refer to the CX-Supervisor User Manual for details of setting and modifying user details.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
ClearLogFile("Process 1")
This command will clear all data from the active (latest) log file for this data set, and add a ‘Clear
Event’ indicator.
CloseLogFile
Syntax
CloseLogFile("datasetname")
or
CloseLogFile("databaselink")
Remarks
Typical Example
CloseLogFile("Process 1")
This command will close the active log file for the data set. Logging for this data set is automatically
stopped.
CloseLogView
Syntax
CloseLogView("datasetname")
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
CloseLogView("Process 1")
This command will close the Data Log Viewer, which is displaying the named data set.
ExportAndViewLog
Syntax
ExportAndViewLog ("datasetname", "item list", "format", file,
outputfile)
or
ExportAndViewLog ("datasetname", TextArray, "format", file,
outputfile)
Remarks
All these arguments are optional, and may be omitted provided there are no further arguments i.e. to
specify the ‘format’, ‘datasetname’ and ‘item list’ must be included but ‘file’ and ‘output’ may be
omitted.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Examples
ExportAndViewLog("Balloon", "*")
or
ExportAndViewLog("Balloon", "Altitude,Fuel,Burning,Lift,Group 1",
"CSV-BDTM", 0, "output")
or
ItemList[0] = "Altitude"
ItemList[1] = "Fuel"
ItemList[2] = "Burning"
ItemList[3] = "List"
ItemList[4] = "Group 1"
ExportAndViewLog("Balloon", ItemList, "CSV-BDTM", 0, "output")
All these commands will export all the data in the specified file, for the named data set to the named
output file, in the format specified (as per ExportLog). It then launches an appropriate viewer to
display the file, using the Windows file associations.
ExportLog
Syntax
ExportLog ("datasetname", "item list", "format", file, outputfile)
or
ExportLog ("datasetname", TextArray, "format", file, outputfile)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
All these arguments are optional, and may be omitted provided there are no further arguments i.e. to
specify the ‘format’, ‘datasetname’ and ‘item list’ must be included but ‘file’ and ‘output’ may be
omitted.
Typical Examples
ExportLog("Balloon", "*")
or
ExportLog("Balloon", "Altitude,Fuel,Burning,Lift,Group 1" "CSV-BDTM",
0, "output")
or
ItemList[0] = "Altitude"
ItemList[1] = "Fuel"
ItemList[2] = "Burning"
ItemList[3] = "List"
ItemList[4] = "Group 1"
ExportAndViewLog("Balloon", ItemList, "CSV-BDTM", 0, "output")
All these commands will export all the data in the specified file, for the named data set to the named
output file, in the format specified.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
OpenLogFile
Syntax
OpenLogFile("datasetname”)
or
OpenLogFile("databaselink")
Remarks
Typical Example
OpenLogFile("Balloon")
This command will open the log file, ready to start logging. As the function is disk intensive it should
not be called frequently.
OpenLogView
Syntax
OpenLogView("datasetname", "item list", sessionfile)
or
OpenLogView("datasetname", TextArray, sessionfile)
Remarks
Typical Example
OpenLogView("Balloon", "Altitude,Fuel,Burning,Lift,Group 1")
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
or
ItemList [0] = "Altitude"
ItemList [1] = "Fuel"
ItemList [2] = "Burning"
ItemList [3] = "Lift"
ItemList [4] = "Group 1"
OpenLogView("Balloon", ItemList)
Both these commands will open the Data Log Viewer, and load the Ballon log file, and show the
named items.
OpenLogView("Balloon", ItemList, "C:\Program Files\Omron\CX-
SUPERVISOR\App\MySessionInfo.txt")
This command will open the Data Log Viewer and Balloon log file as above but the Data Log Viewer
will always appear in the same position, and with the same settings – not as it was last shown.
StartLogging
Syntax
StartLogging("datasetname")
or
StartLogging("databaselink")
Remarks
Typical Example
StartLogging("Process 1")
This command will start logging of all items in the named data set. If the file is closed it will be
automatically opened.
StopLogging
Syntax
StopLogging("datasetname")
or
StopLogging("databaselink")
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Example
StopLogging("Process 1")
This command will stop logging of all items in the named data set.
Database Commands
DBAddNew
Description
Adds a new record to a Recordset. This function will fail if the Recordset is opened with a lock of
'Read Only'.
Syntax
returnstate = DBAddNew(level)
Remarks
Argument Type Description
returnstate bool 1 if the function is successful otherwise 0
level text A text point or constant specifying the connection level.
This should be a field or recordset level.
Typical Examples
Result = DBAddNew("Northwind.Order Details")
Using a Recordset connection level, a new record is added with values from all fields associated with
a property type ‘Add’. Point 'Result' is set true if this was successful.
DBAddNew("Northwind.Order Details.OrderID")
DBAddNew("Northwind.Order Details.ProductID")
DBAddNew("Northwind.Order Details.Quantity")
DBAddNew("Northwind.Order Details.UnitPrice")
DBUpdate("Northwind.Order Details")
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Using a Field connection level, each required field is added to the new record using multiple calls to
DBAddNew(). When the record is complete, it is added by calling the DBUpdate() function
Note: To use DBAddNew() with a Recordset level the Recordset must be configured to
perform this type of operation i.e it will need to contain fields for any primary keys and
‘non null’ values required to create a new record. When used at Recordset level all
fields associated with the Recordset with property type ‘Add’ are added (as if calling
DBAddNew()) and the record is updated (as if calling DBUpdate()). Points associated
with the ‘Add’ property can be array points, thus enabling you to add multiple records in
one operation.
Note: When using a Field level connection, the operation may be canceled at any stage
before the DBUpdate() function is called by calling the DBExecute() command
"CancelUpdate".
Note: Only Fields with a property type of ‘Add’ can be added to a Recordset. The value(s) of
the associated points at the time DBUpdate() is called will be used to create the record.
DBClose
Description
Closes a Connection or Recordset. Closing a Connection will automatically close all recordsets
associated with it. Recordsets can be closed in isolation by selecting the appropriate level.
Syntax
returnstate = DBClose(level)
Remarks
Argument Type Description
returnstate bool 1 if the function is successful otherwise 0
level text A text point or constant specifying the connection level.
This should be a connection or recordset level.
Typical Examples
Result = DBClose("Northwind.Order Details")
Closes the 'Order Details' Recordset
Result = DBClose("Northwind")
Closes the connection to the Northwind database, and also any Recordsets which may be open.
DBDelete
Description
Deletes the specified number of records from the current record position. This function works only at
the Recordset level. This function will fail if the Recordset is opened with a lock of 'Read Only'.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Syntax
returnstate = DBDelete(level, quantity)
Remarks
Typical Examples
Result = DBDelete("Northwind.Order Details", 10)
Delete the next 10 records in the recordset
DBMove("First")
Result = DBDelete("Northwind.Order Details", 10)
Delete the first 10 records.
DBExecute
Description
The DBExecute function allows the execution of miscellaneous commands and allows for future
expansion by supporting new commands without the need to create more new DB functions.
Syntax
return = DBExecute(level, command, parameter)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
Pos = DBExecute("Northwind.Order Details", "Find", "UnitPrice >
14.00")
Find the next record satisfying the specified criteria, starting from the current position. Valid search
criteria include: "ProductName LIKE ‘G*’ " wildcard search finds all records where ProductName starts
with ‘G’, "Quantity = 5", "Price >= 6.99". Only single search values are allowed, using multiple values
with ‘AND’ or ‘OR’ will fail.
DBExecute("Connection1.Recordset1", "Source", "Table2")
Modify the Recordsets source to open a different table than configured.
DBExecute("Northwind.Shippers", "Filter", "CompanyName = ‘United
Package’")
Apply a filter to display only records with a company name ‘United Package’
DBExecute("Northwind.Shippers", "Filter", "")
Cancel an existing filter (by passing an empty string)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DBExecute Commands
DBGetLastError
Description
Returns the last error string generated by the Database provider, and displays it in a message box.
Syntax
returnstate = DBGetLastError(level, display)
Remarks
Typical Examples
DBGetLastError("Northwind")
or
DBGetLastError("Northwind", TRUE)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Both the above lines will get and display the last error to occur for the Northwind connection.
ErrMsg = DBGetLastError("Northwind", FALSE)
The last error to occur for the Northwind connection is stored Text point 'ErrMsg', without displaying a
message box.
DBMove
Description
The DBMove function enables you to navigate around a Recordset by moving the position of the
‘current record’ in the Recordset. When a Recordset is first opened the first record is the current
record.
Syntax
returnstate = DBMove(level, direction, position)
Remarks
Typical Examples
DBMove("Northwind.Order Details", "First")
Goto the first record in the Recordset.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
pos = 3
DBMove("Northwind.Order Details", "Position", pos)
Goto the third record in the Recordset.
DBMove("Northwind.Order Details", "Page", 6)
Goto the sixth page in the Recordset.
Note: Bookmarks are returned from the function ‘DBProperty’, they enable you to return to a
‘marked’ record, even after records have been added or deleted
Note: Some Providers do not support moving in the "Previous" direction i.e. cursors are
‘Forward-Only’. Some ‘Forward-Only’ providers do allow moving "First", while some are
strictly Forward-Only i.e. the Recordset has to be Re-queried effectively a combined
Close then Open operation to reset the cursor back to the start of the Recordset. Some
Providers that do support moving "Previous" do not support moving to "Position".
However, in order to be consistent, CX-Supervisor ensures that that all operations
(except "Bookmarks") will work for any connection to any provider but you need to bear
in mind when designing applications that use ‘Forward-Only’ cursors, that there may be
some ‘long-winded’ acrobatics being performed behind the scenes. See DBSupports()
for details of how to check the type of cursor in force.
Note: Bookmarks will only work if specifically supported by the Provider.
DBOpen
Description
Opens a Connection or Recordset. Opening a Connection will automatically open all recordsets
associated with it, that are marked as auto open. Recordsets can be opened in isolation by selecting
the appropriate level.
Syntax
returnstate = DBOpen(level)
Remarks
Typical Examples
DBOpen("Northwind")
Open the connection to the Northwind database, and automatically open any Recordsets set to open
on connection.
done = DBOpen("Northwind.Order Details")
Just open a specific Recordset.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DBProperty
Description
Returns the requested property. This function operates on the Recordset and Field levels. The type
of the value returned depends on the property requested.
Syntax
returnstate = DBProperty(level, property)
Remarks
Typical Examples
Page = DBProperty("CSV.Result", "CurrentPage")
Get the current page for the CSV.Result Recordset.
FieldSize = DBProperty("Northwind.Customers.Address", "Size")
Get the size for the 'Address' field.
Note: The Recordset will only return valid properties when it is Open.
Recordset Properties
The properties of a Recordset are:
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Field Properties
The properties of a Field are
DBRead
Description
Reads a record from a Recordset to the associated point(s), or if associated points are array points,
reads a whole page of records. This function operates on both Recordset and Field levels. At the
Field level the associated column values from the Recordsets current position will be copied into the
Point (number of elements copied = number of elements in the Point, no paging applies at the Field
level).
Syntax
returnstate = DBRead(level, reset)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
DBRead("Northwind.Customers")
Read the next page of records from the 'Customers' Recordset.
DBRead("Northwind.Customers", FALSE)
Read the next page of records from the 'Customers' Recordset, and leave the cursor at the next
record.
DBRead("Northwind.Customers.Address")
The Address field is read. If it is an array point, the Address is read from subsequent records until the
array has been filled.
Note: Use with reset = TRUE is useful if the read operation is being combined with a
subsequent Write operation i.e. you can read in a set of records - resetting the cursor,
make modifications to some of the fields and then Write the changes back to the
Recordset.
Note: Use with reset = FALSE will leave the current position at the start of the next set of
records. This option can be of benefit if the Provider only supports forward moving
cursors, or you simply want to step through the records a page at a time.
DBSchema
Description
Issues commands to read schema results or properties or set up new schema criteria. This function
operates only at a Schema level.
Syntax
return = DBSchema(level, command, parameters...)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
NumberOfRecords = DBSchema("Invoice.Data Types", "RecordCount")
Read the Number of records in the Schema.
DBSchema("Invoice.Data types", "Read", 2)
Read Schema page 2 results into the associated point.
DBSchema("Invoice.Data Types", "Set", "Columns", "COLUMN_NAME", "")
Set a new Schema to return column names.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DBState
Description
Reports if the specified level is in the requested state.
Syntax
return = DBState(level, state)
Remarks
Typical Examples
State = DBState("Invoice", "Closed")
Checks if the Connection "Invoice" is currently closed.
State = DBState("Northwind.Customers", "Open")
Checks if the Recordset "Customers" is currently open.
DBSupports
Description
Returns TRUE if the specified Recordset supports the requested operation.
Syntax
return = DBState(level, operation)
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
Result = DBSupports("CSV.Recordset1", "Delete")
Checks if records can be deleted in 'Recordset1'
Note: If the "MovePrevious" operation is not supported then only 'Forward-Only' cursor
movements are supported.
DBUpdate
Description
Update the record being added in a Recordset. Used in conjunction with DBAddNew to commit a new
record.
Syntax
returnstate = DBUpdate(level)
Remarks
Typical Example
DBAddNew("Northwind.Order Details.OrderID")
DBAddNew("Northwind.Order Details.ProductID")
DBAddNew("Northwind.Order Details.Quantity")
DBAddNew("Northwind.Order Details.UnitPrice")
DBUpdate("Northwind.Order Details")
Each field is added to the new record using multiple calls to DBAddNew(). When the record is
complete, it is added to the Recordset by calling the DBUpdate() function.
DBWrite
Description
Writes a set of records into a Recordset from the associated point(s). This function operates on both
Recordset and Field levels. At the Recordset level all the associated points values from the Points will
be written into the Recordset starting at the current record (1 page of values will be written for each
Point). At the Field level the associated values from the point are written into the Recordsets starting
at the current position. The number of elements written = number of elements in the Point. This
function will fail, if the Recordset is opened with a Lock of ‘Read Only’.
Syntax
return = DBWrite(level, reset)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
DBWrite("Northwind.Customers")
Write all point values to the associated Customers fields.
DBWrite("Northwind.Customers.Address", FALSE)
Write the point values to the Address column, and leave the cursor at the next set of records.
Syntax
ReturnState = InputCOMPort(PortNumber, Message, MessagePresent)
Remarks
Typical Example:
bState = InputCOMPort(1, Msg, bTransmission)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
OutputCOMPort
Description
Sends an ASCII text message out through the designated serial communications port.
Syntax
ReturnState = OutputCOMPort(PortNumber, Message)
Remarks
Typical Example:
bState = OutputCOMPort(1, Msg)
CloseCOMPort
Description
Closes the designated serial communications port on the PC. The port must have been configured
and opened before it can be closed.
Syntax
ReturnState = CloseCOMPort(PortNumber)
Remarks
Typical Example:
bState = CloseCOMPort(1)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
OpenCOMPort
Description
Opens the designated serial communications port on the PC for transmitting or receiving data. The
port must have been configured before it can be opened.
Syntax
ReturnState = OpenCOMPort(PortNumber)
Remarks
Typical Example:
bState = OpenCOMPort(1)
SetupCOMPort
Description
Configures the designated serial communications port on the PC for transmitting or receiving data.
Syntax
ReturnState = SetupCOMPort(PortNumber, ConfigurationString,
HandShaking, TerminationChar, ControlCharFlag)
Remarks
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example:
bState = SetupCOMPort(2, "9600,N,8,1", 0, 0x0D, TRUE)
ActiveX Functions
GetProperty
Description
Gets the value of a property of an OLE object and stores it in a point.
Syntax
propertyvalue = GetProperty(object, property, ...)
Remarks
Typical Examples
OLE1Height = GetProperty(“OLE1”, “Height”)
This will read the property ‘Height’ from the OLE object ‘OLE1’ and store it in the point ‘OLEHeight’.
DM100Value = GetProperty(“CXComms1”, “DM”, 100)
This will read the property ‘DM’ (with one parameter 100) from the OLE object ‘CXComms1’ and store
it in the point ‘DM100Value’.
PutProperty
Description
Puts a value stored in a point into the property of an OLE object.
Syntax
PutProperty(object, property, ..., value)
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Remarks
Typical Examples
PutProperty(“OLE1”, “Left”, NewLeftValue)
This will write the value stored in the point NewLeftValue to the property ‘Left’ in the OLE object
‘OLE1’.
PutProperty(“CXComms1”, “DM” 10, NewValue)
This will write the value stored in the point NewValue to the property ‘DM’ (with one parameter 10) in
the OLE object ‘CXComms1’.
PutProperty(“Gauge1”, “Value”, 25.2)
This will write the value 25.2 to the object ‘Gauge1’.
Execute
Description
Execute a method of an OLE object.
Syntax
Execute(object, method, ...)
Remarks
Typical Examples
Execute(“OLE1”, “Start”)
This will call the method ‘Start’ on the object ‘OLE1’.
Execute(“CXComms1”, “OpenPLC”, “MyPLC”)
This will call the method ‘OpenPLC’ with one text parameter ‘MyPLC’ on the OLE object ‘CXComms1’
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
ExecuteVBScript
Description
Creates aliases allowing Visual Basic Script to be executed in line. This uses the Windows Scripting
Host. See Appendix C for a list of supported functions and details of the Windows Scripting Host.
Syntax
@VBSCRIPT
@ENDSCRIPT
Typical Examples
@VBSCRIPT
OLE1.LEFT = Point(“PointName”)
@ENDSCRIPT
This Visual Basic Script will write the value from the point ‘PointName’ into the property ‘Left’ of the
OLE object ‘OLE1’.
ExecuteJScript
Description
Creates aliases allowing Java Script to be executed in line. See Appendix D for a list of supported
functions and details of the Windows Scripting Host.
Syntax
@JSCRIPT
@ENDSCRIPT
Typical Examples
@JSCRIPT
Point(“PointName”) = OLE_1.Height;
@ENDSCRIPT
This Java Script will write the value of the property ‘Height’ from the OLE object ‘OLE1’ into the Point
named ‘PointName’.
Note: The Java Script can not include the { or } characters. To use these, put the script in a
text file and use the ExecuteJScriptFile function.
ExecuteVBScriptFile
Description
Allows Visual Basic script stored in a text file to be executed. This uses the windows scripting host
which must be installed. See Appendix C for a list of supported functions.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Syntax
returnstate = ExecuteVBScriptFile(scriptfile)
Remarks
Typical Examples
returnstate = ExecuteVBScriptFile(“c:\vbscript.txt”)
This will execute the Visual Basic Script stored in “c:\vbscript.txt”.
ExecuteJScriptFile
Description
Allows Java script stored in a text file to be executed. This uses the windows scripting host which
must be installed. See Appendix D for a list of supported functions.
Syntax
returnstate = ExecuteJScriptFile(scriptfile)
Remarks
Typical Examples
returnstate = ExecuteJScriptFile(“c:\jscript.txt”)
This will execute the Java Script stored in “c:\jscript.txt”.
Punctuation
Command String Delimiters
Syntax
DDEExecute(channel, {[command1][command2][command3]})
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Typical Example
channelname = DDEInitiate("Excel", "Sheet1.xls")
DDEExecute(channelname, {[OPEN("C:\EXCEL\WORK\SHEET2.XLS")]})
It is possible to pass multiple commands in one DDEExecute() command. Each command is
surrounded by square brackets [...]. There must be no space between the closure of one square
bracket and the opening of the next [...][...].
The ‘{‘ and ‘}’ braces must be inserted around the whole set of commands { [ . . . ] [ . . . ] } or an error is
reported. The braces act as delimiters for the whole command string. This allows the actual
commands in the command string to contain quotes.
Indentation
Typical Examples
IF burner AND fuel > 0 AND rate > 0 THEN
lift = lift + rate/5
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.
Multiple Commands
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.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Parenthesis
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, Arithmetric Operations for further details.
Quotation Marks
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.
channelname = DDEInitiate("Excel", "Sheet1.xls")
The Integer point ‘channelname’ is provided with a DDE link to an application which is run by an
executable filename, and to the associated application file. Quotation marks must be used for server
names, topic names, DDE commands and item names.
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.
Remarks
Syntax
REM | rem comment
or
‘comment
Remarks
Typical Examples
REM The following statement adds two numbers
result = 45 + 754
result = 45 + 754 ‘add two numbers
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
2. Link the following script code to run as required. e.g. on clicking a button.
• Text = ValueToText(index)
• TextPoint = “motor” + text
3. The ValueToText function converts the integer value of the point ‘index’ into a
string held in the textpoint ‘text’. Therefore the point ‘text’ contains either ‘1’, ‘2’,
‘3’ or ‘4’. The expression ‘motor’ + text appends the contents of the point ‘text’
to the literal string ‘motor’. Therefore ‘textpoint’ contains either ‘motor1’,
‘motor2’, ‘motor3’ or ‘motor4’ dependant on the value of ‘index’. Change the
value of the ‘index’ to determine which Boolean point to control. e.g. via the
Edit Point Value (Analogue) animation.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Using Aliases
This facility is used to declare an alias - that is, to define a text string that can be used in place of
another text string or a number within any script or expression. The Alias Definitions dialog is
displayed by selecting the “Alias Definition...” option from the Project menu. It can also be displayed if
“Aliases...” is selected from the script editor. The dialog displays either the User defined aliases or the
preset System aliases and is toggled between these two displays by pressing the User/System Alias
button.
The following illustration shows the Alias Definitions dialog displaying a number of User defined
aliases. The System aliases are pre-defined and can not be edited or added to.
Syntax:
@AliasName Alias definition 'optional comment
Remarks:
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
The @ symbol at the beginning of each line initiates each alias command. For example, the text string
@SomePoint could be used to represent any sequence of characters in a script or expression – e.g. it
could be defined as:
@SomePoint = InArray[1]
or even
@SomePoint = Inarray[1] + Inarray[2] / 2
This is an easy way of identifing the individual members of array points. It can also be used to
associate names with numbers, for example,
@SecondsPerDay = 86400
Alias definations are stored in a simple text file in the project directory, called <project name>.pre.
The format of the file consists of any number of lines such as:
@Test1 = InArray[12] * 10
i.e. an @ symbol followed by the name of the alias, then an equals sign (or space), followed by the
definition of the alias. Anything that follows the last apostrophe ( ' ) symbol on a line is interpreted as a
comment. Any line which does not start with the @ symbol is also assumed to be a comment.
Typical Examples
Declare boiler temperatures
@BoilerTemp1 = InArray[0] ' for boiler room 1
@BoilerTemp2 = InArray[1] ' for boiler room 2
@SecondsPerMinute = 60 ' sets duration
Aliases may also be used to create a complicated expression such as
@HYPOTENUSE sqrt(Opposite * Opposite + Adjacent * Adjacent)
'Calculates length of Hypotenuse
This can be used in a script in the following way:
Opposite = 8.45
Adjacent = 9.756
length = @HYPOTENUSE
where Opposite, Adjacent and length are all REAL points.
Note: Changing an alias definition after it has been used in an expression or script will not
automatically change the result in the script. The appropriate script or expression
where that alias is used must be accessed and recompiled by pressing the OK button in
order to apply the changes.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
CHAPTER 5
Script Examples
This chapter provides two applications for a script. The first script is a typical script exercising the
basic commands. The second script is specific for DDE use. Both examples are described twice,
once as a whole, and once on a line by line basis.
Balloon Script
The following script applies to a simple game.
The user must attempt to land the balloon on the plateau on the right, using the Max/Min slider control
throughout the flight. Clicking Reset clears the current game and initialises a new game. Clicking the
on/off pushbutton starts the game.
When the balloon is airborne, clouds move slowly horizontally and change colour slightly. Clicking
Help at any time brings up a special help page; clicking Close from this help page returns the user to
the game. The blue gauge shows the amount of fuel consumed and left.
The project consists of three page scripts and one object. The three page scripts are initiated at
varied intervals: 10 milliseconds, 100 milliseconds and 1000 milliseconds.
The page script initiated at intervals of 10 milliseconds determines the position of each cloud, and the
speed at which each cloud moves. The page script initiated at intervals of 1000 milliseconds
determines how the balloon reacts to the conditions.
The page script initiated at intervals of 100 milliseconds provides the main configuration of the game,
reacting to user input and moving the balloon accordingly. This page script is as follows:
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
IF burner AND fuel > 0.0 AND rate > 0.0 THEN
lift = lift + rate/5.0
ELSE
IF alt > 140.0 THEN
lift = lift - 0.2
ENDIF
ENDIF
IF lift < -10.0 THEN
lift = -10.0
ENDIF
alt = alt + lift
IF alt <= 140.0 THEN
IF distance>630.0 AND distance<660.0 AND lift>=-3.0 THEN
winner = TRUE
burner = FALSE
ENDIF
IF lift < -3.0 then
crash = TRUE
burner = FALSE
ENDIF
lift = 0.0
ENDIF
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
IF burner THEN
fuel = fuel – rate
IF fuel < 0.0 THEN
fuel = 0.0
burner = FALSE
ENDIF
ENDIF
If the fuel burner is on, the amount of fuel remaining decreases by the rate of ascent. The rate of
ascent, point ‘rate’ can be modified by moving the slider. If point ‘fuel’ currently has a value of less
than 0, then there is no fuel left and the fuel burner is turned off.
IF burner AND fuel > 0.0 AND rate > 0.0 THEN
lift = lift + rate/5.0
ELSE
IF alt > 140.0 THEN
lift = lift - 0.2
ENDIF
ENDIF
If the fuel burner is on, and there is still fuel left, and the rate of ascent exceeds 0 (the balloon has
taken off) then point ‘lift’ is incremented by the rate of ascent divided by 5 to allow the balloon to climb.
Otherwise the balloon must be descending and point ‘lift’ is decremented by 0.2.
IF lift < -10.0 THEN
lift = -10.0
ENDIF
Once point ‘lift’ reaches -10, it is not allowed to go lower.
alt = alt + lift
The altitude of the balloon is incremented by point ‘lift’.
IF alt <= 140.0 THEN
IF distance>630.0 AND distance<660.0 AND lift>=-3.0 THEN
winner = TRUE
burner = FALSE
ENDIF
If the balloon has hit the ground (point ‘alt’ equals 140), then provided it is on the plateaux (the position
of the balloon in pixels defined by point ‘distance’ is between 630 and 660) and the rate of descent is
not too fast (defined by point ‘lift’), then the game is won.
IF lift < -3.0 then
crash = TRUE
burner = FALSE
ENDIF
If the balloon has hit the ground (point ‘alt’ equals 140), then if the rate of descent is not too fast
(defined by point ‘lift’), then the game is lost.
lift = 0.0
ENDIF
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DDE Script
The following script demonstrates how to generate a report using Microsoft Word for Windows
application. It is a more detailed example targeted at more proficient script writers. The example
assumes the following:
A file ‘REPORT.DOC’ exists in a directory named “C:\WINWORD\WORK”.
A text point ‘Header’ exists with the default text “CX-Supervisor Report — Date.
A real point named ‘Input’ exists with a default value of ‘325.99’. DDE Access of at least Read/Only is
required for the point.
A real point named ‘Output’ exists with a default value of ‘250.00’. DDE Access of at least Read/Only
is required for the point.
'Establish a connection to the report document
channel = DDEInitiate("Winword", "C:\WINWORD\WORK\REPORT.DOC")
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
DDEExecute(channel, {[SelectCurWord]})
DDEExecute(channel, {[FormatFont .Bold = 0]})
DDEExecute(channel, {[EndOfDocument]})
The following paragraphs describe the above script on a line by line basis. The description assumes
the reader has a knowledge of the target application, in this instance Microsoft Word for Windows.
'Establish a connection to the report document
A remark describing the next few lines of code.
channel = DDEInitiate("Winword", "C:\WINWORD\WORK\REPORT.DOC")
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
The point ‘channel’ is assigned with the Microsoft Word for Windows executable file filename (minus
the file extension) ‘Winword’, and the path and filename of the topic, ‘REPORT.DOC’.
IF channel > 0 THEN
The point ‘channel’ is tested to ensure it is not empty, and therefore the demonstration continues to
run.
‘Output header and date
DDEPoke(channel, "\StartOfDoc", Header)
Microsoft Word for Windows is passed a navigational ‘go to start of document’ command, with the text
contained within point ‘Header’.
DDEPoke(channel, "\EndOfDoc", $Date)
Microsoft Word for Windows is passed a navigational ‘go to end of document’ command, and the date
contained within system point ‘$Date’ is inserted.
DDEExecute(channel, {[EndOfDocument]})
DDEExecute(channel, {[InsertPara]})
DDEExecute(channel, {[InsertPara]})
Microsoft Word for Windows is passed an EndOfDocument command, followed by two InsertPara
commands.
‘Output column headings (note : Chr$(9) is a TAB)
DDEExecute(channel, {[Insert "Time" + Chr$(9) + "Input"
+ Chr$(9) + "Output"]})
DDEExecute(channel, {[InsertPara]})
Microsoft Word for Windows is passed an Insert command, containing ‘Time’ followed by a tab
character, followed by ‘Input’, followed by a tab character, followed by ‘Output’, followed by an
InsertPara command.
‘Change header and column headings to Bold font
DDEExecute(channel, {[EditSelectAll]})
DDEExecute(channel, {[FormatFont .Bold = 1, .Underline = 0]})
DDEExecute(channel, {[EndOfDocument]})
Microsoft Word for Windows is passed an EditSelectAll command supplying an extended selection
across all of ‘REPORT.DOC’. The selected area is reformatted as emboldened, with no underline
(both .Bold and .Underline are Boolean with an ‘on’ and ‘off’ state).
‘Change font to normal for the data fields
DDEExecute(channel, {[SelectCurWord]})
DDEExecute(channel, {[FormatFont .Bold = 0]})
DDEExecute(channel, {[EndOfDocument]})
Microsoft Word for Windows is passed an SelectCurWord command supplying an extended selection
across the current word. The selected area is reformatted as normal (.Bold is Boolean with an ‘ON’
and ‘OFF’ state). An EndOfDocument command is also passed.
‘Output the data fields
DDEPoke(channel, "\EndOfDoc", $Time)
DDEExecute(channel, {[EndOfDocument]})
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 5 – Script Examples
Microsoft Word for Windows is passed a navigational ‘go to end of document’ command, and the time
contained within system point ‘$Time’ is inserted. An EndOfDocument command is also passed.
DDEExecute(channel, {[Insert Chr$(9)]})
DDEPoke(channel, "\EndOfDoc", Input)
DDEExecute(channel, {[EndOfDocument]})
Microsoft Word for Windows is passed an Insert command, containing a tab character, followed by a
navigational ‘go to end of document’ command, followed by the value of point ‘Input’, followed by an
EndOfDocument command.
DDEExecute(channel, {[Insert Chr$(9)]})
DDEPoke(channel, "\EndOfDoc", Output)
Microsoft Word for Windows is passed an Insert command, containing a tab character, followed by a
navigational ‘go to end of document’ command, followed by the value of point ‘Output’, followed by an
EndOfDocument command.
ENDIF
If point ‘channel’ is empty, the lines of script within the IF THEN ENDIF control statement are ignored.
The page script is finished.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON CHAPTER 6 – Colour Palette
CHAPTER 6
Colour Palette
This chapter discusses the colour palette. A colour may be specified by its name or number. The
following table provides a cross-reference between these. Some colour names made up of more than
one word are separated by an underscore or a hyphen. A specified colour can be changed in the CX-
Supervisor development environment for the current session; such changes cannot be saved to a
Page or Project, unless colours are changed from the Colour Palette located under the General
Settings submenu in the Project menu.
Using a 16 colour-based screen resolution (consult the Microsoft Windows documentation for further
information) colours 16 to 65 are dithered from the sixteen base colours. Higher colour-based
resolutions are not dithered.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX A – OPC Communications Control
Appendix A
OPC Communications Control
This appendix contains a list of the available component properties and gives details of the Visual
Basic script interface. These properties can be set in run time by using a Visual Basic script command
– for example: -
OMRONCXOPCCommunicationsControl1.ServerNodeName = “\\NAME”
The Script Interface defines the Visual Basic script interface for the OPC communications control.
See ExecuteVBScript script functions for more information on running Visual Basic Script.
Component Properties
Property Title Example Description
DisplayErrors True When set True, the object will display a message box for any errors.
False If set to False, error messages are not displayed.
ProjectName Name of .OPC file containing the client setup.
ServerComputerName “MyPC” This is the name of the PC with the OPC Server.
ServerName Name of the OPC Server to connect to.
e.g. OMRON.OpenDataServer.1
ServerProjectName Optional filename, which if specified causes the OPC Server to use
the specified file, if supported by the server.
Script Interface
The Script Interface defines the methods for the OPC communications control.
Functions
Value Function for getting and setting an OPC item value.
Read Function to read the value of an OPC item.
Write Function to write the value of an OPC item.
Value
Reads or writes the value of an OPC item.
Example 1 – Reading a value:
intVal = OMRONCXOPCCommunicationsControl1.Value(“MyGroup”, “BoilerTemp”)
In this example, the OPC item ‘BoilerTemp’ in the OPC group called “MyGroup” will be read from the
OPC Server and will be stored in ‘intVal’.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX A – OPC Communications Control
Read
Reads the value of an OPC item.
Example of synchronous read:
intVal = OMRONCXOPCCommunicationsControl1.Read(“MyGroup”, “BoilerTemp”)
In this example, the OPC item ‘BoilerTemp’ in the OPC group called “MyGroup” will be read from the
OPC Server and will be stored in ‘intVal’. The script will wait for the read operation to complete before
continuing to execute the next line. This is identical to the operation of the ‘Value’ method.
Write
Writes the value of an OPC item.
Example of synchronous write:
OMRONCXOPCCommunicationsControl1.Write “MyGroup”, “BoilerTemp”, NewValue
In this example, ‘NewValue’ will be written to the OPC item ‘BoilerTemp’ in the OPC group called
“MyGroup”. The script will wait for the write operation to complete before continuing to execute the
next line. This is identical to the operation of the ‘Value’ method.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX B – Lite Communications Control
Appendix B
Lite Communications Control
This appendix contains a list of the available component properties and gives details of the Visual
Basic script interface. These properties can be set in run time by using a Visual Basic script command
– for example: -
OMRONCXCommunicationsControl1.ServerNodeName = “\\NAME”
The Script Interface defines the Visual Basic script interface for the Lite communications control. See
ExecuteVBScript script functions for more information on running Visual Basic Script.
Component Properties
Property Title Example Description
DisplayErrors True When set True, the object will display a message box for any errors.
False If set to False, error messages are not displayed.
ListPLCs Holds a list of all PLC names configured in the project file. This
property is read only.
ListPoints Holds a list of all point names configured in the project file. This
property is read only.
Script Interface
The Script Interface defines the Visual Basic script interface for the Lite communications control.
Functions
Value Function for getting and setting an area of memory in a PLC. This function allows
logical names to be used. If an array is used, the first element is returned.
Values Function for getting and setting an area of memory in a PLC. This function allows
logical names to be used. If an array is used then a SAFEARRAY is returned with
all values.
SetDefaultPLC Function for setting the default PLC. This is primarily used when a project
contains multiple PLCs.
OpenPLC Opens the specific PLC for communications.
ClosePLC Closes the specific PLC.
ReadArea Function for reading a block of memory from the PLC.
WriteArea Function for writing a block of memory to the PLC.
RunMode Function for reading / writing the current mode of the PLC.
TypeName Function for reading the PLC type (e.g. CQM1H).
IsPointValid Checks a point name is valid.
PLC Memory Functions A, AR, C, CIO, D, DM, DR, E, EM, G, GR, H, IR, LR, SR, ST, T, TC, TK, W.
Functions for getting and setting the memory areas in the PLC.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX B – Lite Communications Control
Value
Reads the value of an address from a PLC, or writes a value to an address in a PLC. This function
allows logical names.
Example 1 – Reading a value from the PLC using a logical name.
intVal = OMRONCXCommunicationsControl1.Value(“BoilerTemp”)
or
intVal = OMRONCXCommunicationsControl1 (“BoilerTemp”)
In these examples, the PLC address associated with ‘BoilerTemp’ will be read from the PLC and
stored in ‘intVal’. “Value” is the default property and does not have to be specified.
Example 2 – Writing a value to the PLC using a logical name.
OMRONCXCommunicationsControl1.Value(“BoilerTemp”) = 50
or
OMRONCXCommunicationsControl1 (“BoilerTemp”) = 50
In these examples, the value 50 will be written to the PLC address associated with ‘BoilerTemp’.
“Value” is the default property and does not have to be specified.
Further examples
OMRONCXCommunicationsControl1 (“PLCName/DM0”) = 1000
OMRONCXCommunicationsControl1 (“DM0”) = 1000
intval = CommunicationsControl1(“DM100”)
These examples are physical addresses. A PLC name can optionally be specified otherwise the
current default PLC will be assumed.
Values
Reads an array of values from a PLC, or writes an array of values to a PLC. This function allows
logical names. If an array is used then a SAFEARRAY is returned with all values.
Example 1 – Reading an array of values from the PLC using a logical name.
SomeArray = OMRONCXCommunicationsControl1.Values(“BoilerTemps”)
Example 2 – Writing an array of values to the PLC using a logical name.
OMRONCXCommunicationsControl1.Values(“BoilerTemps”) = SomeArray
SetDefaultPLC
The ‘SetDefaultPLC’ function can be used to inform the script parser that a particular PLC is has been
set as the default. Once a default PLC has been set, then it is not necessary (with some functions) to
specify a PLC name. For example,
OMRONCXCommunicationsControl1.SetDefaultPLC(“MyPLC”)
intVal = OMRONCXCommunicationsControl1.Value(“BoilerTemp1”)
OMRONCXCommunicationsControl1.Value(“BoilerTemp1”) = 75
intVal = OMRONCXCommunicationsControl1.Value(“DM50”)
Each ‘Value’ function above will access data in the PLC called ‘MyPLC’.
Note: If there is only 1 PLC in the project then it is not necessary to call the ‘SetDefaultPLC’
function. The first PLC in a project will automatically be set as the default PLC.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX B – Lite Communications Control
OpenPLC
Opens a PLC for communications. If no PLC is specified then the default PLC is opened.
Example 1:
OMRONCXCommunicationsControl1.SetDefaultPLC(“MyPLC”)
OMRONCXCommunicationsControl1.OpenPLC()
OMRONCXCommunicationsControl1.DM(100) = 10
OMRONCXCommunicationsControl1.DM(50) = 10
Example 2:
OMRONCXCommunicationsControl1.OpenPLC(“MyPLC”)
OMRONCXCommunicationsControl1.DM(100) = 10
ClosePLC
Closes a previously opened PLC. If no PLC is specified then the default PLC is closed.
Example:
OMRONCXCommunicationsControl1.ClosePLC(“MyPLC”)
ReadArea
Reads a specified block of memory from a PLC.
Examples of synchronous read:
MyVariant = OMRONCXCommunicationsControl1.ReadArea(“MyPLC/DM0”, 12, vbString)
MyVariant = OMRONCXCommunicationsControl1.ReadArea(“BoilerTemp”, 10, vbInteger)
MyVariant = OMRONCXCommunicationsControl1.ReadArea(“BoilerTemp”, 20)
In the first example, DM0 to DM11 will be read as characters (part of a string) from ‘MyPLC’ and will
be stored in ‘MyVariant’. The second example demonstrates that it is also possible to use a logical
name for the start address, and that any VB variant types (such as vbInteger) can be used. The third
example shows that the VB Variant type parameter is optional – if none is specified then vbInteger is
assumed. The script will wait for the read operation to complete before continuing to execute the next
line.
WriteArea
Writes a block of memory to a specified area in a PLC.
Examples of synchronous write:
MyString = “TestString”
OMRONCXCommunicationsControl1.WriteArea “MyPLC/DM50”, 10, MyString
Dim newValue(2) As Long
newValue(1) = 0
newValue(2) = 1
OMRONCXCommunicationsControl1.WriteArea “BoilerTemp”,2,newValue
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX B – Lite Communications Control
In the first example, the contents of ‘MyString’ will be written into DM50 to DM54. Any additional data
in ‘MyString’ will be ignored (i.e. if ‘MyString’ is 15 characters in length then the first 10 characters will
be written to DM50 to DM54 and the remaining 5 characters will be ignored – {Note: each PLC
address holds 2 characters}). The second example shows that a logical name can be used. The
script will wait for the write operation to complete before continuing to execute the next line.
RunMode
Reads the current operating mode of a PLC (Stop/Program, Debug, Monitor, Run), where
0=Stop/Program mode, 1=Debug mode, 2=Monitor mode and 4=Run mode.
Example
intMode = OMRONCXCommunicationsControl1.RunMode(“MyPLC”)
In this example, the operating mode would be read from ‘MyPLC’ and stored in ‘intMode’. If ‘MyPLC’
was in ‘Monitor’ mode then ‘intMode’ would be set to the value 2.
TypeName
Reads the PLC model name of a PLC (e.g. C200H, CQM1H, CVM1 etc).
Example
strPLCType = OMRONCXCommunicationsControl1.TypeName(“MyPLC”)
In this example, the PLC model type will be read from ‘MyPLC’ and will be stored in ‘strPLCType’.
IsPointValid
Checks if a Point name has been defined in the CX-Server project file.
Examples
bValid = OMRONCXCommunicationsControl1.IsPointValid(“MyPoint”)
bValid = OMRONCXCommunicationsControl1.IsPointValid(“MyPoint”, “MyPLC”)
In both examples, the boolean variable bValid is set True if the point “MyPoint” has been defined.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX B – Lite Communications Control
Note: These examples assume there is only 1 PLC in the CX-Server project file, or that the
‘SetDefaultPLC’ function has been used to select the required PLC. Refer to the
‘SetDefaultPLC’ function for details about using script with multiple PLCs in the project.
Example 2
OMRONCXCommunicationsControl1.DM(100) = 75
In this example, the value 75 will be written to DM100 in the PLC.
Bit addressing, that is accessing data from individual memory bits, is also supported by these memory
areas: IR, AR, HR and CIO.
Example 3
bVal = OMRONCXCommunicationsControl1.IR(“100.2”)
In this example, the status of bit IR100.2 (i.e. bit 2 of IR100) will be read from the PLC and stored in
‘bVal’ (e.g. ‘bVal’ will be set to TRUE or FALSE).
Example 4
OMRONCXCommunicationsControl1.IR(“100.2”) = True
In this example, bit IR100.2 (i.e. bit 2 of IR100) in the PLC will be set to True. Note that use of the
quotes is optional, but is required to differentiate between 100.1 and 100.10
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX C – VBScript Features
APPENDIX C
VBScript Features
This appendix provides a summary of VBScript features available for use with the ExecuteVBScript
and ExecuteVBScriptFile script functions. These features are provided by the Windows Scripting
Host, included by default with Windows 98 and Windows 2000. For Windows 95 and Windows NT,
the Windows Scripting Host is available as a free download from Microsofts Web site.
For details of the latest versions and support contact Micrsoft at –
http://msdn.microsoft.com/scripting
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX C – VBScript Features
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX C – VBScript Features
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX D – JScript Features
APPENDIX D
JScript Features
This appendix provides a summary of JScript features available for use with the ExecuteJScript and
ExecuteJScriptFile script functions. These features are provided by the Windows Scripting Host,
included by default with Windows 98 and Windows 2000. For Windows 95 and Windows NT, the
Windows Scripting Host is available as a free download from Microsofts Web site.
For details of the latest versions and support contact Micrsoft at –
http://msdn.microsoft.com/scripting
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON APPENDIX D – JScript Features
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON GLOSSARY OF TERMS – Script Language
GLOSSARY OF TERMS
AND A logic operator used to interrogate Boolean type points. AND returns
‘TRUE’ if all arguments are ‘TRUE’. An example of AND is that if a is a
statement and b is a statement, AND returns ‘TRUE’ if both a and b are
‘TRUE’. If one or both statements return ‘FALSE’ then AND returns
‘FALSE’.
Application A software program that accomplishes a specific task. Examples of
applications are CX-Supervisor, SYSMAC-CDM, Microsoft Word for
Windows and Microsoft Excel. CX-Supervisor and its development
environment allows the creation and testing of new applications through a
Graphical User Interface (GUI).
Arguments Words, phrases, or numbers that can be entered on the same line as a
command or statement to expand or modify the command or statement
within the CX-Supervisor script language. The command acts on the
argument. In essence the command is a verb, and the argument is the
object of the verb. An example of an argument in CX-Supervisor is
“DDETerminate(channel)” where DDETerminate is a command within
the script language, and channel is the argument upon which the
command will act.
Bitmap The representation of an image stored in a computer’s memory. Each
picture element (pixel) is represented by bits stored in the memory. In CX-
Supervisor a bitmap image can be installed as a single object.
Boolean type A type of point where the value of the point can be one of two states.
Essentially the two states are ‘0’ and ‘1’, but these states can be assigned a
meaningful designation. Examples are:
State Example Example Example Example
0 ‘OFF’ ‘FALSE’ ‘OUT’ ‘CLOSED’
1 ‘ON’ ‘TRUE’ ‘IN’ ‘OPEN’
See also: AND, NOT and OR.
COM COM is a Microsoft technology that allows components used to interact.
Communications Driver The relevant communications management system for OMRON PLCs in
conjunction with Microsoft Windows, providing facilities for other SYSMAC
software to maintain PLC device and address information and to
communicate with OMRON PLCs and their supported network types.
Constant Within CX-Supervisor, a constant is a point within the script language that
takes only one specific value.
Control Object In CX-Supervisor, a control object is applied in the development
environment and can be a pushbutton, a toggle button, a slider, a trend
graph, a rotational gauge or a linear gauge. Essentially a control object can
be a complex graphic object consisting of a number of primitive graphic
objects, which provides user interaction.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON GLOSSARY OF TERMS – Script Language
Database Connection Level A Database Connection Level is a string which determines what level in the
database tree hierarchy is to be operated on. Some examples are listed
below:
"Northwind" Connectionlevel
"CSV.Result" Recordset level
"Northwind.Order Details.OrderID" Field level
"Invoice.Data Types" Schema level
DCOM DCOM is a distributed version of COM that allows components on different
PCs to interact over a network.
DDE Dynamic Data Exchange. A channel through which correctly prepared
programs can actively exchange data and control other applications within
Microsoft Windows. CX-Supervisor, through the use of its script language,
allows extensive use of DDE functionality.
Development Environment SCADA applications are created and tested using the development
environment within CX-Supervisor. On completion, the finished application
can be delivered as a final customer application to be run by the run-time
environment.
DLL Dynamic Link Library. A program file that although cannot be run stand-
alone as an executable, can be utilised by one or more applications or
programs as a common service. DLL files have a *.DLL extension. DLL’s
comprise a number of stand-alone functions. In CX-Supervisor, a DLL
containing icons can be accessed to represent the display part of an OLE
object. One such DLL, ‘MORICONS.DLL’, is provided in the standard
Microsoft Windows installation.
Download A recipe is downloaded during runtime. This process involves identifying
the appropriate recipe and executing the validation code, if any exists. The
download is complete when each ingredient has set its point to the target
value.
Embedded Object An embedded object is a complex object that can be a bitmap object or an
OLE object.
Executable A file that contains programs or commands of an application that can be
executed by a user or another application. Executable files have a *.EXE
file extension. CX-Supervisor provides two executable files, one for the
development environment (CX-SUPERVISORDEV.EXE), and one for the
run-time environment (SCS.EXE).
Expressions In the CX-Supervisor script language, expressions are a construct for
computing a value from one or more operands. For instance, in the
example “lift = height + rate”, the expression is “height + rate”
where the result yielded from the expression is used for the value of “lift”.
Outside of the script language, expressions consisting of operators and
operands can be used to control objects , through actions.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON GLOSSARY OF TERMS – Script Language
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON GLOSSARY OF TERMS – Script Language
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON GLOSSARY OF TERMS – Script Language
Point variable A point within the CX-Supervisor script language that stores a value or
string assigned to that point.
Point A point is used to hold a value of a predefined type - Boolean, Integer, Text,
etc. The contents of a point may be controlled by an object or I/O
mechanism such as DDE. The contents of a point may control the action or
appearance of an object, or be used for output via an I/O mechanism.
Program Manager An integral part of Microsoft Windows 3.x which allows Microsoft Windows
based applications to be started from icons and for all applications to be
organised. CX-Supervisor can be run from Program Manager.
Project A CX-Supervisor application will consist of one or a number of pages linked
together. The pages may contain passive or active graphics, text or
animations, and may be grouped together logically to form a project. A
project may consist of many pages, or simply a single page. Projects may
be built and tested within the CX-Supervisor development environment, and
run stand-alone under the CX-Supervisor run-time environment.
Only one project at a time may be open for editing within the CX-Supervisor
development environment.
Real type A type of point where the value of the point can be any number, including
those containing a decimal point.
Recipe A recipe is a set of pre-defined steps used to perform a particular task. A
CX-Supervisor project may contain zero or more number of recipes.
Recipes are defined in the development environment and executed, or
downloaded, in the run-time environment.
Run Time Environment SCADA applications are run using the run-time environment of CX-
Supervisor, following creation of the application in the CX-Supervisor
development environment.
SCADA Supervisory Control and Data Acquisition. (see CX-Supervisor)
Server 1. Within the CX-Supervisor script language, Server is used in DDE
functions to contain a link to an outside application. Using DDE
functions, CX-Supervisor allows the manipulation of an outside
application as specified as the Server.
See also Server Application.
2. A Server is the central processing point of a Network which is
accessible to all computers. Networks affect CX-Supervisor in that
further associated options are available if the computer Network is
connected.
Server Application An application that can be used to view or interact with, whilst currently
within CX-Supervisor.
See also DDE and OLE.
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON GLOSSARY OF TERMS – Script Language
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON INDEX – Script Language
INDEX
Bin - Text Commands: · 90
Bitmap · 156
Pixel · 159
A Bitwise Operators - Logic and Arithmetic: · 18
Blink - Object Commands: · 31
AcknowledgeAlarms - Alarm Commands: · 70
AcknowledgeAllAlarms - Alarm Commands: · 70
AcknowledgeLatestAlarm - Alarm Commands: · 71
Alarm Commands · 70 C
AcknowledgeAlarms · 70
AcknowledgeAllAlarms · 70 Call - Subroutines: · 28
AcknowledgeLatestAlarm · 71 CancelForce - Point Commands: · 46
ClearAlarmHistory · 71 Case Selected - Control Statements: · 24
CloseAlarmHistory · 72 Chr - Text Commands: · 90
CloseAlarmStatus · 72 ClearAlarmHistory - Alarm Commands: · 71
DisplayAlarmHistory · 73 ClearErrorLog - Event/Error Commands: · 96
DisplayAlarmStatus · 73 ClearGraph -Graph Commands: · 82
EnableAlarms · 74 ClearLogFile - Data Logging Commands: · 104
Is AlarmAcknowledged · 74 ClearSpoolQueue - Printer Commands: · 98
IsAlarmActive · 75 Close Page - Page Commands: · 39
Alarms CloseAlarmHistory - Alarm Commands: · 72
Script Editor · 72 CloseAlarmStatus - Alarm Commands: · 72
Alias Examples · 135 CloseComponent - Communications Commands: ·
Animation Editor 43
Expressions · 7, 157 CloseErrorLog - Event/Error Commands: · 96
Animations CloseFile - File Commands: · 75
Expressions within · 7 CloseLogFile - Data Logging Commands: · 104
Appendix A CloseLogView - Data Logging Commands: · 104
OPC Communications Control · 144 Colour - Object Commands: · 31
Appendix B Colour Palette · 143
Lite Communications Control · 146 COM · 156
Appendix C Command String Delimiters - Punctuation: · 129
VBScript Features · 151 Communications Commands · 43
Appendix D CloseComponent · 43
JScript Features · 154 EnableDDE · 43
Application · 156 EnableOLE · 44
Arguments · 156 EnablePLC · 44
Arithmetic Operators - Logic and Arithmetic: · 18 OpenComponent · 45
Communications Drive · 156
Constant · 156
Control Object · 156
B Control Statements · 21
Case Selected · 24
Balloon Script - Script Examples: · 136 Do While/Until Loop · 27
Basic Point Assignment – Points: · 16 For...Next Loop · 26
BCD - Text Commands: · 90 Nested Conditional Statements · 22
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON INDEX – Script Language
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON INDEX – Script Language
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON INDEX – Script Language
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON INDEX – Script Language
OutputPoint · 52
PointExists · 52
SetBit · 53
R
SetPointValue · 53
Rand - General Commands: · 41
Point Variable · 160
Read - File Commands: · 79
PointExists - Point Commands: · 52
ReadMessage - File Commands: · 79
Points · 16
Recipe · 160
Basic Point Assignment · 16
Recipe Commands · 86
Boolean · 156
DisplayRecipes · 86
Further Point Assignment · 17
DownloadRecipe · 86, 87
Integer · 158
Relational Operators - Logic and Arithmetic: · 20
Real · 160
Remarks - Miscellaneous Commands: · 131
Script Editor · 17
Report Commands · 87
Text · 161
GenerateReport · 87
PrintActivePage - Printer Commands: · 100
PrintReport · 88
Printer Commands · 98
ViewReport · 89
ClearSpoolQueue · 98
Return - Subroutines: · 28
EnablePrinting · 99
Right - Text Commands: · 94
GetSpoolCount · 99
Rotate - Object Commands: · 35
PrintActivePage · 100
RunApplication - General Commands: · 41
PrintPage · 100
RunHelp - General Commands: · 42
PrintScreen · 101
Runtime Environment · 160
PrintSpoolQueue · 101
SetPrinterConfig · 101
PrintFile - File Commands: · 78
PrintMessage - Text Commands: · 94
PrintPage - Printer Commands: · 100
S
PrintReport - Report Commands: · 88
PrintScreen - Printer Commands: · 101 SCADA · 160
PrintSpoolQueue - Printer Commands: · 101 Script Editor
Program Manager · 160 AND statement · 156
Programmable Logic Controller · See PLC Applications, use of external · 6, 66, 67, 68, 69,
Project · 160 139, 140, 141, 142
Project – Scripts: · 10 Arithmetic functions · 19
Punctuation Conditional statements, nesting · 24
Command String Delimiters · 129 Control Statements · 123. See also Control
Indentation · 130 Statements
Multiple Commands · 130 Current object statement · 29
Parenthesis · 131 Examples · 136
Quotation Marks · 131 Executable files, use of · 6, 67, 157
FALSE Boolean state · 6, 8
Functions and methods, summary of · 16
Logical functions · 20
Q Mathematical precedence · 17, 18
Multiple statements on one line · 130
Nesting conditional statements · 24
Quotation Marks - Punctuation: · 131
NOT statement · 159
Object Commands · 129. See also Object
Commands
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON INDEX – Script Language
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON INDEX – Script Language
BCD · 90
Bin · 90
Chr · 90
FormatText · 91
GetTextLength · 92
Hex · 92
Left · 93
Message · 93
Mid · 94
PrintMessage · 94
Right · 94
TextToValue · 95
ValueToText · 95
Text Object · 161
TextToValue - Text Commands: · 95
Topic · 161
Typographical conventions · 6
U
UploadPLCProgram - PLC Commands: · 59
Using Aliases · 134
V
Validation Code · 161
ValueToText - Text Commands: · 95
VBScript Features · 151
Vertical Fill - Object Commands: · 36
VGA · 161
Video Graphics Adapter · See VGA
ViewReport - Report Commands: · 89
Visible - Object Commands: · 37
Visual Basic Script Features · 151
W
Width - Object Commands: · 38
Windows Desktop · 161
Wizard · 161
Write - File Commands: · 81
WriteMessage - File Commands: · 82
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]
OMRON INDEX – Script Language
AUDIN - 8, avenue de la malle - 51370 Saint Brice Courcelles - Tel : 03.26.04.20.21 - Fax : 03.26.04.28.20 - Web : http: www.audin.fr - Email : [email protected]