2/1/2015 4:17 PM | |
Posts: 288 Rating:
|
thanks a lot for your reply and sharing your experiences dear William B.. could you please write an easy sample program and apply all your programming tips on it? i think if we can gain to a standard way for writing plc program in such a way that all safety precautions considered and use sequencing method we can use this structure on all machines with a little change. Dear experts i am waiting for your suggestion and experiences like Mr Wiliam B. thanks again for your helpful comments dear William B.. |
2/1/2015 5:50 PM | |
Posts: 288 Rating:
|
i wrote a sample program some days ago and simulate it on spsvisu software. in practice i1.0 should come from hardware (from safety relay which get active if all doors became closed and emergency button is released and etc) but i triggered this bit by pressing "machine on" button on spsvisu software. now please let me know what programming tips should i consider for an industrial programming. i know that if any door became open or emergency stop button pressed during operation 24vdc on plc output cards should be cut off except some electric brake on motors or vfds. best regards. Attachmentsample.zip (342 Downloads) |
2/2/2015 12:18 AM | |
Joined: 9/27/2006 Last visit: 9/4/2024 Posts: 12282 Rating:
|
Hello saeed; I agrre with both Berg's and William B's interventions. You really must understand the basics of structured programming if you want to take full advantage of Siemend PLCs. I suggest that you open one of the fndamental manuals that comes with Step 7; it is insatalled on your computer along with Simatic Manager, in the Documentation folder of Simatic software. It is callew Working with Step 7, and the chapter on Function Blocks and data Blocks has a very clear, understandable example for creating a structured program. I suggest you go through the motor control example step by step, then re-examine your own project and see if you can reorganize it as a structured program. In case you cannot locate thie document on your computer, you can download it here: SIMATIC Working with STEP 7 V5.5 Hope this helps, Daniel Chartier |
This contribution was helpful to
2 thankful Users |
2/2/2015 11:03 AM | |
Joined: 9/23/2005 Last visit: 9/6/2024 Posts: 4686 Rating:
|
Hi saeedplc. I reviewed your code and some directremarks came to my mind. But I'll start from something else... In so-called digital circuit theory there're two important beasts - the combinational logic and the sequential logic (state machines). I see many programmers using the former to achieve the latter. They end up with a lot of riseing/falling edges (or one-time shots (in the head probably)as yankeescall it) and very complicatedclauses for set/reset. Debugging of such a code is usually a nightmare as it's hard to follow. And in the real life of machines it very often comes out that the logic switches in some unpredicted circumstances. Then it's patched to cover them. Which creates new unpredicted behaviours... And so on and on. It can be even funny to see sometimesa machine goingwild. Unless it creates hammering in 5m^3/minute @40 atm pipe line and you are next to arelief valve... Or somthing similarily lethal. In my opinion the cure for that is an explicit state machine with clearly defined states. That was preaching. Let me come back to your code as such. First of all - using set/reset directly on the outputs - you make an output your state memory - bad idea in the real life. Use some static variable to set/reset and then assign it to an output. And put safety clauses and interlocks in between. It will make your logic more legible and much safer. Block, you program, need memory - so it's much more clear to use FBs and their static data. This approach is replicable. You write code once and you can use it many times to control similar objects. Attachmentsample.zip (355 Downloads) |
Last edited by: jacek d at: 2/6/2015 1:14:07 PMattachment added Regards, |
|
Follow us on