Configuration
General information
The following options exist for configuring the motor controller:
- Configuration file
- This file can be stored on the motor controller by using the USB port. Read the sections "USB port" and "Configuration file.
- NanoJ program
- This program can be programmed, compiled, and then transferred over USB to the motor controller with NanoJ Easy. Read the sections and "NanoJ program"Programming with NanoJ".
- CANopen Node-ID and terminating resistor
- This motor is fitted with the CANopen field bus. Furthermore there is a DIP switch for terminating. is fitted next to it. Read the "CANopen" section for details.
- Modbus over RS-485 or RS-232
- This controller is fitted with a Modbus interface. Moreover there is a DIP switch mounted for the terminating resistor. Read the "Modbus RTU" section for details..
- Configuration file is read out and processed.
- The NanoJ program is launched
USB port
|
---|
|
Note |
---|
|
If a USB cable is used for connecting the motor controller to a PC, the motor controller behaves like a removable storage medium. You can therefore store the configuration file or NanoJ program on the motor controller. All changes to files are only applied after the motor controller has been restarted (for example by short disconnection from the voltage supply).
Tip |
A frequent occurrence during set up and installation is that a file is updated and then copied back to the motor controller, it is therefore advisable to use a script file that does this work
|
Configuration file
General information
Read the "USB port" section first if you have not already done so.
The configuration file cfg.txt
has the purpose of preassigning values for the object
directory to a specific value at start up. This file is kept in a special syntax to keep access to
objects in the object directory as simple as possible. The motor controller evaluates all
assignments in the file from the top downwards.
Note |
---|
Should you delete the configuration file, the file is recreated (without content) at the next motor controller restart. |
Reading and writing the file
To access to the file:
- Connect the voltage supply and switch on the voltage supply.
- Connect the motor controller to your PC by using the USB cable.
- After the PC has recognized the device as a removable storage medium, navigate with the Explorer to the
directory for the motor controller. The file "
cfg.txt
" (in case of a PD4-C the file is named "pd4ccfg.txt
") is stored there. - Open this file with a simple text editor, such as Notepad or Vi. Do not use any programs that use text styles (LibreOffice or suchlike).
After you have made changes to the file, take the following action to apply the changes:
- Save the file if you have not already done this.
- Disconnect the USB cable from the motor controller.
- Disconnect the voltage supply from the motor controller for approx. 1 second.
- Reconnect the voltage supply. At the next motor controller startup, the new values in the configuration file are read out and applied.
Tip |
You can also copy an empty file This restarts the motor controller. The file |
Structure of configuration file
Comments
Lines that start with a semicolon are ignored by the motor controller.
Example |
|
|
Assignments
CAUTION |
---|
Beforeyou set a value, find out about its data type (see the "Object directory description" section). The motor controller does notvalidate any entries for logic errors! |
<Index>:<SubIndex>=<Value>
-
<Index>
- This value corresponds to the index of the object and is interpreted as a hexadecimal number. The value must always have four digits.
-
<SubIndex>
- This value corresponds to the sub-index of the object and is interpreted as a hexadecimal number. The value must always have two digits.
-
<Value>
- The value that is to be written into the object is interpreted as a decimal number. A
"
0x
" is to be added to the front for hexadecimal numbers.
Note |
---|
|
Example |
|
Setting object 6040
h:00 to the value "6":
|
Short-circuit evaluation
DIP switches can only be used for executing certain assignments. The following syntax is used for short-circuit execution:
#<No>:<Assignment>
-
<No>
- The number of the DIP switch printed on the switch is given here. Permissible values are 1 to 4
-
<Assignment>
- The assignment specified here is described in the "Assignments" section.
Example |
|
The following code is set by the object 2057 h:00h "Clock Direction Multiplier"):
|
NanoJ program
A NanoJ program may be executed on the motor controller. Carry out the following steps to load and launch a program on the motor controller:
- Write and compile your program as described in the "Programming with NanoJ" section.
- Connect the voltage supply to the controller and switch on the voltage supply.
- Connect the motor controller to your PC by using the USB cable.
- After the PC has recognized the device as a removable storage medium, open a file explorer and
delete file "
vmmcode.usr
" on the motor controller - Use the explorer to navigate to the directory with your program. The compiled file has the same
name as the source code file, only with the file name extension
"
.usr
". Rename this file to "vmmcode.usr
". - Now copy file "
vmmcode.usr
" to the motor controller. - Disconnect the voltage supply from the motor controller for approx. 1 second.
- Reconnect the voltage supply. At the next start of the motor controller, the new NanoJ program is read-in and launched.
Tip |
You can also copy an empty file This restarts the motor controller. The file |
Note |
---|
|
Tip |
Deletion of the old NanoJ program and copying of the new one can be automated with a script file.
|
CANopen
All settings for CANopen can be either written to the file cfg.txt
or may get stored with the
CANopen storing mechanism (see chapter Save Objects).
- First the values stored via CANopen are applied.
- Then the values of the
cfg.txt
are applied.
Node-ID
The controller starts per with the Node-ID "127" per default. If a different Node-ID is needed, the new value of the Node-ID is written to the object 2009h.
Baud rate
The controller starts per with the baud rate of 1 MBd per default. The baud rate must be put in the object 2005h. See the following table for the options.
Value | Baud rate in kBd | |
---|---|---|
dec | hex | |
129 | 81 | 10 |
130 | 82 | 20 |
131 | 83 | 50 |
132 | 84 | 125 |
133 | 85 | 250 |
134 | 86 | 500 |
136 | 88 | 1000 |
Terminating resistor
A switch for the terminating resistor is mounted on the board (see "Terminating resistor (switch S1)"). When set to the position "ON", the lines will be terminated with 120 Ohm.