3/16/2010 2:26 AM | |
Joined: 10/7/2005 Last visit: 9/29/2023 Posts: 2989 Rating:
|
Hello Michal CasterlineThis is only true ifif the Block is an SFC or SFB. Any user created Blocks (e.g.FC or FB) do NOT "automatically" manipulate or changethe BR bit when the Block is finished. It is entirely up the programmer of the Blockto decide ifand how to use the BR bit (which's sole purpose is toaffectthe ENO for LAD/FDB display/cascading of Blocks). Moreover, if your FC/FB is executed without any instructions inside of it that manipulate the BR bit, the BR bit (and ENO of the FC/FB) will simply have the status that it had before the FC/FB call. The habit of adding the "SAVE" related Logic into your Blocks is as such a good habit to have. I myself use network templates (it saves me the typing, search the Step 7 help for "Working with Network Templates" to find out more about this useful feature) to quickly addfor example the followingtwo lines to the end of an FC or FB: [code]SET // RLO = 1 SAVE // ENO = 1 to allow cascading in LAD/FBD [/code] I hope this helps and you may also find the FAQ below useful: Significance and use of the BR bit |
Cheers |
|
This contribution was helpful to
1 thankful Users |
3/16/2010 3:06 PM | |
Joined: 1/12/2010 Last visit: 3/11/2022 Posts: 4 Rating:
|
To expand a little I've attached an AWL. The intention is to provide "missing" LAD instructions. I can't imagine a situation where the BR bit wouldn't already be set in any of them. Unless I'm missing something?... AttachmentLAD Instructions.zip (46 Downloads) |
3/17/2010 8:16 AM | |
Joined: 10/7/2005 Last visit: 9/29/2023 Posts: 2989 Rating:
|
Hello again Michal here is my take on your assumptions I beg to differ on this one. STL: Neither the unconditional call ofa Block (via "CALL" command) nor the conditional call of Block (via "CC" command) affects or changes theBR bit so the BRbit will remain in the status that it was. LAD/FBD: An unconditional call of a Block (EN of Block is connected directly to the "power rail' on the left)is the same as an STL "CALL" command (i.e. BRbit will remain in the status that it was). A conditional call of a Block (EN of Block is NOT connecteddirectlyto the "power rail' on the left but instead has contactors or comparators or whatever condition in between) does however mean that the BR bitwill be on if the Block call (the condition) is active (the JNB instruction is now used which will set the BR bit if the condition is true and the Block is called). Could almost agree, except: The BR bit would NOT remain set but rather would remain in the state that it was when the Block was called, so even in a tight little block incapable of changingthe BR bit, itis good pratice to SET the BRjust before exiting the Block(if cascading of Blocks inLAD or FBD is desired) The "STL BlockEnd" is the only one I bother using, but some people find them handy to use for other "real" code template related taks. All three Blocks will - in my humble opinion - finish with the BR bit ON. Block "I-R" must because you are doing a SET/SAVEat the end. The other two must becausethe "JCN" will force the RLO to ON, no other instruction after it will change the RLOyou end the block with a "SAVE" (I'd personally put a "SET" in front of it anyhow so block changes that may affect the RLO after the JCN can be "safely" done) I hope this helps |
Cheers |
|
This contribution was helpful to
1 thankful Users |
3/17/2010 2:12 PM | |
Joined: 1/12/2010 Last visit: 3/11/2022 Posts: 4 Rating:
|
Thank you for your thoughts. Better safe than sorry I guess... |
This contribution was helpful to
1 thankful Users |
Follow us on