TwinCAT Debug function
TwinCAT PLC D ebug F unction (Using System Check function) [前言] TwinCAT PLC提供 System Check Function , 在 PLC 專案中引用 “CheckBounds,” “CheckDivByte,” 等Check Function時,編譯器會在相關聯運算時自動將該函式一同引入作編譯,以達到先設法避免TwinCAT PLC 出現執行過程的出錯;或避免執行過程變數超出定義邊界造成記憶體重疊,進而利於協助開發人員定位出錯誤碼的位置並修正。 [如何使用System Check function] * 在TwinCAT 2的環境,宣告POU 名為" Checkxxx" 的Function 例如 CheckBound ; CheckDivByte ; CheckDivReal ;CheckDivWord ; CheckDivDWord ... https://infosys.beckhoff.com/content/1033/tcplccontrol/html/tcplcctrl_checkbounds.htm?id=4661841464054853992 並依說明檔之範例定義VAR_INPUT & VAR_OUTPUT 層級變數,並將範例程式複製到函式的程式碼區塊中即可,不需特定自行呼叫,編譯器檢查到有此名稱之POU函數,即會自動在該運算時加入Check功能 [Foreword] TwinCAT provide s system check function s in the TwinCAT PLC compile r. When a PLC project includes POU, “CheckBounds,” “CheckDivByte,” etc., the PLC compiler produces additional program code internally in certain conditions, such as index variable access or division operation, and...