Skip to main content

Kollmorgen Support Network

Macro Language Programming Environment | 27 Jan 2012 | |

Macro Language Programming Environment

Valid for S300, S700

Off Line Edit

All macro programs should be stored in ASCII files with the extension *.pl3. To do this and the conversion into the s-record format usually the programming environment MacroStar Software is being used.
The download of the converted file to the S300/700 is done using the Upgrade Utility and choosing the option \Filetype to download: PLC-Program".

On Line Edit

The firmware offers some simple ASCII commands to edit the application program. The flash memory modify commands can only be executed if the drive is disabled. The simple line editor will automatically assign line numbers to the code. The first line of the macro program is called line number 1. Each following line get the next integer number.
The max. size of the PLC program is 64000 bytes. However, the on line edit is only possible for PLC programs smaller than 8000 bytes. Programs larger than 8000 bytes has to be edited with the off line method.

PLIST

The ASCII command PLIST (n (m)) will display the macro program on the terminal. There are four forms possible:
  • PLIST                   will list the entire macro program on the terminal
  • PLIST 10              will list line 10 of the program
  • PLIST 10 20         will display lines 10 to 20 of the program
  • PLIST *                will insert at the beginning of each line of the listing the prefix “PLINE nn” This is useful if the listing is redirected to a file. The file can immediately loaded into another amplifier. If this option is not used, only the sequential line number will be added at the beginning of each line.

PLINE

The command
PLINE nn   ASCII string
will replace the line nn of the program with the specified "ASCII string". If the specified line number does not exist the line will be stored as last line of the program.

PINS

The command
PINS nn    ASCII string
will insert the specified "ASCII string" in line nn. The existing line nn and all lines behind will be shifted one line up. Be aware of that fact that all following lines will get automatically new line numbers. If the specified line number does not exist the line will be stored as last line of the program.

PDEL

The command PDEL n (m) will delete one or multiple program lines:
PDEL 10          will delete line number 10
PDEL 10 20    will delete the 11 lines 10 to 20
Be aware of that fact that all following lines will get automatically new line numbers.

PLCRUN / PLCSTOP

The application program PLCMAIN will be started automatically after the boot sequence. This autostart procedure can be inhibited by inserting the keyword
 
DEBUGON
 
into the PLCINIT procedure. The command PLCRUN can later initiate the macro program execution. The application program execution can be stopped with the command PLCSTOP.

Completely delete a Macro Program

The command sequence

UPDATE PLC

deletes the macro program completely. Power cycling of the 24V supply is necessary afterwards. In case a faulty macro program prevents the drive from starting the firmware correctly so that no access is possible you need to press the two buttons at the drive front while powering it up. At the same time an RS232 connection with a terminal program (not terminal window in DriveGUI!) is required.

The drive will now start in bootloader mode, show "-" in the display and the prompt "SRMON>" in the terminal. With the command

xp

the complete macro program can now be deleted. The answer should be similar to the following (addresses can be different):

SRMON> xp
Erase PLC area
star
t=90030000  size=00020000
SRMON>

Then cycle the 24V supply. The firmware will start again correctly.

Password protection

An existing program can be protected with the command PASSXPLC y. '
"y" is the password with valid values for y: -2147483648...2147483647.

Comamnd and password must be entered and saved combined. Now the commands for view and edit modes (PLIST, PINS, PLINE, PDEL) are locked.

To edit the program, you must unlock the password protection with PASSPLC y. As long as PASSXPLC is not set to "0", the program is protected after the next switch off / on or coldstart. Passwort protection cannot  prevent the program from being deleted.

Example:
PASSXPLC 12345
SAVE
COLDSTART

The program is protected now and if you try to view it, the message:
-->PLIST 1 10
ERR (PLIST) NO WRITE ACCESS (PLEASE ENTER PASSWORD)

appears. To view or edit the program you must enter:
PASSPLC 12345

Back to top

About this Article

Kollmorgen Support