Copyright
by Dr. Fritz Faulhaber GmbH & Co. KG
Daimlerstr. 23 / 25 · 71101 Schönaich
All rights reserved, including those to the translation.
No part of this description may be duplicated, reproduced,
stored in an information system or processed or
transferred in any other form without prior express written
permission of 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.
The relevant regulations regarding safety engineering
and interference suppression as well as the requirements
specified in this document are to be noted and followed
when using the software.
Subject to change without notice.
The respective current version of this technical manual is
available on FAULHABER's internet site:
www.faulhaber.com
This document describes the programming of sequence programs for controllers of the
Motion Controller and Motion Control systems family V3.0, using the FAULHABER Motion
Manager.
This document is intended for software developers with programming experience, and for
drive technology project engineers.
All data in this document relate to the standard versions of the drives. Changes relating to
customer-specific versions can be found in the attached sheet.
1.2Associated documents
For certain actions during commissioning and operation of FAULHABER products additional
information from the following manuals is useful:
ManualDescription
Motion Manager 6Operating instructions for FAULHABER Motion Manager PC software
Quick start guideDescription of the first steps for commissioning and operation of FAULHABER Motion
Drive functionsDescription 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/
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.
8 user programs each with up to around 2000 lines of code are available. Optionally, one
program can also be started automatically at boot-up.
Developing sequence programs using the Motion Manager
4Developing sequence programs using the Motion Man-
ager
The FAULHABER Motion Manager Editor window offers an integrated development environment for sequence programs. The development environment offers the following facilities:
Syntax highlighting
Displaying and editing up to 8 user programs
Load user programs from the device memory and the PC memory, and display them
Start individual sequence programs
Stop the active sequence program
Pause the active sequence program
Single step execution
Definition of a breakpoint
Display the current program status and the current program line
Developing sequence programs using the Motion Manager
Tab. 3:Editor Function of the buttons (editor environment)
ButtonNameFunction
RunDownload the sequence program on to the controller and run it.
StepExecute the sequence program in single steps.
HaltPause the sequence program.
StopEnd the sequence program.
EEPROM-Save Save the currently loaded sequence program to the EEPROM.
DownloadDownload the sequence program on to the controller and save it to the
DeleteDelete the sequence program from the controller EEPROM.
ExtrasDisplay the code template and offer the facility to investigate the contents of
4.1Editing a program
The command File - New - Motion Control file MC V3.x creates a new program.
The command File - Open followed by selection of the desired .bas file loads an existing
program.
When a new file is created, an empty .bas file with a pre-prepared file header is gener-
ated. After it has been edited, the file can be saved to any desired memory location.
Saved files that have already been downloaded to the controller can be opened from
the sequence programs directory of the active node by double clicking in the Node
Explorer.
Irrespective of the declared program links, there is also the facility by double clicking on
the Upload node to load all the programs saved in the controller. If an appropriate file
link exists in the programs that have been uploaded, the file content is shown in Node
Explorer. Otherwise the program content read from the device is shown.
EEPROM.
variables, and change them.
If it is desired to view the content of the device memory instead of the linked file, the
file link must be deleted in Node Explorer (Del key). At the next download of the file
the link will be re-established in Node Explorer.
Comment lines that start with ‘ are saved in the file only for purposes of documentation
and are not downloaded to the controller.
For user support a column can be displayed at the right-hand side of the editor window
(Extras key) with code templates that can be dragged into the current program using
the mouse, and there adapted to suit.
Developing sequence programs using the Motion Manager
4.2Load 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-
ber between 1 and 8 must be assigned to it. The program is saved to the controller
under this program number.
If the file had already been saved into a desired directory, the link to this file is gener-
ated in Node Explorer under sequence programs of the active node. This also shows the
assigned program number (e.g. P1 for program number 1).
After execution has been started, the editor area switches into debug mode (with a dif-
ferent background colour). This mode does not allow program editing. The following
information is shown in the status line of the editor window:
The currently loaded program number.
The current program line
The program status (e.g. Running)
If errors occur whilst running the program, execution is interrupted and the last line
executed is highlighted.
To return to program editing mode, program execution must be ended by pressing the
Stop button.
A program that is loaded by means of the Run button is stored in the non-volatile mem-
ory only if a program number is assigned to it. Subsequent changes are saved only to
the working memory. To save changes permanently on the controller, press the EEPROM Save button.
When the Download button is pressed, a program can be saved to any program num-
ber.
Pressing the Delete key deletes programs that are no longer required from the device
memory.
Program links that are no longer required in Node Explorer can be deleted by pressing
A saved sequence program can be started by a supervisory computer via the interface, or
automatically when the controller is booted up.
5.1Control via the interface
The execution of sequence programs can be controlled and monitored by a supervisory
computer, via the object 0x3001.
Tab. 4:Current Control Parameter Set
IndexSubindex NameType Attr.Meaning
0x30010Number of
Entries
1Program Control U8rwControl of the sequence program activated via 0x3001.02
2Program Num-
ber
3Actual PositionU16roAddress of the line currently being executed
4Actual Program
State
8Error StateU8roError state:
U8roNumber of object entries
or 0x3002.00:
1: Load the activated program from the EEPROM
(Load)
2: Start or continue the loaded program (Run)
3: Execute the individual program line (Step)
4: Pause the running program (Break)
5: End the running program (Terminate)
U8rwActivate the sequence program at program number
U8roCurrent status of the program:
0: No action (Idle)
1: Program is currently being loaded from the EEPROM
(Reading)
2: Program is currently being saved to the EEPROM
(Saving)
3: Program is currently being deleted (Deleting)
4: Program is currently being executed (Running)
5: Program paused (Halted)
0: No error (No Error)
1: Syntax error (Parsing Error)
2: Error accessing the EEPROM (EEPROM Access Error)
Before a new program is loaded, any program already running must be ended.
Pseudo-code:
If 0x3001.04 = 4 (Running) or 0x3001.04 = 5 (Halted), then 0x3001.01 = 5 (Termi-
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.
Tab. 6:Variable Access
IndexSubindex NameType Attr.Meaning
0x30040Number of
entries
1Variable indexU8rwVariable index
2Variable valueS32rwVariable value
Data exchange via object 0x3005
Individual variables can be directly accessed via the subindexes of object 0x3005. This can be
used for example to record variables or to map variables in a PDO. Excluded from this are
variables, which are used for event handlers, timers or counters.
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 further conditions are tested.
REM Sequence of steps with z as the step counter
DEF_TIM_VAR t
z = 1
:MainLoop
IF z = 1 THEN GOSUB Z1
IF z = 2 THEN GOSUB Z2
IF z = 3 THEN GOSUB Z3
IF z = 4 THEN
END
ENDIF
GOTO MainLoop
:Z1
'Step 1: When the state being tested is achieved,
'the step counter will be incremented by one
a = GETOBJ $6041.$00
IF a = $0023 THEN 'Device Control Status = "Switched On"