simple question

basharath

Member
Join Date
Mar 2010
Location
hyderabad
Posts
103
we do the plc programming in ladder and other languages...when this programming is converting into "c' code at the back end.why cant we develop it in c itself.
is it correct that this is just because the technicians cant do programming.
 
we do the plc programming in ladder and other languages...when this programming is converting into "c' code at the back end.why cant we develop it in c itself.
is it correct that this is just because the technicians cant do programming.

I think you are a little confused. Ladder (or other languages) don't get converted to C. In order to run a program must be compiled to machine code or sent through an interpreter that ultimately executes the machine code. The compiler or interpreter may have been written in C, but that doesn't mean it converts the PLC program to C.

The last part of your question however is on track - programming a reliable and complex program in C requires considerable care and skill. C is immensely flexible and it will give you all the rope you need to hang yourself. I've written several programs in C for embedded controllers and the C program are much more difficult to write than ladder - its quite a bit beyond some PLC programmers. But there are also lots of experienced programmers who do very well with both ladder and C.
 
I agree with alaric, there is no point in writing machine plc code in c, plc's have a unique structure that suits automation control, it has many features to protect from bad programming practices like going into stop if the program hangs, or faults in the hardware & turning off outputs just look at windows how many times has scada or HMi hung just when you want to stop a pump because it's wired the wrong way (manual control/testing via HMI etc.).
It's very rare for a plc to fault & leave something running (except for real hardware faults)
Lets keep the plc anyway if you use c in a plc then it would convert it into the same machine code used in ladder so don't see the point, quite frankly the use of script type language used in siemens & many others seems a waste of time, it's only use is to transport code from one platform to another, this never works properly as the instructions are different, even looking at s5 to s7 conversion only works on some code.
sorry if any mistakes in this left my glasses at work,
can't see a damm thing
 
Every program gets converted reguardless of what it is writen in, unless you are writing in machine code itself. Heck even Basic from way back converted to machine code or also known as Asembly Code.

C has its good points but trouble shooting and debugging is a nightmare. Just look at what happpens with Microsoft if you do not believe me.

Ladder is much easier to debug and it has built in safeties. The most import to me being when you turn something on. You do not have to remeber to turn it off. Your basically working with one state and what you do not program for is the other state. Also because of it "user friendly" layout it is much easier to learn.
 

Similar Topics

Hello again..trying something on an existing poorly written program and just wanted to double check something system is an A-B MicroLogix 1200 In...
Replies
5
Views
197
Hi all, Writng a FB in ST on Beckhoff TC for a pulser which turns on and off on a cycle, is paused by turning bControlInput to FALSE, but resumes...
Replies
6
Views
275
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
355
Been working with PLCs for a couple of decades, but almost 100% DirectLogic. Have a customer who wanted me to make a couple of simple changes to a...
Replies
3
Views
1,134
Will going online with a modicon controller in Proworx 32 write to the controller? I have a backup of the program open and would like to go...
Replies
5
Views
2,185
Back
Top Bottom