Author Topic: Modbus Stepper Control  (Read 11323 times)

mvincent

  • Newbie
  • Posts: 8
  • Ska Brew!
    • View Profile
Modbus Stepper Control
« on: November 05, 2011, 08:14:32 AM »
Hello People,

I am fairly new to the world of PLC programming and I am at a sticking point with the program I am working on.

I am trying to control 7 stepper motors from 2-F2424's  and one nano.  I need to send a modbus command(?) to the other plc's to start the stepper motors.  I am trying to align beer cans for proper facing on the shelf before the sixpack ring is applied.  I have a succesful program except for sending signals out the the 4 external (from the master F2424) stepper motors.  There is a DM value that tells the stepper motors how far to travel after the photoeye spots the alignment mark(for different brands).

I have it all working great in simulation mode, I just need to figure out how to make the other motors work like the first 4.  The 7th motor is for the six pack ring advance. I though about doing it via DI/DO's but I can't set the value from my HMI if I do it that way.(at least I think)

So to sum it up, How do you send a stepmove and stepstop command to the other two plc's from with in my ladder program while keeping my DM value(from HMI Input)?

Thanks

matt@skabrewing.com


garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:Modbus Stepper Control
« Reply #1 on: November 05, 2011, 09:19:52 PM »
I'd suggest that you use two or more DM[] locations for each stepper  channel.

As an example use:
DM[1] for control for stepper #1
DM[2] for position for stepper #1
DM[3] for control for stepper #2
DM[4] for position for stepper #2
   .
   .
   .
DM[13] for control for stepper #7
DM[14] for position for stepper #7

The master Plc updates the position info DM[2], first, then writes a non-zero command to the control register, DM[1].

The slave Plc detects the non-zero value and executes the appropriate stepper command.  When the command completes, the slave Plc clears the control value (sets it to 0).

The master Plc polls the control register in the slave Plc and must not change values until it "sees" that the slave is ready to accept the next command for that stepper channel.

You will need to use modbus commands to read and write to slave Plc DM registers.

Gary d