Reference Manual Mint Basic Programming
Total Page:16
File Type:pdf, Size:1020Kb
ABB motion control Reference manual Mint Basic Programming MN1955WEN You can find manuals and other product documents in PDF format on the Internet. See section Document library on the Internet on the inside of the back cover. For manuals not available in the Document library, contact your local ABB representative. Contents Contents 1 General Information 2 Overview 2.1 Introduction . 2-1 2.2 What is Mint? . 2-1 2.3 Mint Basic . 2-2 3 Building Blocks 3.1 Introduction . 3-1 3.2 Identifiers . 3-1 3.3 Literals . 3-2 3.3.1 Numbers . 3-2 3.3.2 Characters. 3-6 3.3.3 Strings . 3-7 3.4 Data types . 3-8 3.4.1 Integer . 3-8 3.4.2 Float . 3-8 3.4.3 String. 3-8 3.4.4 Time . 3-8 3.4.5 Controller. 3-9 3.4.6 Semaphore . 3-9 3.4.7 User defined . 3-9 3.4.8 Memory usage . 3-10 3.5 Variables . 3-11 3.6 Statements. 3-12 3.6.1 Statement separation . 3-12 3.6.2 Line continuation . 3-12 3.7 Modules . 3-14 3.8 Program . 3-15 3.8.1 Layout . 3-15 3.8.2 Comments. 3-15 3.8.3 White space . 3-15 3.8.4 Compilation Errors . 3-17 3.8.5 Execution . 3-17 4 Expressions 4.1 Introduction . 4-1 4.2 Operators. 4-2 4.2.1 Arithmetic operators . 4-2 4.2.2 Relational operators . 4-2 MN1955WEN Contents i 4.2.3 Logical operators . .4-3 4.2.4 Bitwise operators . .4-4 4.2.5 String concatenation operator . .4-5 4.2.6 Immediate If operator . .4-5 4.2.7 Is operator . .4-5 4.2.8 Miscellaneous operators . .4-6 4.3 Order of evaluation . .4-7 4.3.1 Operator precedence . .4-7 4.3.2 Use of brackets . .4-8 4.4 Functions. .4-10 4.5 Type casting . .4-11 4.6 Floating-point limitations . .4-12 4.6.1 General Properties . .4-12 5 Declaration Statements 5.1 Introduction . .5-1 5.2 Constants . .5-1 5.3 Defines . .5-2 5.4 Variables . .5-3 5.4.1 Simple . .5-3 5.4.2 Arrays. .5-4 5.4.3 Memory usage . .5-5 5.5 Structures . .5-6 5.6 Bitfields . .5-8 5.7 Labels . .5-10 6 Action Statements 6.1 Introduction . .6-1 6.2 Assignment . .6-1 6.3 Commands . .6-3 6.4 Control flow . .6-4 6.4.1 Conditional execution. .6-4 6.4.2 Repetitive execution. .6-7 6.4.3 Overriding the natural flow of execution. .6-10 6.4.4 Keyword qualification . .6-11 6.4.5 Labeled qualification . .6-12 6.4.6 GoTo statement . .6-14 6.4.7 Delaying execution. .6-14 7 Directive Statements 7.1 Introduction . .7-1 7.2 Auto . .7-2 ii Contents MN1955WEN 7.3 Option . 7-3 7.3.1 Compatibility options . 7-3 7.3.2 Keyword support options. 7-4 7.3.3 Code generation options . 7-5 7.3.4 Error and warning options . ..