Skip to main content

Kollmorgen Support Network

Macro Programming | 23 Oct 2008 | |

Macro Programming

Valid for S300, S700

Introduction

The Macro Language is a firmware part of the S300/S700 servo amplifiers. It provides programmable positioning capability to these high performance digital servo amplifiers. The development tool MacroStar helps the user to create macro programs.

  • Based on structured text as per IEC 61131.
  • Execution up to 16 kHz.
  • Working autarkic or parallel to field bus systems.
  • Four different (real) real time loops.
  • Access to all I/Os.
  • Access to all parameters, actual data and target data.
  • Access to up to 16 tables with up to 8,000 supports.
  • Interpolation between supports.
  • CANopen communication for multi-axis systems without external PLC.
  • Camming / Table positioning.
  • Access to SD memory card.
  • Access to the display of the servo amplifier.
  • Output from macro to the RS 232.
  • Self generated macro parameters can be measured in the internal oscilloscope.
  • High degree of functionality. Very close to the hardware.

Preconditions for using macro programming:

  • S300 / S700 with firmware >= 2.14
  • Development Tool MacroStar 

Download the converted file to the servo amplifier with the Upgrade Tool (File Selector, upgrade task: PLC program).

Macro Language

Example Program

The demo program is supposed to show a little bit of the possibilities available with PLC funtionality inside the S300 & S700, it is no real application.

A digital speed can be commanded with a digital input, and the actual speed value can be printed out in a terminal program. Two user variables allow to set the speed steps commanded with the inputs and the time between two printouts in ms.
With a third digital input the mode can be changed, and the motor will run like a clock, 6 degrees per second, and jump back after one minute. This part of the program shows, how counters and timers can be done.

Inputs
Digital Input 3: Switches the program modes from = 0 Speed mode to = 1 Clock mode
Digital Input 1: Every positive edge adds an amount of speed to the speed set point.
Digital Input 2: Every positive edge subtracts an amount of speed from the speed set point.

Outputs
In speed mode digital output 1 will be set, when the speed set point is zero.

User Variables
DPRVAR1        Speed steps commanded with the digital inputs
DPRVAR2        Time between two printouts in ms

The Printout
can be activated in speed mode of the program (Input 3 = 0) by setting the macro variable PRINT = 1. To do that type:
M PRINT 1
With "M PRINT 0" the printout will be stopped. Do not mind the drive printing between your command, while you type.
This function cannot be used in the terminal window of DriveGUI but with an external terminal only.

Parameters
IN1MODE 0        Inputs are used by the program.
IN2MODE 0
IN3MODE 0
IN7MODE 16      Virtual input 7 is used to start reference move.
IN7TRIG 0
O1MODE 23       Output is used by the program.

Back to top

About this Article

Kollmorgen Support