Conditional Block End (BEC) by S7-1500 in TIA Portal

spandy16

Member
Join Date
Dec 2012
Location
Germany
Posts
58
I had migrated my software from S7-300 controller to S7-1500 controller in TIA Portal. Afterwards I got an error in one FB during compilation, saying "RLO is not initialized". The code was as follows,

NW1: condition 1, condition 2 then JMP: END

------------
------------
NW X: END: NOP 0
BEC

My question, is it possible that I use a RET instruction directly in the first RUNG with the conditions and remove the BEC code?
 
Last edited:
I had migrated my software from S7-300 controller to S7-1500 controller in TIA Portal. Afterwards I got an error in one FB during compilation, saying "RLO is not initialized". The code was as follows,

NW1: condition 1, condition 2 then JMP: END

------------
------------
NW X: END: NOP 0
BEC

My question, is it possible that I use a RET instruction directly in the first RUNG with the conditions and remove the BEC code?
Is there any code after the BEC, if not use BEU
 
That does sound logical but why was the jump there in the first place? It could have been written Condition 1, condition 2 etc BEC. In S7 classic, the JP instruction does not set the status of RLO so I guess that the same applies to TIA. If the original jump instruction was JC then RLO is set to 1 when JC is executed so you can write:

Code:
A I xxx
O M yyy
JC M001
S M zzz
JU END
M001: R M zzz
END: NOP 0



Nick
 
The JMP was there because the next Logic instructions could be executed if the JMP condition was not satisfied. And the BEC command is in the last Network of the FB.

Is it possible that I use

END: SET
BEC

That does sound logical but why was the jump there in the first place? It could have been written Condition 1, condition 2 etc BEC. In S7 classic, the JP instruction does not set the status of RLO so I guess that the same applies to TIA. If the original jump instruction was JC then RLO is set to 1 when JC is executed so you can write:

Code:
A I xxx
O M yyy
JC M001
S M zzz
JU END
M001: R M zzz
END: NOP 0

Nick
 
If the 1500 works like the 300/400 (which I don't know ...yet), it is good practice to end all blocks with

SET
SAVE

This sets the ENO (and BR) to TRUE and you can link other blocks when used in LAD(KOP) and FBD(FUP).

Kalle
 
My code would have looked like this

NW1: condition 1, condition 2 then BEC

------------
------------
BE


If its the last bit of code, why jump down to BE
 
If the 1500 works like the 300/400 (which I don't know ...yet), it is good practice to end all blocks with

SET
SAVE

This sets the ENO (and BR) to TRUE and you can link other blocks when used in LAD(KOP) and FBD(FUP).

Kalle

In all my years of programming S7, I never once did SET, SAVE at the end of a Function. I never used it to continue code outside the block, which I believe is the only time you would do that.
 
In all my years of programming S7, I never once did SET, SAVE at the end of a Function. I never used it to continue code outside the block, which I believe is the only time you would do that.

Yes.
If you call the FB/FC in LAD you can continue the rung from the ENO. This can also be convenient in FBD and even in CFC.

Kalle
 

Similar Topics

I had migrated my software from S7-300 controller to S7-1500 controller in TIA Portal. Afterwards I got an error in one FB during compilation...
Replies
1
Views
1,595
Hi I'm trying to read a block of 10 values from a plc, based upon time or a signal from the plc. I have managed to setup the links and have used...
Replies
3
Views
3,663
Hi I have a Crimson 3.1 project which have conditional images and buttons managed by parameters shared with a PLC across a Modbus interface...
Replies
2
Views
858
In GT designer 3, the rig operator wants me to display a text string on the screen when a bit goes TRUE, and make it disappear when the bit goes...
Replies
5
Views
1,885
I have 7 input meters to my Red Lion HMI and I need to get 4 readouts on the panel which give the sum of all of meters selected for that output...
Replies
4
Views
1,718
Back
Top Bottom