Download ADwin

Transcript
ADwin
Table of contents
4.2.2 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.3 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.4 Entering Numerical Values . . . . . . . . . . . . . . . . . . . . . .
4.2.5 Global Variables (Parameters) . . . . . . . . . . . . . . . . . . .
4.2.6 Global Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.7 System Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.8 Local Variables and Arrays . . . . . . . . . . . . . . . . . . . . . .
4.3 Variables and Arrays – Details . . . . . . . . . . . . . . . . . . . . . .
4.3.1 Variables and Arrays in the Data Memory . . . . . . . . . . .
4.3.2 Memory Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3.3 2-dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3.4 The Data Structure FIFO . . . . . . . . . . . . . . . . . . . . . . . .
4.3.5 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Normal Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Assignment via Escape Sequence . . . . . . . . . . .
String Assignments that are NOT Recommended. . . . . . . .
4.4 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4.1 Evaluation of Operators . . . . . . . . . . . . . . . . . . . . . . . . .
4.4.2 Type Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5 Selection structures, Loops and Modules . . . . . . . . . . . . . .
4.5.1 Subroutine and Function Macros . . . . . . . . . . . . . . . . . .
4.5.2 Include-Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5.3 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
76
77
79
79
80
82
82
83
83
84
85
87
88
89
90
91
92
92
94
96
96
97
97
5 Optimizing Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.1 Measuring the Processing Time . . . . . . . . . . . . . . . . . . . . . 99
5.2 Useful Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.2.1 Accessing Hardware Addresses . . . . . . . . . . . . . . . . . 100
5.2.2 Constants instead of Variables . . . . . . . . . . . . . . . . . . 100
5.2.3 Faster Measurement Function . . . . . . . . . . . . . . . . . . . 101
5.2.4 Setting Waiting Times Exactly . . . . . . . . . . . . . . . . . . . 101
5.2.5 Using Waiting Times . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.2.6 Optimization with Processor T11 . . . . . . . . . . . . . . . . . 105
5.3 Debugging and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 105
5.3.1 Finding Run-time Errors (Debug Mode) . . . . . . . . . . . . 106
5.3.2 Check the Timing Characteristics (Timing Mode) . . . . 106
Checking Number and Priority of Processes . . . . . . . . . . . 107
Optimal Timing Characteristics of Processes . . . . . . . . . . 108
ADbasic 5.00, Manual March 2010
V