![]() Obviously this presents some difficulty in Ladder Diagram, but in Structured Text, we can just use a FOR loop. The formula is pretty simple: just add them up and divide by 1000. ![]() Imagine for a moment that you have an array of a thousand REAL data values and you want to compute the average of those values. The most applicable feature of Structured Text for us are LOOPs. Structured Text has similarities to Pascal or BASIC (at least after they removed the concept of line numbers from BASIC). However, we can’t forget that old adage, “use the right tool for the job,” and there are times when Structured Text is the right tool, and Ladder Diagram is not. I prefer writing most of my programs in Ladder Diagram for the obvious reasons: ease of troubleshooting, and the ability of electricians to go online with the program and debug it. In fact, Beckhoff themselves typically present Structured Text as the go-to language for programming in TwinCAT 3. If you’re coming from the Allen-Bradley world then obviously Ladder Diagram is going to be your most comfortable language, but I expect you’ll also want to make use of Structured Text. TwinCAT 3 includes all five IEC-61131-3 languages: Ladder Diagram, Structured Text, Function Block Diagram, Sequential Function Chart, and Instruction List. This chapter is part of the TwinCAT 3 Tutorial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |