PLC program

Pleas can some one translate this for Arduino.

Nothing attached !!!

Sure here it is:

:smiley:

And here it is for the Arduino:

:slight_smile:

Beat you to it. ;D

Although technically it should be (with comments):

/*
 * nothing
 *
 * This sketch does nothing
 *
 */

void setup () 
{
     // do nothing
}
void loop ()
{
     // do nothing
}

PLC's are programmed completely differently to an Arduino.

What you need to do is read each input and then update each output based on what the inputs are (Which can be redone just using C programming and "ditching" the PLC format).

If you are translating a large PLC program that you do not want to re-write, you can follow this logic:
If 2 input switches are in series, use an AND statement; if they are in parallel, use an OR statement, and check everything before updating.

However, be aware that the Arduino does not have the safety functions that are included on a PLC, so you would be better staying with them.