TIA Portal - several program cycles

rQx

Lifetime Supporting Member
Join Date
Oct 2010
Location
Trelleborg
Posts
1,051
Hi,
I have all my program in OB1 with FCs and FBs, taking up apporx 45 networks.
If I add more program cycles for example 123 and 124.
I assume that the program scan will be OB1 ->OB123->OB124?
Can I delete OB1 or does it have to be there?
I wan't to structure my programming a little bit more so the networks that aren't used as mush in the programming and fault finding will be moved to other OBs and left in my "main" OB will be the core of the machine.

Also, bonus question: I have set up three DBs for HMIcontrol, HMIsettings and status. Would you set it up in one DB and using STRUCTS to divide them, haveing one large DB or is smaller DBs to be prefered? Maybe also smaller DBs then I have? HMIsettingAutomaticmode, HMIsettingHandmode etc etc

/Tim
 
Always use OB1.

Dont ever try to do something else.

Others OB are either for periodic, errors catching or event based.
 
Hi,
I wan't to structure my programming a little bit more so the networks that aren't used as mush in the programming and fault finding will be moved to other OBs and left in my "main" OB will be the core of the machine.


You could also move the code into an FC and call it from an OB, but both approaches are valid.



Personally I try to keep the number of OBs minimized for easy troubleshooting later



Also, bonus question: I have set up three DBs for HMIcontrol, HMIsettings and status. Would you set it up in one DB and using STRUCTS to divide them, haveing one large DB or is smaller DBs to be prefered? Maybe also smaller DBs then I have? HMIsettingAutomaticmode, HMIsettingHandmode etc etc

With Optimized DBs, I think the max DB size is pretty much your PLCs work memory. I'd recommend keeping it however you feel it is most organized; it's mostly personal preference. I try to keep things mostly centralized, but if your structures are many layers deep (HMIDB.settings.cell1.zone3.modes.auto.tagname, etc) eventually it reaches a point where typing them potentially gets a little unwieldy.


The other thing to keep in mind is that if you make changes to a DB and then DL, it needs to reinitiailze everything back to start values (unless you have DL w/o reinit turned on already). Separating things into different DBs can minimize what needs to be reinitialized when you change.
 
Always use OB1.

Dont ever try to do something else.

Others OB are either for periodic, errors catching or event based.


in 1200/1500 you can have multiple Cyclic OBs, which are treated just like adding code to the end of OB 1. OB numbers above 123 are freely assignable, and have no special meaning.



Cyclic OBs are different from a cyclic interrupt, which is like the OB35 type call from 300/400s.
 
OB1 has to be there because it dictates the overall flow of your program scanning. The FB's and FC's that typically make up the meat of your program should be called from it. There are other OB's that are dedicated to the things I think you're looking to do(Cyclic Interrupt OB30, Rack failure OB86, program faults OB121, etc). The controller will call these in their numeric sequence if they are used in your program. OB's that are > 123 can be whatever you want them to be.

So the core of your program should be in the form of FC's and FB's called from OB1, and all of the stuff mentioned above would be in the other OB's.

As far as DB's are concerned I think it's up to you. I usually see the DB's split into smaller groups that are contained by function so when I do any Siemens programming I keep them in smaller groups.

Hope this helps
 
As mk42 pointed out you can have as many cyclic OBs as the system allows which is stated in their manuals and online help. You can also see it by right clicking on any cyclic OB and select properties>general then choose "Manual" for numbering and when you click in the text box a little yellow information popup will show the valid range of numbers 1;123-32767. Meaning either the number 1 or any number between 123 and 32767. It does not have to be 1.
I often develop reusable blocks in project by their own complete with their own OB and I pick a remote number like 2000 or whatever and put them all in a folder. Whenever I need to use those block I drag the whole folder and drop it in the current project and for as long as they can operate independently and do not require to be inserted in a specific spot, I keep them with their cyclic OB.

I've also seen a project developed entirely with cyclic OBs. That was new.
 

Similar Topics

Hi All, Someone at work has put a PLC system on my desk, that's just been taken off an idle production line. He said "It's an S7 PLC. We don't...
Replies
10
Views
260
Hi guys , I'm new with Allen Bradley, but I have experience with Tia portal (s7 1200 ,s7 1500) I want to convert my project from Tia portal to...
Replies
2
Views
210
Hi, I have had problem with upgrading some projects from v16 to v18. I tried it on 3 diffrent computers. I want to post this so that anyone that...
Replies
3
Views
176
Hello gentlemen, Im working on a small project on TIA Portal, about establishing a Modbus TCP connection between my ET200SP plc and a socomec...
Replies
12
Views
312
I am currently am in a PLC class and need urgent help on how the ladder logic would be laid out. I understand how to get the traffic lights to...
Replies
19
Views
447
Back
Top Bottom