S
MART
AXIS P
RO
/ L
ITE
U
SER
'
S
M
ANUAL
FT9Y-B1378
13-1
13:S
CRIPTS
Introduction
A script is a function for programming complicated processing with conditional branch, logical operations, arithmetic operations,
and functions as text.
The programmed scripts can be executed in a ladder program or an FBD program. When the programming language is ladder,
scripts are executed with the SCRPT instruction. For details, see "SmartAXIS Ladder Programming Manual" - Chapter 27 "Script".
When the programming language is FBD, scripts are executed with the SCRPT FB. For details, see "SmartAXIS FBD Programming
Manual" - Chapter 17 "The script FB".
For example, the logical AND operation is written as follows.
■
Script Programming and Management
Scripts are programmed using the Script Editor dialog box in WindLDR and managed with the Script Manager dialog box.
Notes:
In Script Editor, you can program scripts by selecting conditional expressions, operators, and functions from a list, and you can also check
them for errors. The scripts can also be exported as text files, so they can be edited using a text editor such as Notepad. If you save an
edited script as a text file, it can be imported into Script Editor.
For details, see "Script Editor" on page 13-6.
In Script Manager, you can manage the scripts as a group by adding scripts created in Script Editor or deleting them. For details, see "Script
Manager" on page 13-5.
Script Data Type
The data type for the range of data that will be handled in the script must be configured by taking into consideration the details of
the processing in the script including the maximum and minimum values of data that will be handled and whether negative
numbers and real numbers are required.
Note:
The data type is configured in Script Editor. For how to configure it, see "Script Editor" on page 13-6.
Data Types
The following five data types can be processed in a script. For details about data types in ladder, see Chapter 4 "Instructions
Reference" - "Data Types for Advanced Instructions" in the "SmartAXIS Ladder Programming Manual". For details about data types
in FBD, see Chapter 4 "FB Reference" - "Data types" in the "SmartAXIS FBD Programming Manual".
Note:
Some functions cannot be used if the data type is different. Check the function in the notation list.
See "Programming Scripts" on page 13-10.
Ladder diagram
Script
M0100
M0101
[M0100] && [M0101]
←
The script is programmed as text.
Data type
Used
data registers
Processable unit
Data range
Abbreviation
Name
W
Word
1
Unsigned 16 bits
0 to 65,535
I
Integer
1
Signed 15 bits
-32,768 to 32,767
D
Double word
2
Unsigned 32 bits
0 to 4,294,967,295
L
Long
2
Signed 31 bits
-2,147,483,648 to 2,147,483,647
F
Float
2
Signed 32 bits
-3.38 to -1.175495E-38
0
1.175495E-38 to 3.38
Summary of Contents for SmartAXIS FT9Z-1A01
Page 1: ...FT9Y B1378 7...
Page 10: ...TABLE OF CONTENTS Preface 9 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378...
Page 212: ...7 DEVICE ADDRESSES 7 16 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378...
Page 230: ...8 INSTRUCTIONS FUNCTION BLOCKS REFERENCE 8 18 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378...
Page 344: ...13 SCRIPTS 13 36 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378...
Page 386: ...APPENDIX Appendix 16 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378 Japanese Font JIS X0201...
Page 393: ......