Arduino Code to PLC Ladder Logic

Hi All Arduino members! :slight_smile:

I need to change a short Arduino Accel Stepper code for stepper motors to PLC Ladder Logic.

But I can't :frowning:

Please help me guys

here is the code:

#include <AccelStepper.h>

// Define some steppers and the pins the will use
// Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5
AccelStepper stepper2(AccelStepper::FULL4WIRE, 14, 15);
AccelStepper stepper3(AccelStepper::FULL4WIRE, 10, 11);

void setup()
{

stepper2.setMaxSpeed(300.0);
stepper2.setAcceleration(100.0);
stepper2.moveTo(10000);

stepper3.setMaxSpeed(300.0);
stepper3.setAcceleration(100.0);
stepper3.moveTo(10000);
}

void loop()
{
// Change direction at the limits
if (stepper2.distanceToGo() == 0)
stepper2.moveTo(-stepper2.currentPosition());
stepper2.run();
stepper3.run();
}

But I can't smiley-sad

Maybe it's not possible
What can you tell us about ladder logic ? (what do you know about it?)

@picavr,
Thanks for that. I didn't know if anyone had done that.
I take it from your handle that you are working both sides of the street ?
Robert