老外写的ST语言教程_很详细

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
TRUE (1) 255 65535 4.294.967.2 95 127 255
Memory Space
8 Bit 8 Bit 16 Bit 32 Bit
8 Bit 8 Bit
32767 65535
16 Bit 16 Bit
(2^31)-1
32 Bit
2^32 -1
32 Bit
10^38
32 Bit
Choosing : - FBD, the application will be 'mixed’, it will consist
of a main with Atoms, Macroblocks ... but you can use routines (functions and function blocks) written in the
Description
Main program that includes: • read/write I/O • definition of local variables • calls to Functions or Function Blocks
ST statements block with input variables, local variables, and if specified a return value. This can be called at different points of the program. Recursion is not allowed.
ST Language
Basic Course
欧姆龙贸易(上海)有限公司
1
ST Language
•Key word
Basic Course
•If there is any unclear or uncorrected, please feel free to speak out
欧姆龙贸易(上海)有限公司
Global variables declaration
Variable List
Button ‘User’
Button ‘Extend’
‘CarelType ’
‘IECType ’
• Boolean
• BOOL
• Integer/Analog
ST - ST, the application will be developed entirely using
‘ST language’
欧姆龙贸易(上海)有限公司
4
Basic concepts
POU
When programming in ST, the application can be organised using three fundamental programming elements generically called ‘Program Organization Units’ (POU):
2
Requirements
Hardware
The programming language ST is only available for following programmable controllers:
• pCO3 • Supernode • pCO5 • pCO compact
pCO3 Supernode
REAL
Short Integer
Unsigned Short Integer
Integer
Unsigned Integer
Double Integer
Unsigned Double Integer
Real Number
-128 0 -32768 0 -2^31 0
-10^38
Upper limit
欧姆龙贸易(上海)有限公司
6
Declaration of Global variables
•There are two ways to declare Global variables:
– ‘Variable List’ – ‘Textual mode’ of ST language
Note: if you want to see the variable in the pGD, please declare the variable in the Variable List
• PROGRAM • FUNCTION • FUNCTION BLOCK
POU type
Program
Keyห้องสมุดไป่ตู้ord
PROGRAM main
Function
END_PROGRAM FUNCTION
Function block
END_FUNCTION FUNCTION_BLOCK
END_FUNCTION_BLOCK
Note: we can define more functions and function blocks, but only one program main
欧姆龙贸易(上海)有限公司
5
The basic types
The following table lists all the properties of basic types (IECType):
ST statements block with input variables, local variables, and output variables. This can be called at different points of the program. Recursion is not allowed.
Bitstring Integers
Keyword
Data type
Lower limit
BOOL BYTE WORD DWORD
Boolean Bit string Bit string Bit string
FALSE (0) 0 0 0
SINT USINT INT UINT DINT UDINT
pCO5
BIOS
To support ST language, bios version must greater than 5.0
Software
Use a version of 1tool > = 2.1.x
欧姆龙贸易(上海)有限公司
3
Creation of a solution ST Language
相关文档
最新文档