Page 1
Programming Manual Motion Controller MC 5010 MC 5005 MC 5004 WE CREATE MOTION...
Page 2
Dr. Fritz Faulhaber GmbH & Co. KG. This document has been prepared with care. Dr. Fritz Faulhaber GmbH & Co. KG cannot accept any liability for any errors in this document or for the consequences of such errors. Equally, no liability can be accepted for direct or consequential damages resulting from improper use of the equipment.
Content About this document ....................... 4 Validity of this document ..................4 Associated documents .................... 4 List of abbreviations ....................4 Symbols and markers ..................... 5 Introduction ........................6 Characteristics of the programming language .............. 7 Command set ......................7 Operators and special characters ................
Description of the first steps for commissioning and operation of FAULHABER Motion Controllers Drive functions Description of the operating modes and functions of the drive These manuals can be downloaded in pdf format from the web page www.faulhaber.com/ manuals/ List of abbreviations Abbreviation Meaning BASIC Beginner’s All-Purpose Symbolic Instruction Code...
About this document Symbols and markers NOTICE! Risk of damage. Measures for avoidance Instructions for understanding or optimising the operational procedures Pre-requirement for a requested action 1. First step for a requested action Result of a step 2.
Introduction Introduction Sequence programs can be transferred to controller by the FAULHABER Motion Manager and can be executed directly by the controller. This enables e.g. stand-alone operation without a supervisory controller or semi-autonomous execution of smaller program sequences. Sequence programs are programmed in the BASIC programming language, with FAULHABER-specific extensions.
Characteristics of the programming language Characteristics of the programming language BASIC interpreter with a restricted command set and FAULHABER-specific extensions Set of a total of 26 global 32-bit variables (a…z), which are used in common by all pro- grams ...
Page 8
May not be used in the following constructs: RETURN IF THEN ELSE ENDIF GOSUB RETURN Tab. 2: FAULHABER command extension Command Function Example SETOBJ Write an object in the object dictionary. SETOBJ $6083.$00 = 500 Syntax: SETOBJ <Index>.<Subindex> = <variable or value> GETOBJ Read an object in the object dictionary.
Characteristics of the programming language Command Function Example LOAD Loading one or more previously saved variables from LOAD a, b, z the EEPROM (comma-separated list). Syntax: LOAD <variable1<,variable2,...>> DEF_TIM_VAR Defines a variable to be used as a timer. DEF_TIM_VAR t Syntax: DEF_TIM_VAR <variable>...
Sequence programs are created and edited using the FAULHABER Motion Manager. Before downloading a sequence program on to the controller, the FAULHABER Motion Manager performs a pre-processing step in order for instance to determine the addresses of the jump labels and the necessary memory area.
Developing sequence programs using the Motion Manager Developing sequence programs using the Motion Man- ager The FAULHABER Motion Manager Editor window offers an integrated development envi- ronment for sequence programs. The development environment offers the following facili- ties: Syntax highlighting ...
Developing sequence programs using the Motion Manager Tab. 3: Editor Function of the buttons (editor environment) Button Name Function Download the sequence program on to the controller and run it. Step Execute the sequence program in single steps. Halt Pause the sequence program. Stop End the sequence program.
Developing sequence programs using the Motion Manager Load the program to the controller and execute it Pressing the Run button downloads the finished program to the controller and immedi- ately executes it. If this is a new program that has not yet been saved to the controller, a program num- ...
Developing sequence programs using the Motion Manager Debugging a program The following debug facilities are available for troubleshooting in sequence programs: Pause the program at the current execution position (Halt button): The active line is highlighted in the editor. ...
Control of sequence programs Control of sequence programs A saved sequence program can be started by a supervisory computer via the interface, or automatically when the controller is booted up. Control via the interface The execution of sequence programs can be controlled and monitored by a supervisory computer, via the object 0x3001.
Control of sequence programs Example for loading and running a sequence program in program number 1: 1. Select program 1: 0x3001.02 = 1 (P1) 2. Load program: 0x3001.01 = 1 (Load) Wait until 0x3001.04 = 0 (no longer Reading). 3.
Control of sequence programs Data exchange with the sequence programs Data exchange via object 0x3004 The program variables a to z can also be used for data exchange between the sequence program and the supervisory computer. Object 0x3004.01 can be used to select a variable and object 0x3004.02 to read or write its value.
Examples of programs Examples of programs Sequence of steps This example provides an example of the implementation of a sequence of steps. The main loop is processed continuously. As soon as the conditions of the current step are satisfied, the step count (z) is incremented by one, in order to proceed to the next step, in which fur- ther conditions are tested.
Examples of programs ‘Step 2: When the state being tested is achieved, '(here "Target Reached") the timer will be set and the 'step counter incremented by one. a = GETOBJ $6041.$00 IF (a & $400) = $400 THEN 'Bit 10 set in the statusword ("Target Reached") START_TIM 2000 'Set the timer to 2 seconds z = 3...