EasyManuals Logo

Omron CX-Supervisor Reference Manual

Omron CX-Supervisor
164 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #34 background imageLoading...
Page #34 background image
Point Arrays within Script Commands and Expressions SECTION 4 CX-Supervisor
33
1, 2, 3… 1. Link the toggle button to a textpoint using indirection e.g. ^textpoint.
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.
4-7 Point Arrays within Script Commands and Expressions
It is possible to access the elements of a point array directly or indirectly from
within scripts or expressions.
Setting the value of an array point directly;
arraypoint[2] = 30
Getting the value of an array point directly;
value = arraypoint[2]
"Setting the value of an array point using indirection;
textpoint = "arraypoint"
^textpoint[2] = 30
Getting the value of an array point using indirection;
textpoint = "arraypoint"
value = ^textpoint[2]
An example using Point Arrays
The value of array points can be seen in a situation where it is necessary to
dynamically change the pointname that an object is linked to. In the following
example a toggle button is configured to control the Boolean state of one of
four elements of an array point.
The Boolean array point 'motor' is configured to contain 4 elements.
The integer point 'index' (which has a range 0-3) is used to dynamically
change the element of the point being controlled.
In order to dynamically change the element of a Boolean point that a toggle
button is linked to follow these steps.
1, 2, 3… 1. Link the toggle button to an array point. e.g. 'motor[index]'.
2. Change the value of the 'index' to determine which element of the Boolean
point to control. e.g. via the Edit Point Value (Analogue) animation.
4-8 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.

Table of Contents

Other manuals for Omron CX-Supervisor

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CX-Supervisor and is the answer not in the manual?

Omron CX-Supervisor Specifications

General IconGeneral
BrandOmron
ModelCX-Supervisor
CategorySoftware
LanguageEnglish

Related product manuals