{}

Our Brands

Impact-Company-Logo-English Black-01-177x54

Welcome to the Schneider Electric Website

Welcome to our website.
How can we help you today?
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.


Schneider Electric Australia

Explore more
Range:
Articles that might be helpful Users group

Discuss this topic with experts

Visit our Community for first-hand insights from experts and peers on this topic and more.
Explore more
Range: