You need more logic than simply calling adslogstr anyway because if by any chance adslogstr is called cyclically, you end up spamming the event logger.The error code and the string would then be visualized in the Debug-Visualization.Įven if it's a little more effort than simply calling adslogstr I would rather implement a separate Debug-FunctionBlock for 3 reasons: This section gives an example of the structures and the function block. In your case for example I would simply call a special method of the Debug-FunctionBlock with an errror code and a string when the program flow reaches the default-case. TwinCAT contains an embedded IEC 61131-3 software PLC which is the main focus. But im not satisfied how the TcPOU files (xml formatted) are displayed. There is an extension that enables syntax highlighting for ST (Structured Text) which is great. I always build a separate Debug-Visualization in the plc together with a special Debug FunctionBlock which helps me to track bugs in the project. Since Beckhoffs TwinCAT3 Shell is missing basic function that are considered standard in other IDEs im trying to switch to VS Code to do the job. If you don't have real hardware and an ethercat master attached in your project you can use breakpoints without any worries. You can set breakpoints when you are in online-mode, but as pboedker pointed out as soon as the breakpoint is reached (unless you have a special configuration, but this is another subject) your ethercat master will timeout, your safety module will produce a com error and your drives will need a reset aswell.
0 Comments
Leave a Reply. |