Macro Programming
Valid for S300, S700
Table of Contents
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.
|
|
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
- Description of Macro Language
- Functions for Motion
- Functions for In- / Outputs
- Functions for runtime environment
- Functions for programming environment
- Functions for multi axis systems (CANopen)
- Functions for position latching
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.
- Show Program File .
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.