This project is a continuation of the Multivibrator series showing how to replicate a multivibrator in PLCs in multiple different ways. If you are not familiar with the previous iterations of the project, you may want to check them out HERE for reference. In this project the aim is to take the Ladder Logic versions of the multivibrator and recreate them in Structure Text. In the previous versions there were separate programs and sub-programs that handled different focuses. One of the biggest draws for using structure text in PLC programming is that it follows the Pascal coding language. This means you can come from a background of coding in Python or C and you will immediately be able to recognize some of the concepts. The main purpose of this structure text project is a bit different, however.
The aim will be to produce the same results of the Ladder Logic version but using a single program that handles everything. One of the main advantages of having everything happen in the central program is the elimination of most of the global variables. In this code the only global variables are the voltages, capacitor value, and the output LEDs. These could easily be eliminated, however I added them in as they allow external devices to determine the key aspects. Because we did not need as many variables, you may notice that some were more appropriately named while others are skipped over (aka not entered) entirely.
Read the full tutorial here:
Condensing a Multivibrator with Structured Text.docx (88.3 KB)