我们今天能为您提供什么帮助?

What is the best practice to handle a logic with two Function Blocks in a Jump loop?

Issue
As defined in IEC61131-3, the outputs from deactivated functions (caused by EN=0 or an error during execution) are undefined and programmers have to avoid the kind of code below when have it inside of a Jump loop.
im1

Product Line
Ecostruxure Control Expert

Environment
Control Expert v14.1, Windows 10 version 1902 (OS Build 18362.30)

Resolution
The EcoStruxure Control Expert Help states that as defined in IEC61131-3, the outputs from deactivated functions (caused by EN=0 or an error during execution) are undefined. So based on the picture above, if the EN of FUNCBLOCK_1 is set to "0", the link on output OUT of FUNCBLOCK_1 maintains the old status it had during the last correctly executed cycle.
This should be taken in consideration while you are developing your program, specially if you have it inside of jump loops as in this scenario the same Function Block is executed multiple time the logic on the same cycle, and the output is maintained.
You can find below an illustration of this behavior:
im2

In this case, the value 1 of the ADD will be added to all the variables of the CountArray[LoopIndex] array if the first bit of the EnabelArray[LoopIndex] has the value 1 as the GE maintains the status of the first time that the logic is executed in the loop for the same scan of the PLC. To avoid this scenario, you should change your logic to one of the two best practices of programming shown below using a contact between the two Function Blocks or an AND.
im3 im4

P.S.: You can find more information about this topic on page 296 of the EcoStruxure Control Expert - Program Languages and Structure Reference Manual.


施耐德電機Taiwan

探索更多

探索更多

需要協助?

產品選型工具

快速輕鬆地為您的應用找到合適的產品和附件。

取得報價

立即線上提交您的銷售需求,專業團隊將主動聯繫您。

購買地點

輕鬆在您所在地區找到最近的施耐德電機經銷商。

支援中心

在同一位置找到滿足您所有需求的支援資源。