Siemens S7 SBR

garryt1

Member
Join Date
Jun 2002
Location
n.ireland
Posts
128
Can Someone with siemens s7 experience please confirm my thoughts on how a subroutine is called and returned,as far as i know the following is the correct method but i would just like some reassurance from an S7 expert.

network ?

I.?
----||----------------Sbr ?

Then within the subroutine at the end of the code:

----------(RET).

Can someone confirm this please! beerchug beerchug
 
I am NOT an expert but I do watch things about Siemens. I assume this is an S7-200 since the S7-300/400 doesnt have an SBR command.

The Siemens support site has some downloadable examples of subroutines etc.SIEMENS S7-200 DOWNLOADS<the link to them
 
If this is an S7-200, I believe you call the subroutine using the CALL instruction with the desired subroutine number. The subroutine itself should be setup with the SBR instruction (with the appropriate number), the subroutine code, and a non-conditional RET instruction. Conditional RET instructions can exist in the subroutine if needed. All subroutines must be after the main ladder END instruction.
 
Hi could you tell me which S7 CPU you are using either S7-200 S7-300 or S7-400 series and are you wanting to pass any data to the sub or just jump and return?

We only use seimens at work so we will try to help
 
Hi Homer,

It is a type S7 214 cpu,i am only jumping to the sbr and scanning some logic then returning to OB1.

thanks
 
Hi garry

I am not 100% certain because I haven't used a 200 my self but if you usr the call statment in stl this will jump to your sub when the sub has finished it should just jump back to the next command in OB1.

As I say I am not sure but I will try to find out tonight when I am at work. Then post a more definate reply.

Get back to you soon :cool:
 

Similar Topics

Hello, I have a CPU 317-2DP Firmware Version V2.1.8. In TIA Portal only V2.6 is available, and there is no option to upgrade FW. Then I open it...
Replies
2
Views
50
HI everyone, i am new to Siemens plc programming and i am in need of some help. yesterday we had an S7-1200 CPU 1214C fail to turn on an output to...
Replies
7
Views
202
Hi PLC people, think about this scenario: The PLC is somehow connected to the same network with the facilities` network. Then someone connects to...
Replies
2
Views
89
Hello everyone, I've had this issue for the last 2 days where I try to assign the profisafe address to an IO block (6ES7 146-6FF00-0AB0) but when...
Replies
5
Views
157
Hello, good morning, I have been having two problems with the Tia Portal software. The first is that I have installed it on my computer and...
Replies
5
Views
192
Back
Top Bottom