TwinCAT 3: Enumerations (Part 18)
Es geht um einen benutzerdefinierten Datentyp: die Aufzählung aka Enumeration.
Wenn ihr nicht wisst, was eine Enumeration ist, erklären wir es euch. Natürlich erfahrt ihr auch, wie ihr eine in TwinCAT deklariert. Außerdem werden wir zusammen ein kleines Beispiel bauen. In diesem nutzen wir die CASE Anweisung, um die 4 verschiedenen Reifegrade einer Banane mithilfe der Enumeration und des to_string Attributes darstellen zu lassen. Ihr werdet schon sehen.
Neben dem to_string Attribut stellen wir euch auch die Attribute “strict” und “qualified only” for.
Es wird informativ und wer jetzt schon weiß, was mit der Banane am 4. Tag passiert, ist einen Ehrenmonkey!
Chapters:
00:00 Intro
00:17 What is an enumeration?
00:27 How to declare an enumeration
01:03 Textlist support
01:20 Declaration and syntax
04:11 Example with CASE instruction 1/3
05:11 How to use the ‚to_string‘ attribute
05:44 Example with CASE instruction 2/3
06:14 How to use the ‚qualified only‘ attribute
06:49 How to use the ’strict‘ attribute
08:48 Example with CASE instruction 3/3
10:17 Outro
<- Part 17
Table of Contents
Part 19 ->