PLC code structuring

Join Date
Aug 2002
Location
Manchester
Posts
527
Hi
I'm after some suggestions.
When programming an SLC, I like to structure data tables as follows:
LAD 5
Binary B53:xx
Timers T54:xx
Integers N57:xx

LAD 6
B63:xx
Timers T64:xx
etc.
You end up with a lot of data tables, but they're generally short and it's really easy to modify the programme in the future. All our customers love it.

Does anyone have a nice way of doing something similar with Step 7, other than a piece of paper and checking off the M's when used?

Thanks
 
:D I don't know what Step 7 is. GE uses %M but I don't know GE well engough to give any ideas. By the way, do you or anyone see any reason for the % ? just an extra keystroke as far as I can see, one of the reasons i dislike GE.

But, I have been structuring AB DATA TABLES the way you are doing, and thought I was the only one. It means u have thought before writing logic, what needs to done and how to do it. The Final program can be understood by others (Maint Tech's) and Trigger a Growing insight in better PLC logic design.

Don't stop with data files, use ladder 11,12,13,14 etc.. for station 1,2, 3,4, or whatever also. Next step, you will suddenly see amazing posibilities for using INDEX AND IDIRECTED Addressing.
 
One can do wonders with a S7

I would not use the main memory for anything that isn't global. Most things should be put in data blocks. Another thing you can do with a S7 that a PLC/5 can't do is mix and match data types in a data block. If one has a project that has 8 axes of motion, one can create a data block for each axis that has all the infomation ( bits, bytes, integers, float etc ) for that axis. The data block can then be passed as a parameter to a function block or function. In general, each significant widget should have it own data block. To create another widget one can just create another data block.
 
Peter
So could I create a DB with all the memory for a function?
The obvious way is FC1 with DB1, FC2 with DB2 etc.
I remember S5 didn't like you manipulating bits within a dataword (it took ages). S7 doesn't have this problem I guess?
If you have some sample code I'd appreciate it.
Thanks
 
paraffin power said:
Peter
So could I create a DB with all the memory for a function?


Yes, but I like prefer that all the data for a widget is kept in a data block.

[/B]
The obvious way is FC1 with DB1, FC2 with DB2 etc.

Yes, but that assumes the is only one function that a widget can do.
Maybe so, depending on your application.


I remember S5 didn't like you manipulating bits within a dataword (it took ages). S7 doesn't have this problem I guess?

No, not with bits. Although I did find it easier to copy a word into a group of bits.


If you have some sample code I'd appreciate it.
Thanks

Example S7 code with almost all code in DB.

This was my first S7 program. It demonstrates how to communicate with a motion controller usinsg Profibus DP. I used one DB for the motion controller. I then passed the DB block to different functions. This made adding another motion controller easy. I don't think I used the main memory at all.
 

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
230
I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
197
I want to set user security level based on the value of a tag in my PLC called "ActiveUser". That tag will contain the A-P code which we use for...
Replies
6
Views
214
Hi All, I wanted some feedback/thoughts on code implementation or development across several offices. What has been your collaborative...
Replies
6
Views
407
Hi! I'm fairly new to PLCs, and a PLC I was swapping sensors for shows the error code 497 - 0x050000 on the top of the HMI when I powered it back...
Replies
6
Views
610
Back
Top Bottom