Content: uchebnik-ST-massivy-structury.pdf (569.67 KB)
Uploaded: 31.07.2026

Positive responses: -1
Negative responses: 0

Sold: -1
Refunds: -1

~ $2.36
The exact amount is on the payment page
Programming PLCs in Structured Text (ST) requires more than just syntax knowledge – you need to know how to organise data efficiently in the controller´s memory. If you stick with primitive variables like INT, REAL, and BOOL, you will quickly hit a wall when managing dozens of sensors, hundreds of parameters, or entire interconnected systems.

This manual will teach you to think in terms of data structures. You will master the key tools of industrial programming:

Arrays – homogeneous data collections: declaration, initialisation, finding maximum, average, sorting, multidimensional arrays.

Structures (STRUCT) – grouping logically related variables of different types: creating custom types, accessing fields, passing to functions, initialisation.

Nested structures and arrays of structures – modelling complex objects (conveyor lines, pumping stations, dosing systems) using hierarchical types.

Efficient memory management – using VAR_IN_OUT for pass-by-reference, avoiding costly copying.

Unions – overlaying different types on the same memory area for fast data conversion (bit fields, unpacking REAL into bytes, protocol decoding).

Practical project – building a complete paint mixing workshop management system with order queue, recipe library, state machine, and reporting.

All examples include detailed comments in Russian and are focused on real-world industrial automation tasks. The book is suitable for both beginners and experienced developers who want to systematise their knowledge and move to the next level of PLC program design.
Part 1. Arrays – Collections of Homogeneous Data
Why arrays are critical for industrial automation.

Syntax and declaration.

Initialisation.

Typical tasks: finding maximum, average, bubble sort.

Multidimensional arrays (tables, matrices).

Part 2. Structures – Grouping Heterogeneous Data
When arrays are not enough (pump example with multiple parameters).

Defining and using structures (TYPE ... STRUCT).

Accessing fields via dot notation.

Initialisation (named and positional).

Structures as function parameters.

Practical example: pump monitoring system.

Part 3. Nested Types – Russian Dolls and Conveyors
When a simple array of structures is insufficient.

Designing a conveyor line: station structure, array of stations, nested settings.

Example of a filling line control (state machine per station).

Nesting: structures within structures (PID parameters, error history).

Dangers of incorrect indexing and out-of-bounds access.

Part 4. Efficiency and References (VAR_IN_OUT)
The problem of copying "heavy" data.

The magic of VAR_IN_OUT – pass-by-reference.

Advantages: speed and two-way communication.

Pitfalls of VAR_IN_OUT (cannot pass constants, requires a real variable).

Practical example: efficient management of a station network.

Part 5. UNION – The Two-Faced Janus of Memory
When you need to view data from a different angle (bit fields, unpacking REAL).

Defining UNION.

Examples: decoding status word, converting REAL to/from BYTE array.

Complex example: decoding a network packet.

Physical meaning of UNION – memory saving and instant conversion.

Part 6. Grand Finale – Batch Management System
Problem statement: "Smart Workshop" for paint mixing.

Data foundation: enumerations, recipe structures, orders, equipment.

Helper functions: find recipe, find order, calculate time.

Main controller – state machine (idle, dosing, mixing, unloading).

Additional function: report generation.

Architecture analysis: separation of concerns, scalability, testability, reliability.

Quick Reference Card
Table of key constructs (arrays, structures, access, loops, references, unions, CASE).
No feedback yet