Sending stepper motor controls to PLC


Thread Starter


Hi everyone,

I'm currently working on a XYZ-plotter that is controlled from a PC. The signal chain is:

PC --> PLC --> PWM --> Stepper motor drivers --> Stepper Motors

The user will load a 3D model into CAD software on the PC, and generate NC code on the PC. Then, a simple piece of software has been written to calculate for the steppers:

- number of pulses
- pulse rate
- direction

.. based on the NC code generated. I want to send "number of pulses", "pulse rate" and "direction" to the PLC. Is it possible to do this, and if so, how? The PLC used is a Siemens s7-300, model 313C.

Usually PLCs will be used for repetitive tasks so this is not an issue. For example, "move stepper 100 steps CW, then move stepper 50 steps CCW, etc." In this case I could just program this routine directly into the PLC program. The problem here is that the routine for the PLC will change depending on the CAD model loaded into the PC. So the PC has to constantly send new stepper commands to the PLC.

The PLC has a RS-232 serial port and a LAN port. Is it possible to send the commands through the RS-232/LAN? I think the RS-232 is only used for downloading PLC programs, not for passing parameters like what I want to do.
The programming interface can also be used to read and write data to the PLC. You will need a special (and usually expensive) driver for it. Your local Siemens distributor should be able to help you with this. You will also need to write some software to read the appropriate data, convert the format to something the PLC will understand, and download it to the PLC.

The following isn't directly related to your question, but there is software available "" which will do the whole CNC system on a PC without using a PLC. You download the system, burn it to CD, and install it on a PC. The operating system is included, so you can install it on a blank hard drive and get a complete system.

Here is a Youtube video of someone doing something similar to you with this software.