Keep all manualsas a product component during the life span ofthe product.
Passallmanuals to future users/owners of the product.
AKD BASIC User Guide |
Record of Document Revisions:
RevisionRemarks
06/2011, Rev ALaunch Version for M_01-06-00-000
Windows is a registered trademark of Microsoft Corporation
AKD is a registered trademark of Kollmorgen Corporation
Current patents:
US Patent 5,646,496 (used in control card R/D and 1 Vp-p feedback interface)
US Patent 5,162,798 (used in control card R/D)
US Patent 6,118,241 (used in control card simple dynamic braking)
Technical changes which improve the performance of the device may be made without prior notice.
Printed in the United States of America
This document is the intellectual property of Kollmorgen™. All rights reserved. No part of this work may
be reproduced in any form (by photocopying, microfilm or any other method) or stored, processed, copied
or distributed by electronic means without the written permission of Kollmorgen™.
Kollmorgen™ | March 30, 20122
This page intentionally left blank.
3Kollmorgen™ | March 30, 2012
AKD BASIC User Guide |
Table of Contents
1 About this User Guide16
2 Program View17
2.1 Toolbar Options17
2.1.1 New ...17
2.1.2 Save / Save As17
2.1.3 Open18
2.1.4 Edit Parameters Section18
2.1.5 Compile / Download / Run18
2.1.6 Continue / Pause / Stop18
2.1.7 Debug18
2.1.8 View19
2.1.9 Format Document19
2.1.10 Insert Code Snippet19
2.1.11 Upload?19
2.1.12 Lock19
3 AKDBASICLanguage20
3.1 AKD BASIC Program Structure20
3.1.1 Local Variables20
3.1.2 Global Variables20
3.2 Program Sections21
3.2.1 Program Template21
3.2.2 Setup Parameter Definitions21
3.2.3 Global Variables, Constants, and Aliases22
3.2.4 Variable Definitions22
3.2.5 Constant Definitions22
3.2.6 Alias Definitions23
3.3 Main Program, Subroutines, Functions & Interrupt Handlers23
3.3.1 Main Definitions23
3.3.2 Subroutine Definition24
3.3.3 Function Definition25
3.3.4 Interrupt Handler Definition25
3.4 Language Definition26
3.4.1 Lexical Conventions26
3.4.2 Identifiers26
3.4.3 Data Types26
3.4.4 Literal Constants27
3.4.5 Decimal Integer Constants27
3.4.6 Hexadecimal Constants27
3.4.7 Floating-Point Constants27
3.5 Statements28
3.5.1 Alias28
3.5.2 Call28
Kollmorgen™ | March 30, 20124
AKD BASIC User Guide |
3.5.3 Cls28
3.5.4 Const28
3.5.5 Dim29
3.5.6 Exit29
3.5.7 For…Next29
3.5.8 Function30
3.5.9 GoTo30
3.5.10 If…Then…Else30
3.5.11 $Include31
3.5.12 Input31
3.5.13 Interrupt … End Interrupt31
3.5.14 MOVE.ABORT31
3.5.15 MOVE.GOABS31
3.5.16 MOVE.GOHOME31
3.5.17 MOVE.GOREL32
3.5.18 MOVE.GOUPDATE32
3.5.19 MOVE.GOVEL32
3.5.20 On Error GoTo32
3.5.21 Pause( )33
3.5.22 Print33
3.5.23 Example33
3.5.24 VM.RESTART33
3.5.25 Select Case33
3.5.26 Static34
3.5.27 Stop34
3.5.28 Sub…End Sub34
3.5.29 Swap35
3.5.30 When35
3.5.31 While…Wend35
3.6 Built-in Functions35
3.6.1 Parameters and Commands36
3.7 Expressions37
3.7.1 Arithmetic Expressions37
3.7.2 Numeric Operators37
3.7.3 Logical Operators37
3.7.4 String Operators38
3.7.5 Example38
3.8 Function Invocation38
3.8.1 $INCLUDE38
3.9 Arrays and Function Parameter Lists39
3.9.1 Optimizations39
3.10 ModBus TCP/IP41
3.10.1 ModBus Parameter Table41
3.10.2 ModBus Register and Data Types41
3.10.3 User Created Variables with Assigned Modbus Address Numbers41
This guide describes the operation and use of the AKD drive. Each section details a specific
topic related to the use of the product in simple terms which will help you get the most from the
product. Each section includes examples to help guide you in setting up and using the various
features available in the drive.
This guide is for users who have installed and tested the drive according to the AKD InstallationManual. The AKD Installation Manual is included on the product CD and contains critical safety
information.
Kollmorgen™ | March 30, 201216
AKD BASIC User Guide | 2 Program View
2Program View
The program view in AKD WorkBench is specific to AKD BASIC drives and can only be accessed using
an AKD BASIC drive type in either online or offline mode. Programs can be compiled in offline mode, but
an AKD BASIC drive must be connected to download and run a program.
2.1 Toolbar Options
The toolbar at the top of the program view contains a number of tools to assist you in programming.
2.1.1 New ...
The Program view loads as an empty window. Create a new program by clicking the new icon in the
upper-left corner and selecting either BASIC or BASICUsing Current Drive Params. The BASIC
selection will load an empty template. The BASICUsing Current Drive Params selection will populate
the template with all current drive values. Then select the location and name of your new project file, and
click save.
This will load the BASICtemplate from which you can begin programming.
2.1.2 Save / Save As
Once you have written your program, save it using the "Save" or "Save As" function on the toolbar
.
17Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 2 Program View
2.1.3 Open
To open a previous project file click the "Open" functionand locate your file in the explorer.
2.1.4 Edit Parameters Section
Clicking on the Edit Params Section toolwill prompt you to populate the Params section of your code
with all the current drive settings. Clicking yes will overwrite all current param defintions with the current
drive values.
2.1.5 Compile / Download / Run
The Compile button will compile your source code to binary so that you may download the program to the
drive.
The Download button will download your compiled code and source code to the drive by default. If you do
not wish to download the source code to the drive, go to the options menu, choose download and deselect download source with binary.
The run button will issue a VM.START to start the BASIC program in the drive. If the active BASIC program in the editor is different than the program in the drive, the run button will compile and download the
program before running.
2.1.6 Continue / Pause / Stop
The Continue, Pause, and Stop optionsallow you to control your program while it is running.
2.1.7 Debug
The Debugger allows you to set break points and step through your program.
Kollmorgen™ | March 30, 201218
AKD BASIC User Guide | 2 Program View
2.1.8 View
Use Find and Replace to find keywords in your program and replace them with a new keyword
Use the Go To Line to go to a specific line of code
Watch will open the expression evaluator tab. The expression evaluator is only valid while using the
debugger. You can evaluate any drive parameter or user defined variable when the program is paused by
the debugger.
Call Stack will open the call stack tab
2.1.9 Format Document
The format document toolimplements correct line indentation across all code.
2.1.10 Insert Code Snippet
The Insert Code Snippet toolpresents a list of existing code snippets, which can be selected and
inserted into the program at the point where the cursor is currently placed.
2.1.11 Upload?
The upload tool uploads the source code from the drive. If the source code has not been downloaded, this
option is not available. The tools menu allows you to select if the source code is to be downloaded with
the binary.
2.1.12 Lock
The lock tool password protects the source code in the drive. If a new program is downloaded to a drive,
the original source code and password protection is erased.
19Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
3AKDBASICLanguage
This chapter describes the overall structure of an AKD BASIC program and the elements of the
AKD BASIC language. Topics covered are:
l scope
l program structure
l setup parameters
l global variables, constants and aliases
l ‘main’ program, subroutines, functions and interrupt handlers
l language description
l lexical conventions
l identifiers
l data types
l constants
l statements
l built-in functions
l parameters
l expressions
l function invocation
l $include
l arrays and parameter lists
l optimizations
3.1 AKD BASIC Program Structure
3.1.1 Local Variables
The notion of ‘scope’ is a key concept in AKD BASIC programs. By ‘scope’, we mean those
parts of the program in which a particular name is ‘visible’. There are two levels of scope in
AKD BASIC — global and local. Variables (and constant definitions, aliases, etc.) defined
inside a ‘main’ definition, or a subroutine, function, or interrupt handler definition, are considered
to be ‘local’ in scope (visible only within that function).
3.1.2 Global Variables
All other definitions (those occurring outside functions) are considered ‘global’ in scope (visible
inside main, and inside any subroutine, function, or interrupt handler). For example, consider
the following simple AKD BASIC program:
'-------------- Define (dim) Global Variables -
-------
dim i as integer
'-------------- Main Program ------------------
-------
Main
dim i as integer
for i = 1 to 10
print"the cube of "; i; "is "; cube(i)
call increment
next i
End Main
Kollmorgen™ | March 30, 201220
AKD BASIC User Guide | 3 AKDBASICLanguage
'-------------- Subroutines and Functions -----
-------
function cube(i as integer) as integer
cube = i * i * i
end function
sub increment
i = i + 1
end sub
This program prints a table of the cubes of the integers from 1 to 10. The first (global) definition
of ‘i’ is visible inside subroutine ‘increment’, but ‘shadowed’ by the ‘i’ in main and function
‘cube’. The definition of ‘i’ inside ‘main’ is local to ‘main’, and is NOT the same variable as the ‘i’
inside the function ‘cube’, or inside the subroutine ‘increment’. These same scope rules apply to
constant definitions and aliases, as well.
3.2 Program Sections
The major sections of an AKD BASIC program are:
l setup parameter definitions
l global variables, constants, and aliases
l ‘main’ program, subroutines, functions, and interrupt handlers
Although these sections may appear in any order, we recommend that you keep them in the
order shown, or at least, choose a single layout style and use it consistently.
3.2.1 Program Template
The program below is an example of the template generated automatically by WorkBench:
'-------------- Device Params -----------------
------
Params
End Params
'-------------- Define (dim) Global Variables -
------'-------------- Main Program ------------------
-------
Main
End Main
'-------------- Subroutines and Functions ----
--------
'-------------- Interrupt Routines -----------
--------
These sections are described in greater detail in the following paragraphs.
3.2.2 Setup Parameter Definitions
This section of the program defines the setup parameters for drive tuning and configuration. It is
executed immediately upon power-up (if VM.AUTOSTART = 1), before entering main, and
before any interrupts are enabled. The section begins with Param and ends with End Param
21Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
(this is similar to the format used to define a subroutine or function). The only statements permitted in this section are assignment statements of the form:
<parameter> = <constant expression>
This section can be automatically generated by WorkBench when a New Program is created.
Choose "current drive parameters" to include the connected drive's setup parameters in your
program. If you choose to not include the setup parameters in your program, be sure to save the
setup parameters to the drive to ensure proper drive setup upon power up.
3.2.3 Global Variables, Constants, and Aliases
This section contains variables, constant definitions, and global alias expressions — they
apply everywhere in the program, unless specifically overridden by another declaration at local
scope (inside a subroutine, function, or interrupt handler). Global definitions may be placed
almost anywhere in the program text — between subroutines, before or after ‘main’, and so on.
Global variables, constants, and aliases do not need to be defined before use — the only
requirement is that they be defined at some point in the program text. You may have multiple
instances of the global variables section throughout your program. However, as a matter of
good programming style, we recommend that you keep all global definitions in one place, preferably at or near the beginning of your program.
3.2.4 Variable Definitions
The format of a global variable definition is:
dim a,b as integer, x,y,z as float
dim ia(3,4) as integer
dim s1, s2 as string*80
dim sa(5,2) as string
dim j, k, l as integer NV
Line 1 declares a and b as integers, x,y, and z as floats. Line 2 declares a 3 x 4 array of
integers. Line 3 declares s1 and s2 as strings, each of length 80. Line 4 declares sa as a 5 x 2
array of strings, each with the default length of 32 characters. Line 5 defines 3 integers, j, k, and
l as NV.
In addition, global variables can be specified as ‘NV’ to indicate their values are retained when
power is turned off. All other global variables are automatically initialized when the program
begins (strings are set to empty, and floats and integers are set to 0). There are no restrictions
on the ordering of volatile vs. non-volatile user-variables. For ease of program maintenance,
place all non-volatile variables definitions in a single section at the beginning of the program,
and add new variables to the end of that section.
Names for constants follow the same rules as variable names. ‘Forward definitions’ are
allowed. Circular definitions are detected and reported at compile-time. Although it is not
required, it is convenient to adopt a convention of keeping all constants in UPPER_CASE, so
you can easily distinguish between constants and variables in the program.
Constant definitions are entirely ‘folded’ at compile-time. Feel free to write maintainable constant expressions such as:
The value of AREA is computed at compile-time, so the program does NOT need to compute
this at run-time and the program is easier to maintain if LENGTH changes at some future date.
3.2.6 Alias Definitions
Aliases allow you to define your own names for system resources, such as input / output pins.
The intention is to make it possible for you to use names that are meaningful to you in your particular application. The format of an alias expression is:
alias <name> = <expression>
For example, the following alias defines application-specific uses of input # 1:
alias CONVEYOR_IS_RUNNING = (DIN1.STATE = 0)
alias CONVEYOR_IS_STOPPED = (DIN1.STATE = 1)
if CONVEYOR_IS_RUNNING then
print“running”
else
print“stopped”
An alias is much more powerful than a constant. Constant expressions are computable at compile-time, while an alias has a value that is only known (in general) at the time it is used. Use aliases with care — too much aliasing can make it very difficult for you to understand the
program.
3.3 Main Program, Subroutines, Functions & Interrupt Handlers
These sections share the same fundamental structure:
<section>
<declarations>
<statements>
<section end>
An example of each of these sections follows, with an explanation of key points.
3.3.1 Main Definitions
For main, a typical definition is:
Main
dim i as integer
i = 1
print i
End Main
23Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
The variable ‘i’ defined above in the ‘dim’ statement is a local variable — it is not accessible to
other functions, and inside ‘main’, its definition overrides any other variable named ‘i’ that might
exist at global scope.
Unlike global variables, local variables MUST be defined at the beginning of the section — they
must appear before any executable statement in main. For example, the following is illegal:
Main
dim i as integer
i = 1
dim j as integer‘this is an error!
j = i
End Main
You may also define local constant definitions and aliases, provided that like local variables,
they appear before any executable statement. Local constant definitions override global definitions of the same name. For example, given the following global definitions,
const N = 1
Main
const N = “Hello, world!”
print N
call sub1
End Main
'-------------- Subroutines and Functions -----
-------
sub sub1
print N
end sub
The program prints to the console:
Hello world!
1
Because the N visible inside main is the constant defined there, while the N visible to sub1 is
the global constant N, whose value is 1.
The main program is the section of your program that is executed immediately after the‘params
section, regardless of its position in the program text. Other functions, subroutines, and interrupt handlers are executed according to the flow of control defined in the program.
main does not accept arguments, and cannot be called from any other subroutine, function, or
interrupt handler.
3.3.2 Subroutine Definition
For a subroutine such as print_sum, a typical definition is:
sub print_sum(i,j as integer)
print i+j
end sub
The arguments to this subroutine are specified as integer variables, and are passed by value any assignments to these variables has no effect on the arguments supplied by the caller. Subroutines are invoked by ‘call’ instructions, as in call print_sum(3,4).
Kollmorgen™ | March 30, 201224
AKD BASIC User Guide | 3 AKDBASICLanguage
3.3.3 Function Definition
For a function such as sum_squares, a typical definition is:
function sum_squares(i,j as integer) as integer
sum_squares = i^2 + j^2
end function
The function above returns a value of type integer. The value of the function is assigned by
assigning to the name of the function, as if it were a variable.
It is not legal to use the function name as a variable name on the left-hand-side of
an assignment - a function name on the leftt-hand-side is always an INVOCATION
of that function.
There must be at least one statement in the function that assigns a value to the function. It is
not possible to detect at compile-time if the statement will actually execute. Functions are
invoked by name, as in print sum_squares(3,4). This is syntactically identical to an array reference.
3.3.4 Interrupt Handler Definition
The Interrupt statment marks the beginning of an Interrupt Service Routine. The Interrupt Service Routine is defined by a program structure resembling a subroutine. The interrupt feature permits execution of a user-defined subroutine upon receipt of a hardware interrupt signal or a predefined interrupt event.
Interrupts are triggered by pre-defined events or external hardware sources. The interruptsource-name and interrupt enable flag are unique for each interrupt source. For a list of interrupt
sources see Interrupt {Source}.
Receiving an interrupt will suspend program execution and the interrupt service routine will be
executed. Then program execution will resume at the point that it was interrupted.
Interrupts are enabled (or disabled) by setting (or clearing) the associated interrupt enable flag.
Interrupts are disabled until explicitly enabled. After an interrupt is triggered it is automatically
disabled until it is enabled again in your program.
Main
DRV.TIME = 0
INTR.DIN1LO = 1 'enables interrupt
while 1
pause(0.5)
DOUT1.STATEU=0 : Pause(0.005):DOUT1.STATEU=1
wend
end main
'the following interrupt defines what occurs
for interrupt DIN1LO
InterruptDIN1LO
print"I'm awake"
IfDRV.TIME > 10 then
print"OK. That's it."
else
INTR.DIN1LO = 1 're-enables interrupt
end if
End Interrupt
25Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
The interrupt is re-enabled by the statement INTR.DIN1LO = 1. A similar statement must be
executed once before the interrupt is serviced. It is a run-time error to attempt to enable an interrupt for which no handler is defined.
Interrupt handlers do not return values and cannot have arguments. They declare local variables, constants, and aliases. Interrupt handlers are invoked when the AKD hardware detects
that the designated interrupt condition is satisfied (provided that the interrupt is enabled).
Interrupts are triggered by pre-defined events or external hardware sources. The interruptsource-name and interrupt enable flag are unique for each interrupt source.
Receiving an interrupt will suspend program execution and the interrupt service routine will be
executed. Then program execution will resume at the point that it was interrupted.
Interrupts are enabled (or disabled) by setting (or clearing) the associated interrupt enable flag.
Interrupts are disabled until explicitly enabled. After an interrupt is triggered it is automatically
disabled until it is enabled again in your program.
3.4 Language Definition
3.4.1 Lexical Conventions
AKD BASIC is case-insensitive. String literals are not modified, but all other text is treated as if
it were entered in upper case. This means that the identifiers spin, Spin, and SPIN all refer to
the same entity.
3.4.2 Identifiers
Identifiers are alphanumeric and must start with an alphabetic character or underscore. In addition, they may include the underscore character (‘_’) and dollar sign (‘$’). Identifiers denote variables, functions, subroutines, and statement labels, symbolic constants, and aliases.
Identifiers are a maximum of 40 characters. User-defined identifiers may not include the period
(‘.’). Use of a longer identifier is a compile-time error.
Although both forms are accepted for compatibility, the latter form is preferred. Although AKD
BASIC is case-insensitive, we recommend that you adopt a consistent naming convention,
such as Move.Acc, and avoid having Move.acc, move.acc, and move.Acc in the same program.
3.4.3 Data Types
The pre-defined types are INTEGER, FLOAT, and STRING. LONG is used for INTEGER.
INTEGER variables are 32-bit signed integers. FLOAT variables are IEEE single-precision
floating point numbers. STRING variables are represented internally as a maximum length, a
current length, and an array of ASCII characters (can contain null characters).
When a FLOAT result is assigned to an INTEGER variable, or when a FLOAT argument is
used where an INTEGER is expected, the value is coerced to an integer before use. Coercion
from FLOAT to INT always rounds to the nearest integer. For example:
1.2 rounds to 1
1.7 rounds to 2
-1.2 rounds to –1
-1.7 rounds to -2
Scalar INTEGER and FLOAT coercion is automatically provided for function arguments. When
passing ARRAYS as arguments, the types must match exactly because coercion is prohibitively expensive at run-time.
Kollmorgen™ | March 30, 201226
AKD BASIC User Guide | 3 AKDBASICLanguage
String assignment is checked at run-time. An attempt to copy a string to a destination too small
results in a run-time error. String indexing is 1-origin. For example, mid$(“abc”,1,1) returns the
string, a.
STRING variables have a firmware-imposed maximum length of 230 characters and a default
maximum length of 32 characters. They may be assigned a different maximum length by
declaring them to be of type STRING*n where n is a positive integer between 1 and 230 (inclusive).
Declare arrays of the pre-defined types. Arrays have a maximum rank of four dimensions. The
upper-bound of each dimension has no compiler-defined limit. However, because of the limited
data space of the controller, there is a logical upper-bound that depends on the controller model.
Array indexing is 1-origin. The indices in each dimension range from 1 to the upper-bound of the
dimension. Every reference to an array element is checked at run-time. Any attempt to reference beyond the bounds of the array causes a run-time error. New types cannot be defined.
3.4.4 Literal Constants
String constants begin and end with the double-quotes (‘"’). They cannot extend past the end of
the input line. Any printable ASCII character appears in a string constant. An attempt to generate a string literal with non-ASCII characters causes a compile-time error. No check is made
to verify that non-ASCII strings are not created at run-time, so avoid doing so.
3.4.5 Decimal Integer Constants
Decimal integer constants are a string of decimal digits with no decimal point. A leading ‘-’ sign
is optional and is parsed as a unary minus. For example:
1
-1
314159
are all valid decimal constants.
3.4.6 Hexadecimal Constants
Hexadecimal constants are denoted by a leading &H or &h, and cannot have a sign or decimal
point. Hexadecimal constants are composed from the set [0-9A-Fa-f]. Upper- and lower-case
may be mixed.
For example:
&h00ff
&HFF00
&H1234abcd
are all valid hexadecimal constants. Octal and binary constants are not supported.
3.4.7 Floating-Point Constants
Floating-point constants are specified in fixed-point or mantissa-exponent notation. A floatingpoint constant consists of one of the following.
are all valid floating point constants. By design, “.” is not a legal floating-point constant.
3.5 Statements
Statements are separated by a new line (CR-LF) or a colon (‘:’). The statements of the language
are:
3.5.1 Alias
Create an alias for an identifier (not just any identifier). Alias is either a parameter or another
alias. ID must be a legal variable name. You cannot create an alias for an array element.
Like Const definitions, Alias definitions can be made to identifiers not yet defined. Circular definitions are not allowed.
Any duplicate definition of an identifier in the same scope is illegal. However, a local definition
can shadow a definition from the global scope. Using a single identifier to denote two different
objects is NOT allowed (i.e., you cannot have both a label and a variable named all_done).
Like constant, variable, and function declarations, Alias declarations made in the global scope
are imported into all functions (including the main function).
Example:
Alias speed = MOTOR.SPEED‘save some key-
strokes
3.5.2 Call
Call sub[(arg1, arg2, ...)]
sub is the name of a subroutine. The current program counter is saved and sub is invoked.
When sub finishes (by reaching either an exit sub or end sub statement, control is returned to
the statement logically following Call.
A subroutine is essentially a function with no return value. The parameter passing conventions
followed by subroutines are the same as those followed by functions.
3.5.3 Cls
This statement transmits 40 line-feed characters (ASCII code = 10) to the serial port. Cls clears
the display of the console.
3.5.4 Const
const name = x
Declares symbolic constants to be used instead of numeric values. Forward references are
allowed, but circular references are not supported.
'supported
const x = y + 2
Kollmorgen™ | March 30, 201228
AKD BASIC User Guide | 3 AKDBASICLanguage
const y = 17
'unsupported
const x = y + 2
const y = x - 2
Like alias, variable, and function declarations, Const declarations made in the global scope are
imported into all functions (including the main function).
3.5.5 Dim
Dim var1 [, var2 [...]] as type [NV]
All variables must be declared. Local variables must be declared in the function before use.
The NV specifier is used on a Dim statement in the global scope.
Variables in the global scope are automatically imported into functions and subroutines. Variables in function scope (including inside the main function) are not accessible in other functions.
Arrays cannot be assigned directly.
'This is not allowed
dim x(5), y(5) as integer
x = y
'Instead, a loop is needed:
dim x(5), y(5), i as integer
for i = 1 to 5
next i
3.5.6 Exit
Exit {{Sub|Function|Interrupt|For|While}]
Exits the closest enclosing context of the specified type. It is a compile-time error to EXIT a
construct not currently in scope.
3.5.7 For…Next
For loop_counter = Start_Value To End_Value [Step increment]
...statements...
Next
If step increment is not specified, uses 1 as the step increment. If step increment is positive,
continues to the value of End_Value. If step increment is negative, continues to the value of var
= limit.
The loop index variable must be a simple identifier, not an array element or a parameter and
must be a numeric variable (integer or float).
x(i) = y(i)
for var = init to limit step delta
stlist
next var
Substantially more efficient code is generated if delta is a constant (i.e., the default value of 1 is
used, or specified as an expression that is evaluated at compile-time).
29Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
3.5.8 Function
Function function-name [(argument-list)] as function-type
...statements...
End Function
On function entry, all local variable strings are “” and all numeric locals are zero (including all elements of local arrays). If the function takes no arguments, omit the argument-list. An empty
argument-list is illegal. The value returned from the function is specified by assigning an identifier with the name of the function.
Example:
function cube(x as float) as float
cube = x * x * x
end function
Arguments are passed by value. Arrays can not be returned by a function. Arrays passed to a
function are passed by value.
If the return value is not set, a runtime error condition is generated (caught with ON ERROR).
Array actuals must conform with formals to the extent that they have the same number of
dimensions, and EXACTLY the same type. The size of each dimension is available to the function through the use of local constants that are bound on function entry.
Example:
function sum(x(n) as integer) as integer
dim i, total as integer
sum = 0
for i = 1 to n
next
sum = total
end function
This function exploits the fact that the variable N is automatically assigned a value when the
function is called and the value is the extent of the array passed on invocation. N is a read-only
variable in this context. Attempts to write to N cause compile-time errors.
The local variable, total is automatically initialized to 0 upon function entry.
3.5.9 GoTo
GoTo label
A program can only GoTo a label in the same scope. A GoTo may jump out of a For or While
loop, but not INTO one.
3.5.10 If…Then…Else
if condition1 then
...statement block1...
elseif condition2 then
...statement block2...
else
...statement block3...
end if
total = total + x(i)
Kollmorgen™ | March 30, 201230
AKD BASIC User Guide | 3 AKDBASICLanguage
IF...THEN...ELSE statements control program execution based on the evaluation of numeric
expressions. The IF...THEN...ELSE decision structure permits the execution of program statements or allows branching to other parts of the program based on the evaluation of the expression.
There are two structures of IF... THEN...ELSE statements, single line and block formats.
3.5.11 $Include
$include inclfile
$include include-file-name
Textually include inclfile at this point in the compilation. There can be no space between $ and
include. The $include directive must start at the beginning of the line.
3.5.12 Input
input [prompt-string][,|;]input-variable
Input reads a character string received by the console tab in the program view, terminated by a
carriage return.
As an option, the prompt message is transmitted when the Input statement is encountered. If
the prompt string is followed by a semicolon, a question mark is printed at the end of the prompt
string. If a comma follows the prompt string, no question mark is printed. This input statement
is typically used for debugging purposes.
3.5.13 Interrupt … End Interrupt
interrupt {Interrupt-Source-Name}
...program statements...
end interrupt
Interrupt handlers can be located anywhere in the program text (e.g., before main).
3.5.14 MOVE.ABORT
MOVE.ABORT stops motor motion and allows continued program execution. Deceleration is
determined by the controlled stop deceleration rate (CS.DEC).
3.5.15 MOVE.GOABS
MOVE.GOABS (Go Absolute) moves the motor to the position specified by MOVE.TARGETPOS. This position is based on a zero position at electrical home.
The motor speed follows a velocity profile as specified by MOVE.ACC, MOVE.RUNSPEED,
and MOVE.DEC . Direction of travel depends on current position and target position only
(MOVE.DIR has no effect). After the program initiates MOVE.GOABS, it immediately goes to
the next instruction.
Change MOVE.ACC, MOVE.RUNSPEED, and MOVE.DEC during a move using
MOVE.GOUPDATE.
3.5.16 MOVE.GOHOME
MOVE.GOHOME moves the motor shaft to the electrical home position (PL.FB = 0).
31Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
The motor speed follows a trapezoidal velocity profile as specified by MOVE.ACC, MOVE.RUNSPEED, and MOVE.DEC. After the program initiates MOVE.GOHOME, it immediately goes
to the next instruction.
MOVE.GOHOME performs the same action as setting MOVE.TARGETPOS to zero and
executing a MOVE.GOABS function. Change MOVE.ACC, MOVE.DEC and MOVE.RUNSPEED during a move using MOVE.GOUPDATE
3.5.17 MOVE.GOREL
MOVE.GOREL (Go Relative) moves the motor shaft a relative distance from the current position.
Distance, as specified in MOVE.RELATIVEDIST, is either positive or negative. The motor
speed follows a trapezoidal velocity profile as specified by MOVE.ACC, MOVE.RUNSPEED,
and MOVE.DEC.
The program does not wait for motion completion. After the program initiates this move it immediately goes to the next instruction.
Change MOVE.ACC, MOVE.RUNSPEED, and MOVE.DEC during a move using
MOVE.GOUPDATE.
3.5.18 MOVE.GOUPDATE
MOVE.GOUPDATE (Update Move) updates a move in process with new variables. This
allows you to change motion “on the fly” without having to stop and restart the motion function
with new variables.
3.5.19 MOVE.GOVEL
MOVE.GOVEL (Go Velocity) moves the motor shaft at a constant speed.
The motor accelerates and reaches maximum speed as specified by MOVE.ACC and
MOVE.RUNSPEED, with direction determined by MOVE.DIR. Stop motion by:
l Programming MOVE.ABORT for maximum deceleration allowed by current limits.
l Programming MOVE.RUNSPEED = 0 for deceleration at rate set by MOVE.DEC.
After the program initiates MOVE.GOVEL, it immediately goes to the ne xt instruction.
Change variables during a move using MOVE.GOUPDATE.
3.5.20 On Error GoTo
On Error Goto Error-Handler-Name
or
On Error Goto 0
When a firmware runtime error condition occurs, Error-Handler-Name is called, the error handler
is de-installed, and an internal flag (in-error-handler) is set. Any subsequent runtime error (including attempting to set the error handler, or return from the On Error handler) causes an immediate
Stop.
On Error Goto 0 disables the current On Error handler. If an error occurs when no error handler is
installed, Stop is invoked.
Kollmorgen™ | March 30, 201232
AKD BASIC User Guide | 3 AKDBASICLanguage
3.5.21 Pause( )
Pause(Pause_Time) causes the program to pause the amount of time specified by the Pause_
Time argument. The motion of the motor is not affected.
3.5.22 Print
print expression1 [ [,;] expression2 ] [;]
Print a list of expressions, separated by delimiters to the console. Any number of delimiters
(including zero) can appear before or after the list of expressions. At least one delimiter must
appear between each pair of expressions in the print list. The print statement is primarily used
for debugging purposes.
3.5.23 Example
print‘ print a newline
print , ‘ advance a single tab stop
print a,b ‘ print a and b, tab between
print a,b, ‘ print a and b, tab between and at
end
print ,,,x,,, ‘ tab tab tab x tab tab tab
3.5.24 VM.RESTART
VM.RESTART clears the run time error variables and causes program execution to start again
from the beginning of the program. Any Interrupts, Subroutines, WHEN statements or loops in
process are aborted. This statement is used to continue program execution after a Run Time
Error Handler or to abort from WHEN statements without satisfying the condition.
VM.RESTART does not clear the data area or change any program or motion variables.
3.5.25 Select Case
Select Case test-expression
Case expression-list1
Case expression-list2
Case expression-list3
Case Else
End Select
test-expression must evaluate to an INTEGER or FLOAT value.
expression-list1 is a non-empty list of case-defn, separated by commas.
There can be only one Case Else and, if present, it must appear as the last case. It is selected
only if all other tests fail.
case-defn can be any of the following:
...statement block1...
...statement block1...
...statement block1...
...else block...
expr
expr to expr (tests inclusive (closed range))
33Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
is relop expr (<, =, =, =, > )
is expr (equiv to“is = expr”)
Select-case statements where the case-defn expressions are composed solely of integer constants are evaluated much quicker at run-time. (Cases involving variables must be transformed
to logically equivalent if-then-else statements.)
3.5.26 Static
Static var1 [, var2[...]] as type
where type is:
INTEGER 32 bit integer
FLOAT IEEE single precision float
STRING default length is 32 characters
Static is used for declaring variables before use. All variables (except parameters) must be
declared before they can be used. The Static statement is used in a Function, Sub or Interrupt
to specify that the specified variable's value be remembered even when the Function or Sub is
finished. The next time that the Function, Sub or Interrupt is executed, the value will be available.
Example:
Main
while 1
wend
End Main
'-------------- Subroutines and Functions -----
-------
sub MySub
dim x as integer'value is forgotten
static y as integer'value is remembered
x= x + 1
y = y + 1
print x,y
end sub
3.5.27 Stop
Stops the execution of the program.
3.5.28 Sub…End Sub
Sub [argument-list]
...body of the sub-procedure...
End Sub
call MySub
pause(1)
Declare a subroutine. Invoked via Call. Optionally takes arguments. As with Function, it is illegal to provide an empty parameter list (‘()’) if the subroutine takes no parameters.
Kollmorgen™ | March 30, 201234
AKD BASIC User Guide | 3 AKDBASICLanguage
3.5.29 Swap
Swap x, y
Swaps the values of the variables. The variable types must be the same. Does not work on
arrays or strings.
3.5.30 When
When when-condition , when-action
When is used for very fast output response to certain input conditions. You specify the condition and action. Upon encountering When, program execution waits until the defined condition
is satisfied. The program immediately executes the action and continues with the next line of
the program.
The When statement provides latching of several variables when the When condition is satisfied. These variables are:
The software checks for the defined condition at the 4Khz rate. The when action is queued up
and executed immediately. The when action will be executed within 25 microseconds of the
when condition being met.
3.5.31 While…Wend
While condition
...statement block...
Wend
While...Wend tells the program to execute a series of statements as long as an expression
after the While statement is true.
If the expression is true, the loop statements between While and Wend are executed. The
expression is evaluated again and if the expression is still true, the loop statements are
executed again. This continues until the expression is no longer true. If the expression is not
true, the statement immediately following the Wend statement is executed.
3.6 Built-in Functions
A function that takes a numeric argument (either FLOAT or INTEGER) returns the same type.
Coercion between INTEGER and FLOAT is not performed unless necessary. (notation - the
arguments n and m refer to INTEGER types, as in the definition of the MID$ function, whose
signature is MID$(string, integer, integer).
NameArgsReturnSemantics
ABSnumeric numeric absolute value
ATANfloatfloatarc tangent (radians)
CINTnumeric inttruncate (round to nearest int)
COSfloatfloatcosine
35Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
NameArgsReturnSemantics
EXPfloatfloate ^ arg, arg 88.02969 (o/w overflow)
FIXnumeric inttruncate (round toward zero)
INTnumeric inttruncate (round towards -INFINITY)
LOGfloatfloatnatural log
LOG10 floatfloatlog base 10
SGNnumeric integersign of argument: -1, 0, 1
SINfloatfloatsine (radians)
SQRfloatfloatsquare root of arg
TANfloatfloattangent (radians)
String functionDescription
ASCstringintASCII code for 1st char
CHR$intstring
HEX$intstring
INKEY$string
INSTR[pos],str1,str2 int
LCASE$strstrReturns lower-case copy of arg.
LEFT$str,nstrReturns n leftmost chars of str.
LENstrintReturns length of str in bytes.
LTRIM$strstrTrim leading spaces.
MID$str,n[,m]str
OCT$nstrOctal string representation of arg.
RIGHT$str,nstrRightmost n chars of str.
RTRIM$strstrTrim trailing spaces.
SPACE$nstrReturns a string of n spaces.
STR$nstrDecimal string representation of str.
STRING$ n,strstrReturn n copies of first char of str.
TRIM$strstrTrim leading AND trailing spaces.
UCASE$strstrReturns upper-case copy of arg.
VALstrnumeric Returns numeric value of str.
One-character string containing the character
with the ASCII code of arg. If arg 255, returns
CHR$(arg % 256).
Printable hexadecimal rep of arg (without leading &H).
One-character string, read from serial port.Returns “” if no char available.
Index of str2 in str1, or 0 if not found. Optional
first arg specifies where to start search (defaults
to position 1).
Returns substring starting at position n [for up to
to m bytes].
3.6.1 Parameters and Commands
The AKD BASIC language is augmented by a set of parameters, input\output parameters, and
pre-defined commands., The parameters set motor-specific control parameters, and the predefined commands control the motor.
For example, MOVE.ACC, MOVE.DEC, and MOVE.RUNSPEED are used to set the acceleration rate, deceleration rate, and commanded motor speed for the next commanded move:
The program fragment above sets up the relevant motion parameters, and commands the motor
to move at the specified velocity.
You cannot create variables (or function names, etc.) that shadow pre-defined ones. For a complete list of Parameters and commands, refer to the Parameter Guide section in this manual.
3.7 Expressions
3.7.1 Arithmetic Expressions
Arithmetic expressions (expressions involving INTEGER and FLOAT values) use the following
operators.
3.7.2 Numeric Operators
Operators higher in the table have greater precedence than those below.
Operator Assoc Name
^rightexponentiation
-rightunary minus
*leftmultiply
/leftdivide
MODleftmodulo
+leftadd
Logical expressions (as, for example, in the condition of an ‘if’ statement) also use these
operators. Strings are concatenated with the ‘+’ operator. Logical expressions are formed from
strings, using the comparison operators, NOT, AND, OR, and XOR, with the meaning of an
empty string being FALSE, and a non-empty string being TRUE.
Integer values are coerced to floating point values as needed. Floating-point values are rounded
when coerced to integer values.
Logical operators are NOT short-circuiting (i.e., when executing the code).
if a(x) or b(y) or c(z) then ...
if a(x) is true, b(y) and c(z) are still invoked.
BITxxx boolean operators are provided to support bitwise operations on integer values. They
operate quite differently from their logical equivalents. For example:
2 and 1 has the value –1 (TRUE, since each operand is ‘true’), but 2 bitand 1 has the value 0
since no matching bits are 1).
37Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
Similarly, 3 or 4 has the value –1(TRUE since at least one operand is not FALSE), while 3 bitor
4 has the value 7 (the three lsb’s are set).
Remember that relational and logical operators return numeric values - 0 for FALSE and -1 for
TRUE. Any value not equal to FALSE is considered to be logically equivalent to TRUE for purposes of the logical operators.
There is no implicit coercion between strings and numeric types. String comparison is case-sensitive. Relative comparisons are made using ASCII lexical ordering. The empty string sorts
before all other strings. String comparison operators are non-associative because they evaluate
to a numeric value.
3.7.5 Example
It makes no sense to say a$ = b$ = c$.
It is sensible to say x = a$ = b$
x is assigned the value TRUE if a$ is the same as b$, and FALSE otherwise.
3.8 Function Invocation
A function invocation is denoted as:
var = func(arg1, arg2, ..., argn)
The arguments are passed by value (i.e., modifications made to the formal parameters inside a
function are not reflected in the actuals). Arrays are also passed by value to functions. Arrays
cannot be returned by a function. A function of no arguments is invoked by using the function
name alone. For example, if func_none takes no arguments, then func_none is correct and
func_none() is invalid.
The return value of a function may not be ignored by the caller. If the return value of a function
is regularly ignored, the function should be rewritten as a subroutine (a function with no return
value).
3.8.1 $INCLUDE
Use $INCLUDE to textually include one file in another. The $INCLUDE facility is a simple,
powerful way to create a consistent family of applications. By including source files containing
commonly used functions, subroutines, constant definitions, aliases, etc., you have control
over the source for each application. When you change the source, you update each application simply by recompiling (see Optimizations).
A file cannot include itself, either directly or indirectly. Include file nesting is allowed, but limited to a pre-defined maximum depth (currently 16).
The path of an include file is relative to the directory of the included file, not the current working
directory of the compiler. Suppose, for example, the source program is in directory C:\WORK,
Kollmorgen™ | March 30, 201238
AKD BASIC User Guide | 3 AKDBASICLanguage
and includes the file .C\H\HEADER, and the file HEADER includes COMMON. The compiler
looks for COMMON in C:\H, not in C:\WORK.
Compilation errors occur when a file is included multiple times. For example, if B.BAS includes
files MATH and INCL, and INCL also includes MATH, MATH is included twice, causing a compile-time error.
When an array parameter (formal) of a function or subroutine is declared, the number of dimensions is specified, but the extent of (number of elements in) each dimension is not specified.
This allows the programmer some freedom when invoking such a function. For example, a function may be defined to take a one-dimensional array and compute the sum of the elements in
the array. A single function can be written to take a one-dimensional array of any size and correctly compute the sum. (Because AKD BASIC checks array bounds at run time on each
access, there is no risk that a function will read or write outside the bounds of the array.)
When a formal parameter to a function is an array, instead of specifying the extent of each
dimension, a list of variables is used to both implicitly specify the number of dimensions and to
hold the extent of each dimension. These variables are read-only and cannot be modified within
the function.
Adopt a convention for assigning names to placeholders. One such convention is to use the
name of the array with a numerical suffix. For example,
function f(a(a1,a2,a3) as integer) as integer
where a1, a2, and a3 are the variables that get the extents of the array, a.
The function f above would be called as follows:
dim x_array(3,4,5) as integer
dim y_array(1,2,10) as integer
print f(x_array()) + f(y_array())
In both invocations of f, the function correctly determines the extent of each dimension of the
passed array.
Remember that when passing an array to a function, the type of the array must match
EXACTLY with the type expected by the function. Unlike scalar arguments (implicitly coerced
from float to int or int to float), arrays are NOT coerced. An attempt to pass an integer array to a
function that expects a float array results in a compile-time error.
3.9.1 Optimizations
As mentioned in an earlier section, constant definitions are completely ‘folded’ at the point of
definition. This is efficient code. Constant expressions inside AKD BASIC statements are also
39Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
folded under certain conditions. For example, in the statement:
const PI = 3.1415926535
Main
Print PI^2
End Main
The value of PI^2 is not computed at run-time. It is detected as a constant value and pre-computed by the compiler as a single literal constant to be printed.
Similarly, the literal constant 3*4*PI in
x = 3 * 4 * PI * x
is folded at compile-time, leaving only one multiplication to be performed at run-time.
However, certain constant expressions are not folded. For example:
x = 3 * PI * x * 4
is computed at run-time, involving 3 multiplications because the analysis of constant expressions does not attempt to exploit algebraic commutativity laws. Since the basic arithmetic operators are ‘left associative’, you can ensure the best performance by grouping constant factors
together towards the left (or using a new constant definition).
If a function is not referenced (transitively from MAIN, plus any interrupt handlers), the compiler
does not generate code for it. So, you can freely $include libraries with unused code (e.g., a
comprehensive library containing functions supporting several possible axis configurations).
Although the compiler parses and type-checks all the included source, it does not generate
code into the downloaded program.
If select-case cases are all constants, more efficient code is generated. If a case is a variable,
the generated code is equivalent to a string of if-then-else statements for all cases.
If any of the cases is an open-ended range (e.g., is 10), or covers a large range (e.g., 1 to 1000),
a fast table-lookup is generated.
If all of the cases are constant, and can be grouped into locally dense subsets, the fastest possible code is generated — a binary search of dispatch tables, followed by an indirect jump
through the table. If speed is a consideration, keep your cases constant and close together.
(values form a reasonably dense set.)
The compiler performs limited dead-code elimination based on simple constant analysis. For
example:
const DEBUGGING = FALSE
Main
dim i, sum as integer
for i = 1 to 10
sum = sum + i
if DEBUGGING then print“partial sum is
”;sum
next i
End Main
Since the value of DEBUGGING is FALSE, the compiler recognizes that the printing of the partial sum never happens and does not generate the print statement. This allows you to place
debugging code in strategic locations in your programs and effectively disable it when shipping
a production version (shrinks the size of the generated code).
Kollmorgen™ | March 30, 201240
AKD BASIC User Guide | 3 AKDBASICLanguage
This dead-code elimination also applies to functions whose only point of reference lies in eliminated code. The functions themselves become dead-code and no code is generated for their
definitions.
The compiler does not eliminate the print statement from the following program:
dim DEBUGGING as integer
Main
dim i, sum as integer
DEBUGGING = FALSE
for i = 1 to 10
sum = sum + i
if DEBUGGING print“partial sum is ”;sum
next i
End Main
In this case, the print statement never executes, but the code to implement is generated
because the value of the integer DEBUGGING could be changed by the AKD’s Integrated
Development Environment Debugger at runtime, causing the print statement to be executed!
3.10 ModBus TCP/IP
Modbus TCP/IP, or Modbus TCP, is a Modbus variant used for communications over TCP/IP
networks, connecting over port 502. A max of 3 masters can be connected to one drive at any
time. Modbus standard limits one master to 256 slaves. Modbus and Workbench (telnet) can be
connected to the same drive at the same time. Because Modbus and Telnet are processed in
the AKD’s background task, 5~10mS delay between messages will prevent over running the
back ground task stack limits.
3.10.1 ModBus Parameter Table
For a list of parameters and their Modbus addresses, visit the Modbus Parameter Table.
For 64 bit to 32 bit mapping, visit Modbus 64-bit Parameters to 32-bit Mapping.
3.10.2 ModBus Register and Data Types
All predefined AKD parameters are Modbus 32 bit or 64 bit (some with and some without sign).
Because most HMI products don’t support 64 bit numbers, the AKD also has a series of matching 32 bit parameters. Ex: PL.FB is a signed 64 bit integer with address number 588. There is
also PL.FB_32 as a signed 32 bit integer with address number 2072. PL.FB_32 is the lower two
16 bit registers of PL.FB.
Typical HMI tag addressing will need the additional “40000” be added to the Modbus address
number. Ex: To create a tag in an HMI to read PL.FB_32, the address number 42072 should be
used.
All AKD command parameter will require writing a “1” to trigger the command. Ex: DRV.EN is
used to enable the drive. To trigger the command, send “1” as a 32 bit integer to address 254.
3.10.3 User Created Variables with Assigned Modbus Address Numbers
User variables can be assigned an Modbus address number. The range of available numbers is
from 5000 to 5999. An example program:
Dim int2 as integer
Dimflt1 as float
Dim long1 as long
Notice that address numbers have to be skipped for mapped varables larger than 16 bit. Ex: In
the program above, 5001 was assigned for a 32 bit integer and then next number available
would be 5003.
3.10.4 Drive Fault Table
The parameter MODBUS.FAULT1 to MODBUS.FAULT10 is used to read any drive fault condition. The fault parameters are loaded with the AKD fault code, starting with parameter MODOBUS.FAULT1. DRV.CLRFAULT will reset the drive and clear out any data in
MODBUS.FAULT1 to MODBUS.FAULT10.
HMI fault tables only need to monitor MODBUS.FAULT1, but report faults, if present, in 1 to
10.
3.10.5 Drive Parameter Scaling Over Modbus
The predefined AKD velocity, position, acceleration, and deceleration parameters use the Modbus scaling and do not use the “user units” configured in Workbench.
MODBUS.PSCALE
MODBUS.PIN
MODBUS.POUT
The default is 2^20 counts/ rev, 2^20 counts/sec, and 2^20 counts/sec^2
User defined variables, which have assigned Modbus address numbers, are not effected by
this scaling.
3.10.6 Special Modbus AKD Parameters
MODBUS.DIO
Bit 0 to 6DIN.STATES
Bit 16 and 17 DOUT.STATES
MODBUS.DRVSTAT
Bit 0 Drive Active
Bit 1 STO Status
Bit 2 Pos Hw Limit
Bit 3 Neg Hw Limit
Bit 4 Pos Sw Limit
Bit 5 Neg Sw Limit
Kollmorgen™ | March 30, 201242
AKD BASIC User Guide | 3 AKDBASICLanguage
MODBUS.DRV
Bit 0 Stop
Bit 1 Enable
MODBUS.MOTOR
Bit 0 Has Brake
Bit 1 Brake Release
MODBUS.HOME
Bit 0 Start Homing
Bit 1 Set (current position as home position)
MODBUS.MT
Bit 0 Clear (clears motion task MT.NUM)
Bit 1 Continue
Bit 2 Load (load motion task MT.NUM)
Bit 3 Set
Bit 4 Move (start move of MT.NUM)
MODBUS.SM
Bit 0 One Direction (sets SM.MODE to either 0 or 1)
Start Move:
Edge triggered
Bit 1
0 → 1 : Start motion (execution of SM.MOVE)
1 → 0 : Stop motion (execution of DRV.STOP)
3.10.7 ModBus Dynamic Mapping
For information on Modbus Dynamic Mapping visit Modbus Dynamic Mapping under Fieldbus
Manuals.
3.11 Cam Profiling
In the AKD, a cam is a cyclic, generally non-linear relationship between master encoder position and slave (motor) position. The relationship between slave and master counts is no longer
a constant ratio, but changes as a function of master counts. As in electronic gearing, once a
cam is active, the program no longer needs to do anything special to maintain it - the motion profile is repeated indefinitely until the cam is deactivated.
In camming terminology, a master is typically an external encoder. The encoder is wired into
the AKD BASIC encoder input port on X9. It is also possible to use the AKD BASIC’s virtual
(internal) encoder.
3.11.1 Procedure
To use a cam profile on the AKD BASIC, you must:
1. Create the cam profile (CAM.CREATE).
2. Activate the cam profile (CAM.ACTIVATE).
3.11.2 Related Variables
CAM.MASTER: Specifies the source of the input to the cam table for cam profiling.
43Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 3 AKDBASICLanguage
Knife
r
M2 M3
M5
CAM.CORRECTDIR: Specifies the direction of the correction move that is done when a new
cam table is activated (by setting CAM.ACTIVATE = n).
CAM.ADDPOINT: Adds the specified “point” (master position and corresponding slave position) to the cam table being created.
3.11.3 Cam Wizard
The Cam Wizard is designed to solve cut to length applications. The picture below shows a typical setup:
In this application, material is being fed beneath a rotary knife. The master encoder measures
forward movement of the material under the knife. The slave motor controls rotation of the
knife. In order for this to work properly, the slave motor must be controlled (as a function of
master encoder counts) so the blade of the rotary knife:
1.
Stays out of the way until the proper amount of material has passed
2. Accelerates so the speed of the knife matches the speed of the material during the
cut
3.
Decelerates back to the original speed until the material is almost in position for the
next cut
The rotary knife either accelerates or decelerates to match the speed of the material
in the cut phase, depending on whether or not the circumference of the rotary knife is
less than or greater than the length of the piece to be cut. You may need to interchange the terms ‘accelerate’ and ‘decelerate’, or simply think of them as signed quantities.
AKD BASIC’s CAM.ADDPOINT statement specifies a cam profile as a mapping from master
position to slave position. The problem refers to relative velocities and accelerations. It is not
always clear how to get from velocity and acceleration to position.
The Cam Wizard was designed to make such applications easy to implement. You provide:
1.
The master positions corresponding to the length of material to be cut
2.
The slave positions corresponding to one complete rotation of the knife with respect
to the master positions
Once you have provided these three pieces of information, the Cam Wizard automatically:
1.
Generates a subroutine to create the cam table
2.
Generates a subroutine to activate the cam
Kollmorgen™ | March 30, 201244
AKD BASIC User Guide | 3 AKDBASICLanguage
0
500
1000
1500
2000
-500
-1000
-1500
-2000
2000
4000
6000
8000
10000
12000
Master Encoder Counts
Slave Position
3.11.4 Example
You can create a cam to approximate any continuous function, but the Cam Wizard cannot help
you with it. The basic technique is to develop an AKD BASIC expression (or function)defining
the slave position as a function of master position and use it to generate a series of CAM.ADDPOINT statements at appropriate master position intervals, such as the one shown in the
next figure.
3.11.5 Program
'-------------- Device Params -----------------
------
Params
End Params
'-------------- Define (dim) Global Variables -
-------
const MC = 10000 'master counts in total cycle
const NPOINTS = 501 'number of points in cam
profile
const pi = 3.1415926535
const k = 0.69314718 / 100
const w = 1 / (7.5 * pi)
'-------------- Main Program ------------------
-------
Main
sinusoidal
since we are computing
onds will elapse
45Kollmorgen™ | March 30, 2012
CAM.ACTIVATE = 0 'Turn off any active cams
CAM.MASTER = 1 'Master = virtual encoder only
CAMVM.DIR = 0 'set direction of virtual master
CAMVM.FREQ = 1000 'set virtual master speed
'Generate a cam that does exponentially-damped
'motion and activate it. Please note that
'500 points of slave profile here several sec-
'during the calculation of the cam table.
call CamCreate_2
AKD BASIC User Guide | 3 AKDBASICLanguage
call ActivateCam_2
CAMVM.GOVEL'virtual master to run at
CAMVM.FREQ
While 1 : Wend
End Main
'-------------- Subroutines and Functions -----
-------
Sub CamCreate_2'This code creates a cam whose
profile is an exponentially damped sine wave.
dim m, s as float
dim i as integer
CAM.CREATE (2,501)
for i = 0 to NPOINTS-1
w * i)'computed slave position
Next i
EndCAM.CREATE
End Sub
m = i * (MC / (NPOINTS-1))'master position
s = (1 / exp (1.5 * k * i)) * sin (2 * pi *
CAM.ADDPOINT(m, 65536 * s)
Sub ActivateCam_2
DRV.SWENABLE = 0 'Need to disable the drive
before changing positions
MOVE.POSCOMMAND = 0 'Zero out slave position
EXTENCODER.POSITION = 0 'Zero out real master
The virtual encoder is an internal count generator that is used as the input to the cam. It is controlled much like the profile generator used to control the motion of the motor. The Parameters
and statements associated with the virtual encoder are listed below:
CAMVM.DIR
CAMVM.FREQ
CAMVM.GOREL
CAMVM.GOUPDATE
CAMVM.GOVEL
CAMVM.MOVING
CAMVM.POSITION
Kollmorgen™ | March 30, 201246
AKD BASIC User Guide | 3 AKDBASICLanguage
CAMVM.RELATIVEDIST
CAMVM.STOP
3.11.7 Move Parameters
CAMVM.DIR specifies direction for CAMVM.GOVEL
CAMVM.RELATIVEDIST specifies distance for CAMVM.GOREL
CAMVM.FREQ specifies speed (frequency) for CAMVM.GOREL and CAMVM.GOVEL
3.11.8 Move Statements
CAMVM.GOREL executes incremental move
CAMVM.GOVEL executes velocity move
CAMVM.GOUPDATE updates move parameters on move in progress
CAMVM.STOP stops motion
3.11.9 Other Variables
CAMVM.POSITION gives the value of the internal counter
CAMVM.MOVING indicates whether a move is in progress
The virtual encoder is used as the input to the cam, either alone (as a virtual master) or in combination with the actual encoder (EXTENCODER.POSITION), to add an offset to the master
position. This functionality is controlled by the variable, CAM.MASTER.
This section contains the functions, parameters, statements and variables available for AKD BASIC.The
tables below list all the parameters that can be called in the program view.
4.1 AKD Parameters and Commands
This table lists the parameters and commands from the AKD Base Drive documentation that are available
in AKD BASIC. For detailed descriptions of each parameter click the links below or visit Appendix A of the
AKD User Manual.
Parameter or CommandTypeDescription
Analog Input (AIN)
AIN.CUTOFFNVSets the analog input low-pass filter cutoff frequency.
AIN.DEADBANDNVSets the analog input signal deadband.
AIN.DEADBANDMODENVSets the analog input deadband mode.
AIN.ISCALENVSets the analog current scale factor.
AIN.MODENVAnalog input mode
AIN.OFFSETNVSets the analog input offset.
AIN.PSCALENVSets the analog position scale factor.
AIN.VALUER/OReads the value of the analog input signal.
AIN.VSCALENVSets analog velocity scale factor.
AIN.ZEROCommand Zeroes the analog input signal.
Analog Output (AOUT)
AOUT.CUTOFFNVSets the analog output low-pass filter cutoff frequency.
AOUT.ISCALENVSets the analog current scale factor.
AOUT.MODENVSets the analog output mode.
AOUT.OFFSETNVSets the analog input offset.
AOUT.PSCALENVSets the analog position scale factor.
AOUT.VALUENVReads the analog output value.
AOUT.VALUEUR/WSets the analog output value.
AOUT.VSCALENVSets the velocity scale factor for analog output.
Capture (CAP)
CAP0.EDGE,
CAP1.EDGE
CAP0.EN, CAP1.ENNVEnables or disables the related capture engine.
CAP0.EVENT,
NVSets the filter for the precondition input source.
CAP1.PREFILTER
CAP0.PRESELECT,
NVSets the precondition trigger.
CAP1.PRESELECT
CAP0.STATE,
R/OIndicates whether or not trigger source was captured.
CAP1.STATE
CAP0.T, CAP1.TR/OReads time capture (if time capture was configured).
CAP0.TRIGGER,
NVSpecifies the trigger source for the position capture.
CAP1.TRIGGER
Controlled Stop (CS)
CS.DECNVSets the deceleration value for the controlled stop process.
CS.STATENVReturns the internal status of the controlled stop process.
CS.TONVSets the time value for the drive velocity to be within CS.VTHRESH .
CS.VTHRESHNVSets the velocity threshold for the controlled stop.
Digital Input (DIN)
DIN.ROTARYR/OReads the rotary knob value.
DIN.STATESR/OReads the digital input states.
DIN1.FILTER TO
R/WFilter mode for digital inputs 1 to 7.
DIN7.FILTER
DIO9.INV to DIO11.INVR/WDIO9.INV to DIO11.INV
DIN1.MODE to
NVSets the digital input modes.
DIN19.MODE
DIN1.STATE TO
R/OReads a specific digital input state.
DIN7.STATE
DIN9.STATE to
NVShows on selected pin if signal is high or low.
DIN11.STATE
DIO
DIO9.INV to DIO11.INVNVInverting the output voltage of the IO, when in the output direction.
DIO9.DIR to DIO11.DIRNVChanging direction of the IOs from the X9 connector.
Digital Output (DOUT)
DOUT.RELAYMODER/WIndicates faults relay mode.
DOUT.STATESR/OReads the state of the two digital outputs.
DOUT8.MODE to
NVSets the digital output mode.
DOUT11.MODE
DOUT1.PARAM AND
NVSets extra parameters for the digital outputs.
DOUT2.PARAM
DOUT1.STATE AND
R/OReads the digital output state.
DOUT2.STATE
DOUT1.STATEU AND
R/WSets the state of the digital output node.
DOUT2.STATEU
DOUT9.STATE to
NVShows on selected pin if signal is high or low.
DOUT11.STATE
DOUT9.STATEU to
NVAllows user to set level of selected pin to high or low.
DOUT11.STATEU
Drive (DRV)
DRV.ACCNVDescribes the acceleration ramp for the velocity loop.
DRV.BLINKDISPLAYCommand Causes the display to blink for 10 seconds.
DRV.CLRFAULTHISTCommand Clears the fault history log in the NV.
DRV.CLRFAULTSCommand Tries to clear all active faults in the drive.
DRV.CMDSOURCENVSets the command source (service, fieldbus, analog input, gearing,
digital, or Bode).
DRV.DBILIMITNVSets the maximum amplitude of the current for dynamic braking.
DRV.DECNVSets the deceleration value for the velocity loop.
DRV.DIRR/WChanges drive direction.
DRV.DISCommand Disables the axis (software).
DRV.DISSOURCESR/OReturns the possible reason for a drive disable.
DRV.DISTOR/WSets the emergency timeout.
DRV.EMUEDIRR/WSets the direction of the emulated encoder output (EEO) signal.
DRV.EMUEMODER/WSets the mode of the emulated encoder output (EEO) connector.
DRV.EMUEMTURNR/WDefines the location of the index pulse on the EEO (emulated
encoder output) when DRV.EMUEMODE=2.
DRV.EMUERESR/WSets the resolution of the EEO (emulated encoder output).
DRV.EMUEZOFFSETR/WSets the location of the EEO (emulated encoder output) index pulse
(when DRV.EMUEMODE=1).
DRV.ENCommand Enables the axis (software).
DRV.FAULT1 to
R/OLocation of fault codes for any active fault conditions.
DRV.FAULT10
DRV.HANDWHEELR/OReads the EEO input value.
DRV.HANDWHEELSRCNVSelects the feedback for handwheel operation.
DRV.HWENABLER/OStatus of the hardware enable .
DRV.ICONTR/OReads the continuous rated current value.
DRV.IPEAKR/OReads the peak rated current value.
DRV.NAMENVSets and reads the name of the drive.
DRV.NVLOADW/OLoads all data from the NV memory of the drive into the RAM param-
eters.
DRV.NVSAVECommand Saves the drive parameters from the RAM to the NV memory.
DRV.OPMODENVSets the drive operation mode (current, velocity, or position).
DRV.RSTVARCommand Sets default values in the drive without re-booting the drive and with-
out resetting the NV memory.
DRV.SETUPREQBITSR/OReads the bitwise set status of parameters that must be set before
the drive can be enabled
DRV.STOPCommand This command stops all drive motion.
DRV.TIMER/WA continuous time counter in the drive.
DRV.WARNING1 to
R/OLocation of fault codes for any active warning conditions.
DRV.WARNING10
Fault (FAULT)
FAULTx.ACTIONR/WGets/Sets the Fault Action for Fault 130, 131, 132, 134, 139, 451, and
702.
Feedback 1 (FB1)
FB1.BISSBITSNVSpecifies the number of Biss Sensor (Position) Bits for the BiSS
FB1.ENCRESNVSets the resolution of the motor encoder.
FB1.HALLSTATER/OReads the Hall switch values (encoder feedback
FB1.HALLSTATEUR/OReads the state of Hall switch U.
FB1.HALLSTATEVR/OReads the state of Hall switch V.
FB1.HALLSTATEWR/OReads the state of Hall switch W.
FB1.IDENTIFIEDR/OReads the type of feedback device used by the drive/motor.
FB1.INITSIGNEDNVSets initial feedback value as signed or unsigned.
FB1.MECHPOSR/OReads the mechanical position.
FB1.MEMVERR/OReturns the memory feedback version.
FB1.ORIGINNVAdds to the initial feedback position.
FB1.PR/OReads position from the primary feedback.
FB1.PDIRNVSets the counting direction for feedback channel 1.
FB1.POFFSETNVFB1.POFFSET
FB1.POLESR/OReads the number of feedback poles.
FB1.PSCALER/WSets position scaling value for fieldbus transferred position objects.
FB1.PUNITNVSets the unit for FB1.P.
FB1.SELECTNVSets user entered type or identified type (–1).
Feedback 2 (FB2)
FB2P.DIRR/WFB2P.DIR
FB2.ENCRESNVSets the secondary feedback (FB2) resolution.
FB2.MODER/WSets the mode for the second feedback inputs, EEO connector (X9)
and high speed opto inputs (pins 9 and 10 on X7).
FB2.PR/OReads position from the secondary feedback.
FB2P.DIRNVSets the counting direction for feedback channel 2.
FB2.POFFSETNVSets the offset for secondary feedback.
FB2.PUNITNVSets the unit for FB2.P.
FB2.SOURCER/WSets the source for the second feedback input. Choices are the EEO
connectors (X9) which are RS485 inputs, or the X7 connector’s high
speed opto inputs (pins 9 and 10).
Feedback 3 (FB3)
FB3.MODENVSelects the type of feedback connected to X9.
FB3.POFFSETNVSets the offset for tertiary feedback.
FB3.PUNITNVSets the unit for FB3.P.
Hardware Limit Switch
(HWLS)
HWLS.NEGSTATER/OReads the status of the negative hardware limit switch.
HWLS.POSSTATER/OReads the status of the positive hardware limit switch.
Current Loop (IL)
IL.BUSFFR/ODisplays the current feedforward value injected by the fieldbus.
IL.CMDR/OReads the value of the q-component current command.
IL.CMDUR/WSets the user current command.
IL.DIFOLDR/OReads the drive foldback current limit.
IL.FBR/OReads the actual value of the d-component current.
IL.FFR/ODisplays the current loop overall feedforward value.
IL.FOLDWTHRESHNVSets the foldback warning level.
IL.IFOLDR/OReads the overall foldback current limit.
IL.IUFBR/OReads the sigma-delta measured current in the u-winding of the
motor.
IL.IVFBR/WSets the sigma-delta measured current in the u-winding of the motor.
IL.KPNVSets the proportional gain of the q-component of the PI regulator.
IL.KPDRATIONVSets the proportional gain of the d-component current PI-regulator as
a percentage of IL.KP
IL.LIMITNNVSets the negative user (application-specific) current limit.
IL.LIMITPNVSets the positive user (application-specific) current limit.
IL.MFOLDDNVSets the motor foldback maximum time at motor peak current.
IL.MFOLDRR/OSets the motor foldback recovery time.
IL.MFOLDTNVSets the motor foldback time constant of the exponential current drop
(foldback).
IL.MIFOLDR/OSets the motor foldback current limit.
IL.VCMDR/OSets the output of the q-component PI regulator.
IL.VUFBR/OReads the measured voltage on the u-winding of the motor.
IL.VVFBR/OReads the measured voltage on the v-winding of the motor.
LOAD Parameters
LOAD.INERTIANVSets the load inertia.
Motor Parameters
MOTOR.BRAKENVSets the presence or absence of a motor brake.
MOTOR.BRAKERLSCommand Allows a user to release the motor brake.
MOTOR.ICONTNVSets the motor continuous current.
MOTOR.INERTIANVSets the motor inertia.
MOTOR.IPEAKNVSets the motor peak current.
MOTOR.KENVSets the motor back EMF constant.
MOTOR.KTNVSets the torque constant of the motor.
MOTOR.LQLLNVSets the line-to-line motor Lq.
MOTOR.NAMENVSets the motor name.
MOTOR.PHASENVSets the motor phase.
MOTOR.PITCHNVSets the motor pitch.
MOTOR.POLESNVSets the number of motor poles.
MOTOR.RNVSets the stator winding resistance phase-phase in ohms.
MOTOR.TBRAKEAPPNVThe delay time used for applying the motor brake.
MOTOR.TBRAKERLSNVThe delay time used for releasing the motor brake.
MOTOR.TEMPR/OReads the motor temperature represented as the resistance of the
motor PTC.
MOTOR.TEMPFAULTNVSets the motor temperature fault level.
MOTOR.TEMPWARNNVSets the motor temperature warning level.
MOTOR.TYPENVSets the motor type.
MOTOR.VOLTMAXNVSets the motor maximum voltage.
Position Loop (PL)
PL.CMDNVReads the position command directly from the entry to the position
PL.ERRNVReads the position error present when the drive is controlling the posi-
tion loop.
PL.ERRFTHRESHNVSets the maximum position error.
PL.ERRMODER/WSets the type of following error warning and fault usage.
PL.ERRWTHRESHNVSets the position error warning level.
PL.FBR/OReads the position feedback value.
PL.FBSOURCENVSets the feedback source for the position loop.
PL.INTINMAXNVLimits the input of the position loop integrator by setting the input sat-
uration.
PL.INTOUTMAXNVLimits the output of the position loop integrator by setting the output
saturation.
PL.KINVSets the integral gain of the position loop.
PL.KPNVSets the proportional gain of the position regulator PID loop.
PL.MODP1R/WSets modulo range parameter.
PL.MODP2R/WSets the beginning or end modulo range parameter.
Programmable Limit
Switch (PLS)
PLS.ENR/WEnables programmable limit switch (PLS).
PLS.MODENVSelects programmable limit switch mode.
PLS.P1 TO PLS.P8NVSets the trigger point for programmable limit switches.
PLS.RESETW/OResets programmable limit switch.
PLS.STATER/OReads the programmable limit switch state.
PLS.T1 TO PLS.T8R/WSets programmable limit switch time.
PLS.UNITSR/WSets programmable limit switch (PLS) units.
PLS.WIDTH1 TO
R/WProgrammable Limit Switch Width
PLS.WIDTH8
Recorder (REC)
REC.ACTIVER/OIndicates if data recording is in progress (active).
REC.DONER/OChecks whether or not the recorder has finished recording.
REC.OFFR/WTurns the recorder OFF.
REC.TRIGCommand Triggers the recorder.
RESISTANCE.
REGEN.TEXTR/WSets the external regen resistor thermal protection time constant.
REGEN.TYPEN/VSETS THE REGEN RESISTOR TYPE.
REGEN.WATTEXTR/WSETS THE REGEN RESISTOR'S POWER FAULT LEVEL FOR AN
EXTERNAL REGEN RESISTOR.
STO
STO.STATER/OReturns the status of the safe torque off.
SWLS
SWLS.ENNVEnables and disables software travel limit switches.
SWLS.LIMIT0NVSets the position of the software travel limit switch 0.
SWLS.LIMIT1NVSets the position of the software travel limit switch 0.
SWLS.STATER/OReads the actual status of software limit switches.
Units (UNIT)
UNIT.ACCLINEARNVSets the linear acceleration/deceleration units.
UNIT.ACCROTARYNVSets the rotary acceleration/deceleration units.
UNIT.LABELNVSets user-defined name for user-defined position units.
UNIT.PINNVSets gear IN for the unit conversion.
UNIT.PLINEARNVSets the linear position units.
UNIT.POUTNVSets gear out for the unit conversion.
UNIT.PROTARYNVSets the position units when the motor type (MOTOR.TYPE ) is rotary.
UNIT.VLINEARNVSets the linear velocity units.
UNIT.VROTARYNVSets the velocity units when the motor type (MOTOR.TYPE ) is rotary.
Bus Voltage (VBUS)
VBUS.OVFTHRESHR/OReads the over voltage fault level.
VBUS.OVWTHRESHNVSets voltage level for over voltage warning.
VBUS.RMSLIMITR/OReads the limit for the bus capacitors load.
VBUS.UVFTHRESHR/WSets the under voltage fault level.
VBUS.UVMODENVIndicates undervoltage (UV) mode.
VBUS.UVWTHRESHNVSets voltage level for undervoltage warning.
VBUS.VALUER/OReads DC bus voltage.
Velocity Loop (VL)
VL.ARPF1 TO
VL.ARPF4
R/WSets the natural frequency of the pole (denominator) of anti-resonance
(AR) filters 1, 2, 3, and 4; active in opmodes 1 (velocity) and 2 (posi-
tion) only.
VL.ARPQ1 TO
VL.ARPQ4
VL.ARTYPE1 TO VL.A-
RTYPE4
VL.ARZF1 TO
VL.ARZF4
VL.ARZQ1 TO
VL.ARZQ4
R/WSets the Q of the pole (denominator) of anti-resonance (AR) filter 1;
active in opmodes 1 (velocity) and 2 (position) only.
NVIndicates the method used to calculate BiQuad coefficients; active in
opmodes 1 (velocity) and 2 (position) only.
R/WSets the natural frequency of the zero (numerator) of anti-resonance
(AR)filter 1; active in opmodes 1 (velocity) and 2 (position) only.
R/WSets the Q of the zero (numerator) of anti-resonance filter #1; active in
opmodes 1 (velocity) and 2 (position) only.
VL.BUSFFR/ODisplays the velocity loop feedforward value injected by the field-bus;
active in opmodes 1 (velocity) and 2 (position) only.
VL.CMDR/OReads the actual velocity command; active in opmodes 1 (velocity)
and 2 (position) only.
VL.CMDUR/WSets the user velocity command; active in opmodes 1 (velocity) and 2
(position) only.
VL.ERRR/OSets the velocity error; active in opmodes 1 (velocity) and 2 (position)
only.
VL.FBR/OReads the velocity feedback; active in opmodes 1 (velocity) and 2
(position) only.
VL.FBFILTERR/OFilters VL.FB value; active in opmodes 1 (velocity) and 2 (position)
only.
VL.FBSOURCENVSets feedback source for the velocity loop; active in opmodes 1 (veloc-
ity) and 2 (position) only.
VL.FBUNFILTEREDR/OReads the velocity feedback.
VL.FFR/ODisplays the velocity loop overall feedforward value; active in
opmodes 1 (velocity) and 2 (position) only.
VL.GENMODENVSelects mode of velocity generation (Observer, d/dt); active in
opmodes 1 (velocity) and 2 (position) only.
VL.KBUSFFR/WSets the velocity loop acceleration feedforward gain value; active in
opmodes 1 (velocity) and 2 (position) only.
VL.KINVSets the velocity loop integral gain for the PI controller; active in
opmodes 1 (velocity) and 2 (position) only.
VL.KPNVSets velocity loop proportional gain for the PI controller; active in
opmodes 1 (velocity) and 2 (position) only.
VL.KVFFR/WSets the velocity loop velocity feedforward gain value; active in
opmodes 1 (velocity) and 2 (position) only.
VL.LIMITNNVSets the velocity lower limit; active in opmodes 1 (velocity) and 2 (posi-
tion) only.
VL.LIMITPNVSets the velocity high limit; active in opmodes 1 (velocity) and 2 (posi-
tion) only.
VL.LMJRR/WSets the ratio of the estimated load moment of inertia relative to the
motor moment of inertia; active in opmodes 1 (velocity) and 2 (posi-
tion) only.
VL.THRESHNVSets the over speed fault value; active in opmodes 1 (velocity) and 2
(position) only.
Wake and Shake
(WS)
WS.ARMCommand Sets wake and shake to start at the next drive enable.
WS.DISARMCommand Cancels ARM requests and resets wake and shake to the IDLE state.
WS.DISTMAXR/WSets maximum movement allowed for wake and shake.
WS.DISTMINR/WSets the minimum movement required for wake and shake.
WS.IMAXR/WSets maximum current used for wake and shake.
WS.MODER/WSets the method used for wake and shake.
WS.NUMLOOPSR/WSets the number of repetitions for wake and shake.
WS.STATER/OReads wake and shake status
WS.TR/WSets wake and shake current-vector appliance time
WS.TDELAY1NVDelay for wake and shake timing
WS.TDELAY2NVSets the delay for wake and shake timing.
WS.TDELAY3NVSets the delay for wake and shake between loops in mode 0.
WS.VTHRESHNVDefines the maximum allowed velocity for Wake & Shake
4.2 AKDBASICParameters and Commands
The following table lists parameters, commands, functions, and operators unique to AKD BASIC. For
detailed descriptions of each parameter click the links below or visit the AKD BASIC Parameters chapter
of the AKD BASIC User Manual.
ParameterTypeDescription
Additional Statements
$IncludeStatement The $Include statement allows you to textually include mul-
AliasStatement Allows you to define your own names for system
CallStatement Transfer program control to a subroutine. When the sub-
routine is finished then control is transferred to the line following the CALL.
ClsStatement This statement transmits 40 line feed characters (ASCII
code = 10) to the serial port. Cls clears the display of a terminal.
ConstStatement Declares symbolic constants to be used instead of numeric
values.
DimStatement Used for declaring variables before use. All variables
(except predefined variables) must be declared before they
can be used.
ExitStatement The Exit statement is used to exit from a subroutine, a func-
tion, an interrupt, a For...Next or a While...Wend.
For...NextStatement Allows a series of lines to be executed in a loop a specified
number of times.
FunctionStatement The Function statement is used to declare and define the
name, arguments and type of a user defined function.
GoToStatement GOTO causes the software to jump to the specified label
and continue executing from there.
If...Then...ElseStatement If...Then...Else statements controls program execution
based on the evaluation of numeric or string expressions.
InputStatement The Input statement reads a character string received from
the console tab screen below the program editor window,
terminated by a carriage-return.
On Error GoToStatement On Error Goto allows you to define a run-time error handler
to prevent run-time errors from halting program execution.
Pause()Statement Causes the program execution to pause for a specified
amount of time. The motion of the motor is not affected.
PrintStatement Displays formatted output through the console while the
program is running.
RestartStatement Causes program execution to begin again from the begin-
ning of the program.
Select CaseStatement Select Case executes one of several statement blocks
depending upon the value of an expression.
StaticStatement Static
StopStatement Stops execution of the user program.
Sub...End SubStatement The Sub statement declares a sub procedure and defines
the sub procedures format.
SwapStatement Exchanges the value of two variables.
While...WendStatement Executes a series of lines for as long as the condition after
the WHILE is True.
BASICOperators
MODOperator This is the modulus or "remainder" operator. It divides one
number by another and returns the remainder.
BASICFunctions
ABS()Function ABS(x) converts the associated value (x) to an absolute
value. If the value is negative, it is converted to a positive
value. If the value is positive, it is not changed.
ASC()Function ASC(string expression)returns a decimal numeric value
that is the ASCII code for the first character of the string
expression(x$).
ATAN()Function ATAN() (arc tangent) returns the arctangent of its argument
in radians.
CHR$()Function Returns a one character string whose ASCII value is the
argument.
CINT()Function Converts a numeric expression to the closest integer
number.
COS()Function COS(x) returns the cosine of x, where x is in radians.
EXP()Function Returns e (the base of natural logarithms) raised to a
power.
FIX()Function Fix() returns the truncated integer part of x.
HEX$()Function HEX$() converts an integer number to its equivalent hex-
adecimal ASCII string.
INKEY$()Function Returns a 1 character string corresponding to the character
in the serial port receive buffer. If there is no character wait-
ing the INKEY$ will be the Null string (""). If several char-
acters are pending only the first one is returned.
INSTR()Function Returns the starting location of a substring within a string.
INT()Function INT() (convert to largest integer) truncates an expression to
a whole number.
LCASE$()Function Converts a string expression to lowercase characters.
LEFT$()Function Returns a string of the n leftmost characters in a string
expression.
LEN()Function Returns the number of characters in a string expression.
LOG()Function Returns the natural logarithm of a numeric expression.
LOG10()Function Returns the base 10 logarithm of a numeric expression.
LTRIM$()Function Returns a copy of the original string with leading blanks
removed.
MID$Function Returns a substring of the original string that begins at the
specified offset location and is of the specified (optional)
length.
OCT$()Function OCT$() converts an integer number to its equivalent octal
ASCII string.
RIGHT$()Function Returns a string of the n rightmost characters in a string
expression.
RTRIM$()Function Returns a copy of the original string with trailing blanks
removed.
SGN()Function Returns the sign of a numeric expression.
SIN()Function SIN(x) returns the sine of x, where x is in radians.
SPACE$()Function Returns a string of n spaces.
SQR()Function Returns the square root of a numeric expression.
STR$()Function Returns a string representing the value of a numeric expres-
sion.
STRING$()Function Returns a string containing the specified number of occur-
the specified "point" to the cam table being created.
CAM.CORRECTDIRR/WSpecifies the direction of the correction move when a new
cam table is activated (set CAM.ACTIVATE = n) or when
speed synchronization is achieved.
CAM.CREATEStatement CAM.CREATE (x, y) Initiates the creation of a cam table.
CAM.MASTERR/WSpecifies the source of the input to the cam table for cam
profiling.
CAM.MASTERPOSR/OGives the value of the master position presently being used
as the input to the cam table.
CAM.SLAVEOFFSETR/OCAM.SLAVEOFFSET indicates the offset (or difference)
between MOVE.POSCOMMAND and the position com-
mand that is calculated from the active cam table based
upon the present value of EXTENCODER.POSITION
and/or CAMVM.POSITION.
CAMVM.DIRR/WSpecifies the direction the virtual encoder goes when
CAMVM.GOVEL is executed.
CAMVM.FREQR/WCAMVM.FREQ sets the maximum frequency allowed dur-
ing a relative (CAMVM.GOREL) move, and sets the com-
manded speed during a velocity move (CAMVM.GOVEL)
CAMVM.GORELStatement Makes the virtual master move the distance specified by
CAMVM.RELATIVEDIST.
CAMVM.GOUPDATEStatement Updates a move in progress with new move parameters.
CAMVM.GOVELStatement CAMVM.GOVEL (Go at Velocity) causes the virtual
master to move continuously at the frequency specified by
CAMVM.FREQ in the direction (positive or negative) spec-
ified by CAMVM.DIR. The frequency or direction is mod-
ified during the move using CAMVM.GOUPDATE.
CAMVM.MOVINGR/OIndicates if the virtual encoder is moving.
CAMVM.POSITIONR/WContains the current value of the virtual encoder counter.
CAMVM.RELATIVEDISTR/WSpecifies the number or counts that the virtual encoder (vir-
tual master) will put out during an incremental move
(CAMVM.GOREL).
CAMVM.STOPStatement CAMVM.STOP stops the virtual encoder
Drive (DRV)
DRV.SWENABLER/WControls whether power can flow to the motor.
Electronic Gearing (EGEAR)
EGEAR.ACCLIMITR/WEGEAR.ACCLIMIT sets the maximum acceleration.
EGEAR.DECLIMITR/WEGEAR.DECLIMIT sets the maximum deceleration that
will be commanded on the follower when EGEAR.ON is
turned OFF or the electronic gearing ratio (EGEAR.RATIO
or EGEAR.PULSESOUT / EGEAR.PUSLESIN ) is
decreased.
EGEAR.ERRORR/WIndicates the amount of position deviation that has accumu-
lated on the slave axis (in an electronic gearing application)
as a result of the slave axis limiting its acceleration or decel-
eration while achieving velocity synchronization.
EGEAR.LOCKR/OEGEAR.LOCK indicates when the slave axis (follower
axis) in an electronic gearing application has achieved
velocity synchronization with the electronic gearing
master.
EGEAR.ONCommand Starts the electronic gearing; active in opmode 2 (position)
only.
EGEAR.PULSESINR/WSpecifies the number of encoder counts used when spec-
ifying an exact electronic gearing ratio.
EGEAR.PULSEOUTR/WSpecifies the number of position counts used in an exact
electronic gearing ratio.
EGEAR.RATIOR/WSets the electronic gearing ratio (rev to rev) between the
encoder shaft (master) and the motor shaft (slave).
EGEAR.TYPER/WSets the allowed direction of motion for electronic gearing.
External Encoder (EXTENCODER)
EXTENCODER.FREQR/OGets the external encoder (EEO) velocity.
EXTENCODER.POSITIONR/OGets the external encoder (EEO) position.
EXTENCODER.POSMODULOR/WSets/gets the external encoder (EEO) modulo position.
Interrupt (INTR)
Interrupt...End InterruptStatement The interrupt feature permits execution of a user-defined
subroutine upon receipt of a hardware interrupt signal or a
pre-defined interrupt event.
INTR.DIN1HIEnables interrupt for when DIN1.STATE to DIN7.STATE
goes from 0 to 1, respectively.
INTR.DIN1LOEnables interrupt for when DIN1.STATE to DIN7.STATE
goes from 1 to 0, respectively.
INTR.DISABLEEnables interrupt for when the drive gets disabled.
INTR.DRV.FAULTSEnables interrupt for when the drive faults.
INTR.DRV.HWENABLEEnables interrupt for when DRV.HWENABLE goes from 0
to 1.
INTR.DRV.WARNINGSEnables interrupt for when the drive produces a warning.
INTR.HWLS.NEGSTATEEnables interrupt for when HWLS.NEGSTATE goes from 0
to 1.
INTR.HWLS.POSSTATEEnables interrupt for when HWLS.POSSTATE goes from 0
to 1.
INTR.MODBUSEnables interrupt for when a Modbus User Parameter
changes.
INTR.PL.ERREnables interrupt for when PL.ERR= PL.ERRFTHRESH.
INTR.PLS.P1 to INTR.PLS.P8Enables interrupt for when PLS1 to PLS8 is enabled and
goes high, respectively.
INTR.SWLS.LIMIT0Enables interrupt for when PL.FB > SWLS.LIMIT0 (if
SWLS.LIMIT0 is the upper limit)
INTR.SWLS.LIMIT1Enables interrupt for when PL.FB < SWLS.LIMIT1 (if
SWLS.LIMIT1 is the lower limit)
INTR.TIMERExecutes interrupt after a number of milliseconds specified
by VM.INTRTIMER.
MODBUS Parameters
MODBUS.READFLOATR/WThis function reads a floating-point value from the specified
ModBus slave and returns the value read.
MODBUS.WRITEFLOATR/WThis statement writes a floating-point value to the specified
ModBus slave.
Move Parameters (MOVE)
MOVE.ABORTCommand MOVE.ABORT stops motor motion and allows continued
program execution.
MOVE.ACCR/WSets the maximum commanded acceleration rate when the
speed is increased.
MOVE.DECR/WSets the maximum commanded deceleration rate when the
speed is decreased.
MOVE.DIRR/WMOVE.DIR specifies the direction the motor turns when a
MOVE.GOVEL statement is executed.
MOVE.GOABSCommand MOVE.GOABS moves the motor to the position specified
by MOVE.TARGETPOS.
MOVE.GOHOMECommand MOVE.GOHOME causes the motor to move to the position
specified where PL.FB = 0.
MOVE.GORELCommand MOVE.GOREL moves the motor a distance specified by
MOVE.RELATIVEDIST.
MOVE.GOUPDATECommand MOVE.GOUPDATE updates a move in progress with new
move parameters.
MOVE.GOVELCommand MOVE.GOVEL moves the motor at a constant speed spec-
ified by MOVE.RUNSPEED and direction specified by
MOVE.DIR.
MOVE.INPOSITIONR/OIndicates whether or not the motor has achieved command
position.
MOVE.INPOSLIMITR/WSpecifies the tolerance of Position Error (PL.ERR) within
which the MOVE.INPOSITION flag will be set to 1 (True).
MOVE.MOVINGR/OIndicates whether or not the commanded motion profile is
complete.
MOVE.POSCOMMANDR/WCurrent Position Command from Trajectory Generator.
MOVE.RELATIVEDISTR/WSpecifies the distance the motor turns during a relative
move (MOVE.GOREL).
MOVE.RUNSPEEDR/WSets the maximum speed allowed during a relative
(MOVE.GOREL) or absolute (MOVE.GOABS) move, and
sets the commanded speed during a velocity move
(MOVE.GOVEL).
MOVE.SCURVETIMER/WSets the amount of S-curve smoothing applied to all veloc-
MOVE.TARGETPOSR/WMOVE.TARGETPOS specifies the target position for an
absolute (MOVE.GOABS) move.
Virtual Machine (VM)
VM.AUTOSTARTR/WVM.AUTOSTART specifies whether or not the program in
the AKD BASIC starts executing automatically when AC
power is applied.
VM.ERRR/WIndicates what caused the most recent Runtime Error.
VM.INTRTIMERR/WSets a number of milliseconds before
INTR.TIMERexecutes after it is called.
VM.RESTARTCommand Restart AKDBASIC virtual machine.
WHEN
WhenStatement The WHEN statement is used for very fast response to cer-
tain input conditions.
When Conditons
PL.FB < value
PL.FB> value
PL.CMD < value
PL.CMD> value
DRV.HANDWHEEL < value
DRV.HANDWHEEL > value
DRV.TIME > value
DINx.STATE = 0 or 1
FB3.P < value
FB3.P > value
MOVE.MOVING = 0 or 1
MOVE.INPOSITION = 0 or 1
When Actions
Continue
DOUT1.STATEU = 0 or 1
DOUT2.STATEU = 0 or 1
EGEAR.RATIO = value
MOVE.ABORT
MOVE.GOABS
MOVE.GOREL
MOVE.GOVEL
MOVE.GOABSREG
MOVE.GOHOME
MOVE.GORELREG
MOVE.GOUPDATE
WHEN.DRVHANDWHEELR/ORecords the value of DRV.HANDWHEEL when the when-
WHEN.DRVTIMER/ORecords the value of Time when the when-condition is sat-
WHEN.FB1MECHPOSR/ORecords the value of FB1.MECHPOS when the when-con-
dition is satisfied.
WHEN.PLCMDR/ORecords the value of PL.CMD when the when-condition is
satisfied.
WHEN.PLFBR/ORecords the value of Position when the when-condition is
satisfied.
Kollmorgen™ | March 30, 201262
AKD BASIC User Guide | 5 AKD BASIC Functions
5AKD BASIC Functions
This section describes the functions available in AKD BASIC.
63Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.1ABS()
General Information
TypeFunction
Description
Instructions
Enter the argument (the value) in parentheses immediately following the term ABS.
Example
For x = -10 To 10
Next
ABS(x) converts the associated value (x) to an absolute value. If the value is negative, it is converted to a positive value. If the value is positive, it is not changed.
PrintABS(x)
Kollmorgen™ | March 30, 201264
AKD BASIC User Guide | 5 AKD BASIC Functions
5.2ASC()
General Information
TypeFunction
Description
Syntax
x = ASC(s$)
Instructions
If the string begins with an uppercase letter, the value of ASC() will be between 65 and 90.
If the string begins with a lowercase letter, the value of ASC() will be between 97 and 122.
Values "0" to "9" return 48 to 57.
ASC(string expression)returns a decimal numeric value that is the ASCII code
for the first character of the string expression(x$).
65Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.3ATAN()
General Information
TypeFunction
Description ATAN() (arc tangent) returns the arctangent of its argument in radians.
Instructions
The result is always between -pi/2 and pi/2.
The value of x may be any numeric type.
To convert from degrees to radians, multiply by 0.01745329
Kollmorgen™ | March 30, 201266
AKD BASIC User Guide | 5 AKD BASIC Functions
5.4CHR$()
General Information
TypeFunction
Description Returns a one character string whose ASCII value is the argument.
Syntax
s$ = CHR$(x)
Instructions
The argument to Chr$() must be a numeric value in the range 0 to 255.
Example
'this example will print an uppercase B
Dim a$ as string
a$ = CHR$(66)
Print a$
67Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.5CINT()
General Information
TypeFunction
Description Converts a numeric expression to the closest integer number.
Instructions
X = CINT( numeric-expression )
Related Topics
INT() | FIX()
Kollmorgen™ | March 30, 201268
AKD BASIC User Guide | 5 AKD BASIC Functions
5.6COS()
General Information
TypeFunction
Description COS(x) returns the cosine of x, where x is in radians.
Instructions
X must be in radians. To convert from degrees to radians, multiply by 0.017453.
69Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.7EXP()
General Information
TypeFunction
Description Returns e (the base of natural logarithms) raised to a power.
Instructions
The Exp() function complements the action of the Log() function. For those of you keeping
score, the value of e is 2.71828182.
Related Topics
LOG() | LOG10()
Kollmorgen™ | March 30, 201270
AKD BASIC User Guide | 5 AKD BASIC Functions
5.8FIX()
General Information
TypeFunction
Description Fix() returns the truncated integer part of x.
Instructions
Fix() does not round off numbers, it simply eliminates the decimal pint and all digits to the right
of the decimal point.
Related Topics
ABS() | CINT() | INT()
71Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.9HEX$()
General Information
TypeFunction
Description HEX$() converts an integer number to its equivalent hexadecimal ASCII string.
Syntax
result$ = HEX$(x)
Instructions
Hexadecimal numbers are numbers to the base 16 (rather than base 10).
The argument to HEX$() is rounded to an integer before HEX$(x) is evaluated.
Example
Dim x,y as integer
Dim result1$, result2$ as string
x = 20
y = $H6A
result1$ = HEX$(x)
result2$ = HEX$(y)
Print result1$, result2$
'prints 14 6A
Related Topics
OCT$() | STR$()
Kollmorgen™ | March 30, 201272
AKD BASIC User Guide | 5 AKD BASIC Functions
5.10INKEY$()
General Information
TypeFunction
Returns a 1 character string corresponding to the character in the serial port
Description
Syntax
x$ = INKEY$
Instructions
Assigning a string from INKEY$ removes the character from the serial port's receive buffer.
Example
' remove all characters from the receive buffer
and put them into A$.
'--------------------------------------
new$ = INKEY$
While new$ <> ""
Wend
receive buffer. If there is no character waiting the INKEY$ will be the Null string
(""). If several characters are pending only the first one is returned.
A$ = A$ + new$
new$ = INKEY$
73Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.11INSTR()
General Information
TypeFunction
Description Returns the starting location of a substring within a string.
Syntax
result = INSTR( [n], x$, y$ )
x$ is the string
y$ is the substring
n optionally sets the start of the search
Instructions
n must be in the range 1 to 255
INSTR() returns 0 if:
n > LEN(x$)
y$ cannot be found in x$
If y$ iis null (empty, ""), INSTR() returns n
Related Topics
LEN()
Kollmorgen™ | March 30, 201274
AKD BASIC User Guide | 5 AKD BASIC Functions
5.12INT()
General Information
TypeFunction
Description INT() (convert to largest integer) truncates an expression to a whole number.
Instructions
INT() behaves the same as FIX() for positive numbers. They behave differently for negative
numbers.
Example
Print INT(12.34) 'prints the value 12
Print INT(-12.34) 'prints the value -13
Related Topics
CINT() | FIX()
75Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.13LCASE$()
General Information
TypeFunction
Description Converts a string expression to lowercase characters.
Syntax
result$ = LCASE$(string-expression)
Instructions
LCASE$() affects only letters in the string expression. Other characters (such as numbers) are
not changed.
Example
Dim x$ as string
x$ = "U.S.A"
PrintLCASE$(x$) 'prints: u.s.a
Related Topics
UCASE$()
Kollmorgen™ | March 30, 201276
AKD BASIC User Guide | 5 AKD BASIC Functions
5.14LEFT$()
General Information
TypeFunction
Description Returns a string of the n leftmost characters in a string expression.
Syntax
result$ = LEFT$(x$, n)
Instructions
If n is greater than LEN( x$ ) then the entire string will be returned.
Example
a$ = "Mississippi"
PrintLEFT$(a$, 5)'prints: Missi
Related Topics
LEN() | MID$ | RIGHT$()
77Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.15LEN()
General Information
TypeFunction
Description Returns the number of characters in a string expression.
Syntax
result = Len( x$ )
Instructions
Non-printing characters and blanks are included.
Example
x$ = "New York, New York"
PrintLEN(x$) 'prints 18
Kollmorgen™ | March 30, 201278
AKD BASIC User Guide | 5 AKD BASIC Functions
5.16LOG()
General Information
TypeFunction
Description Returns the natural logarithm of a numeric expression.
Instructions
X must be greater than 0.
Example
PrintLOG (45.0 / 7.0) 'prints 1.860752
PrintLOG(1) 'prints 0
Related Topics
EXP() | LOG10()
79Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.17LOG10()
General Information
TypeFunction
Description Returns the base 10 logarithm of a numeric expression.
Instructions
X must be greater than 0.
Example
PrintLOG10(100) 'prints 2
PrintLOG10(1) 'prints 0
Related Topics
EXP() | LOG()
Kollmorgen™ | March 30, 201280
AKD BASIC User Guide | 5 AKD BASIC Functions
5.18LTRIM$()
General Information
TypeFunction
Description Returns a copy of the original string with leading blanks removed.
Syntax
result$ = LTRIM$(x$)
Instructions
x$ can be any string-expression
Example
x$ = "Hello"
Print"(" + LTRIM$(x$) + ")"
'prints: (Hello)
Related Topics
RTRIM$() | TRIM$()
81Kollmorgen™ | March 30, 2012
AKD BASIC User Guide | 5 AKD BASIC Functions
5.19MID$
General Information
TypeFunction
Description
Syntax
result = MID$(x$, start, [length])
Instructions
Start and Length must both be numeric expressions.
If Length is omitted then MID$() returns a substring that starts at start and goes to the end of
x$.
Example
Returns a substring of the original string that begins at the specified offset location and is of the specified (optional) length.
This section is an alphabetical reference to AKD BASIC parameters.
General information for each parameter is listed at the top of each page. The parameter is then
described, and in some cases examples are given along with references to related parameters.
The $Include statement allows you to textually include multiple separate files in a single source
file. A file cannot include itself, either directly or indirectly. Include file nesting is allowed to a
depth of 16. Relative paths in a nested include file are relative to the directory location of the
include file, not the current working directory of the compiler.
The $Include statement allows you to textually include multiple separate files in
a single source file.
N/A
TBD
Example
This example shows two file, myinc.inc and myfile.bas. The file myinc.inc has a sub-procedure
for doing and incremental move that is used by the main program in myfile.bas.
Allows you to define your own names for system resources, such as Input or Output pins.
ALIAS is much more powerful than CONST. Constant expressions are computable at compiletime, whereas an alias has a value that may only be known at the time that it is being used. For
this reason aliases should be used with care – over-use of aliases can make it very difficult to
read a program.
Allows you to define your own names for system resources, such as Input or Output pins.
N/A
tbd
Example
Alias CONVEYOR_IS_RUNNING = (DIN1.STATE = 0)
if CONVEYOR_IS_RUNNING then
Transfer program control to a subroutine. When the subroutine is finished then control is transferred to the line following the CALL. A subroutine is essentially a function with no return value.
Arguments to subroutines are passed "by value". This means that the subroutine receives a
copy of these arguments. Any assignments to these arguments made by the subroutine will
have no effect on these variables in the calling function or subroutine.
Transfer program control to a subroutine. When the subroutine is finished then
control is transferred to the line following the CALL.
N/A
tbd
Example
Call PrintSum(3,4)
'-------------- Subroutines and Functions -----
-------
Sub PrintSum(i,j,as integer)
print i+j
End Sub
Related Topics
Sub...End Sub
Kollmorgen™ | March 30, 2012100
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.