Configuration via USB General The following options are available for configuring the controller via USB: Configuration file This file can be saved to the controller via the USB connection. For further information, read chapters USB connection and Configuration file. NanoJ program This program can be programmed, compiled and then transferred to the controller with NanoJ via USB. For further information, read chapters NanoJ program and Programming with NanoJ. After connecting to a voltage supply, the controller reads out the configuration in the following order: The configuration file is read out and processed. The NanoJ program is started. USB connection Notice image/svg+xml Damage of the product and/or external hardware due to potential differences on the USB. Connecting the USB cable while the electronic is powered on (Hot-Plugging) possibly causes damage. ► Connect the USB bevor you switch on the voltage supply. ► If possible, balance any potential differences between PC and the product or use a USB isolator. ► Connect the USB cable first to the product and then to the PC. If the controller is connected to a PC via a USB cable, an MTP device is created in the Windows file explorer, which contains a data storage device. Three files are displayed: the configuration file (cfg*.txt), the NanoJ program (nanoj*.usr) and the firmware file (*.fw). You can thereby store the configuration file or the NanoJ program on the controller. The voltage supply of the controller must also be connected during USB operation. Note: Only use a standard Micro USB cable. Never use a USB cable that manufacturers of mobile phones include with their products. These USB cables could have a different plug shape or pin assignment. Do not save any files on the controller other than those listed below: cfg*.txt nanoj*.usr reset.txt Any other file is deleted when the voltage supply of the controller is switched on! PowerShell scripts In the download area of the product website at nanotec.com you can find the file mtp.ps1 with examples for the Windiws PowerShell console. With these you can: List all stored files:.\mtp.ps1 -Action list -DeviceName N6-1-1-1 Copy a file from the current script folder to the device:.\mtp.ps1 -Action copy -DeviceName N6-1-1-1 -FileName cfg_Example.txt Delete a file:.\mtp.ps1 -Action delete -DeviceName N6-1-1-1 -FileName cfg_Example.txt MTP in Linux Nanotec recommends the following: MTP-Tools. Should the usually included in Linux distributions GVfs be already installed, deinstall it beforehand: sudo apt remove gvfs Afterwards install MTP-Tools and libmtp and reboot: sudo apt-get install mtp-tools sudo apt-get install libmtp-runtime reboot After connecting the USB, check that the device is detected: mtp-detect The device responds to this with its properties (manufacturer, designation, serial number etc.) You can now: List all stored files with their ID:mtp-files Copy a file from the current script folder to the device (the name must be identical):mtp-sendfile cfg_Out.txt cfg_Out.txt Copy a file from the device (file ID as listed by mtp-files):mtp-getfile 1072922872 cfg_Or.txt Delete a file:mtp-delfile -f cfg_Example.txt Configuration file General The cfg.txt configuration file is used to preset values for the object dictionary to a certain value during startup. This file uses a special syntax to make accessing the objects of the object dictionary as easy as possible. The controller evaluates all assignments in the file from top to bottom. Note: If you delete the configuration file, the controller recreates the file (without content) on the next restart. Reading and writing the file How to access the file: Connect and switch on the voltage supply. Connect the controller to your PC using the USB cable. After the PC has detected the device as a removable storage device, navigate in the Explorer to the directory of the controller. File cfg.txt is stored there. Open this file with a simple text editor, such as Notepad or Vi. Do not use any programs that use markup (LibreOffice or similar). After you have made changes to the file, proceed as follows to apply the changes through a restart: Save the file if you have not yet already done so. The motor stops. Disconnect the USB cable from the controller. Disconnect the voltage supply from the controller for approx. 1 second until the power LEDs stop flashing. Reconnect the voltage supply. When the controller is now restarted, the values in the configuration file are read out and applied. Tip: To restart the controller, you can also copy an empty reset.txt file to the controller. This restarts the controller. The reset.txt file is deleted on the next restart. Structure of the configuration file Comments Lines that begin with a semicolon are ignored by the controller. Example ; This is a comment line Assignments Note: Before setting a value, determine its data type (see chapter Description of the object dictionary)! The controller does not validate entries for logical errors! Values in the object dictionary can be set with the following syntax: <Index>:<Subindex>=<Value> <Index> This value corresponds to the index of the object and is interpreted as a hexadecimal number. The value must always be specified with four digits. <Subindex> This value corresponds to the subindex of the object and is interpreted as a hexadecimal number. The value must always be specified with two digits and can be omitted if the subindex is 00h. <Value> The value that is to be written in the object is interpreted as a hexadecimal number. Hexadecimal numbers are to be prefixed with "0x". You can also set individual bits: Set bit 3202:00.01=1 Reset bit 3202:00.01=0 Bitwise OR 3202:00|=0x01 Bitwise AND 3202:00&=0x01 Example Set object 6075h (rated current) to the value "600" (mA):6075:00=600 Set object 3202h:00 to the value "1" (activate closed-loop mode): 3202:00=1 or only set bit 0 3202:00.00=1 Note: There must be no blank characters to the left and right of the equal sign. The following assignments are not correct: 6040:00 =5 6040:00= 5 6040:00 = 5 The number of places must not be changed. The index must be four characters long and the subindex two characters long. The following assignments are not correct: 6040:0=6 6040=6 Blank spaces at the start of the line are not permitted. NanoJ program A NanoJ program can be executed on the controller. To load and start a program on the controller, proceed as follows: Write and compile your program as described in chapter Programming with NanoJ. Connect the voltage supply to the controller and switch on the voltage supply. Connect the controller to your PC using the USB cable. After the PC has detected the device as a removable storage device, open an Explorer window and delete file nanoj*.usr on the controller. Navigate in the Explorer to the directory with your program. The compiled file has the same name as the source code file, only with file extension .usr. Rename this file nanoj*.usr. Copy file nanoj*.usr to the controller. To start the NanoJ program the next time the controller is restarted, add the following line to the configuration file: 2300:00=1 Disconnect the voltage supply from the controller for approx. 1 second until the power LEDs stop flashing. Reconnect the voltage supply. When the controller now starts, the new NanoJ program is read in and started. Tip: To restart the controller, you can also copy an empty reset.txt file to the controller. This restarts the controller. The reset.txt file is deleted on the next restart. Note: The NanoJ program on the controller must have file name nanoj*.usr. If the NanoJ program was deleted, an empty file named nanoj*.usr is created the next time the controller is started. Tip: It is possible to automate the deletion of the old NanoJ program and the copying of the new one with a script file: Under Windows, you can create a file with file extension bat and the following content: copy <SOURCE_PATH>\<OUTPUT>.usr <TARGET>:\nanoj*.usr For example: copy c:\test\main.usr n:\nanoj*.usr Under Linux, you can create a script with file extension sh and the following content: #!/bin/bash cp <SOURCE_PATH>/<OUTPUT>.usr <TARGET_PATH>/nanoj*.usr
Configuration via USB General The following options are available for configuring the controller via USB: Configuration file This file can be saved to the controller via the USB connection. For further information, read chapters USB connection and Configuration file. NanoJ program This program can be programmed, compiled and then transferred to the controller with NanoJ via USB. For further information, read chapters NanoJ program and Programming with NanoJ. After connecting to a voltage supply, the controller reads out the configuration in the following order: The configuration file is read out and processed. The NanoJ program is started. USB connection Notice image/svg+xml Damage of the product and/or external hardware due to potential differences on the USB. Connecting the USB cable while the electronic is powered on (Hot-Plugging) possibly causes damage. ► Connect the USB bevor you switch on the voltage supply. ► If possible, balance any potential differences between PC and the product or use a USB isolator. ► Connect the USB cable first to the product and then to the PC. If the controller is connected to a PC via a USB cable, an MTP device is created in the Windows file explorer, which contains a data storage device. Three files are displayed: the configuration file (cfg*.txt), the NanoJ program (nanoj*.usr) and the firmware file (*.fw). You can thereby store the configuration file or the NanoJ program on the controller. The voltage supply of the controller must also be connected during USB operation. Note: Only use a standard Micro USB cable. Never use a USB cable that manufacturers of mobile phones include with their products. These USB cables could have a different plug shape or pin assignment. Do not save any files on the controller other than those listed below: cfg*.txt nanoj*.usr reset.txt Any other file is deleted when the voltage supply of the controller is switched on! PowerShell scripts In the download area of the product website at nanotec.com you can find the file mtp.ps1 with examples for the Windiws PowerShell console. With these you can: List all stored files:.\mtp.ps1 -Action list -DeviceName N6-1-1-1 Copy a file from the current script folder to the device:.\mtp.ps1 -Action copy -DeviceName N6-1-1-1 -FileName cfg_Example.txt Delete a file:.\mtp.ps1 -Action delete -DeviceName N6-1-1-1 -FileName cfg_Example.txt MTP in Linux Nanotec recommends the following: MTP-Tools. Should the usually included in Linux distributions GVfs be already installed, deinstall it beforehand: sudo apt remove gvfs Afterwards install MTP-Tools and libmtp and reboot: sudo apt-get install mtp-tools sudo apt-get install libmtp-runtime reboot After connecting the USB, check that the device is detected: mtp-detect The device responds to this with its properties (manufacturer, designation, serial number etc.) You can now: List all stored files with their ID:mtp-files Copy a file from the current script folder to the device (the name must be identical):mtp-sendfile cfg_Out.txt cfg_Out.txt Copy a file from the device (file ID as listed by mtp-files):mtp-getfile 1072922872 cfg_Or.txt Delete a file:mtp-delfile -f cfg_Example.txt Configuration file General The cfg.txt configuration file is used to preset values for the object dictionary to a certain value during startup. This file uses a special syntax to make accessing the objects of the object dictionary as easy as possible. The controller evaluates all assignments in the file from top to bottom. Note: If you delete the configuration file, the controller recreates the file (without content) on the next restart. Reading and writing the file How to access the file: Connect and switch on the voltage supply. Connect the controller to your PC using the USB cable. After the PC has detected the device as a removable storage device, navigate in the Explorer to the directory of the controller. File cfg.txt is stored there. Open this file with a simple text editor, such as Notepad or Vi. Do not use any programs that use markup (LibreOffice or similar). After you have made changes to the file, proceed as follows to apply the changes through a restart: Save the file if you have not yet already done so. The motor stops. Disconnect the USB cable from the controller. Disconnect the voltage supply from the controller for approx. 1 second until the power LEDs stop flashing. Reconnect the voltage supply. When the controller is now restarted, the values in the configuration file are read out and applied. Tip: To restart the controller, you can also copy an empty reset.txt file to the controller. This restarts the controller. The reset.txt file is deleted on the next restart. Structure of the configuration file Comments Lines that begin with a semicolon are ignored by the controller. Example ; This is a comment line Assignments Note: Before setting a value, determine its data type (see chapter Description of the object dictionary)! The controller does not validate entries for logical errors! Values in the object dictionary can be set with the following syntax: <Index>:<Subindex>=<Value> <Index> This value corresponds to the index of the object and is interpreted as a hexadecimal number. The value must always be specified with four digits. <Subindex> This value corresponds to the subindex of the object and is interpreted as a hexadecimal number. The value must always be specified with two digits and can be omitted if the subindex is 00h. <Value> The value that is to be written in the object is interpreted as a hexadecimal number. Hexadecimal numbers are to be prefixed with "0x". You can also set individual bits: Set bit 3202:00.01=1 Reset bit 3202:00.01=0 Bitwise OR 3202:00|=0x01 Bitwise AND 3202:00&=0x01 Example Set object 6075h (rated current) to the value "600" (mA):6075:00=600 Set object 3202h:00 to the value "1" (activate closed-loop mode): 3202:00=1 or only set bit 0 3202:00.00=1 Note: There must be no blank characters to the left and right of the equal sign. The following assignments are not correct: 6040:00 =5 6040:00= 5 6040:00 = 5 The number of places must not be changed. The index must be four characters long and the subindex two characters long. The following assignments are not correct: 6040:0=6 6040=6 Blank spaces at the start of the line are not permitted. NanoJ program A NanoJ program can be executed on the controller. To load and start a program on the controller, proceed as follows: Write and compile your program as described in chapter Programming with NanoJ. Connect the voltage supply to the controller and switch on the voltage supply. Connect the controller to your PC using the USB cable. After the PC has detected the device as a removable storage device, open an Explorer window and delete file nanoj*.usr on the controller. Navigate in the Explorer to the directory with your program. The compiled file has the same name as the source code file, only with file extension .usr. Rename this file nanoj*.usr. Copy file nanoj*.usr to the controller. To start the NanoJ program the next time the controller is restarted, add the following line to the configuration file: 2300:00=1 Disconnect the voltage supply from the controller for approx. 1 second until the power LEDs stop flashing. Reconnect the voltage supply. When the controller now starts, the new NanoJ program is read in and started. Tip: To restart the controller, you can also copy an empty reset.txt file to the controller. This restarts the controller. The reset.txt file is deleted on the next restart. Note: The NanoJ program on the controller must have file name nanoj*.usr. If the NanoJ program was deleted, an empty file named nanoj*.usr is created the next time the controller is started. Tip: It is possible to automate the deletion of the old NanoJ program and the copying of the new one with a script file: Under Windows, you can create a file with file extension bat and the following content: copy <SOURCE_PATH>\<OUTPUT>.usr <TARGET>:\nanoj*.usr For example: copy c:\test\main.usr n:\nanoj*.usr Under Linux, you can create a script with file extension sh and the following content: #!/bin/bash cp <SOURCE_PATH>/<OUTPUT>.usr <TARGET_PATH>/nanoj*.usr
General The following options are available for configuring the controller via USB: Configuration file This file can be saved to the controller via the USB connection. For further information, read chapters USB connection and Configuration file. NanoJ program This program can be programmed, compiled and then transferred to the controller with NanoJ via USB. For further information, read chapters NanoJ program and Programming with NanoJ. After connecting to a voltage supply, the controller reads out the configuration in the following order: The configuration file is read out and processed. The NanoJ program is started.
USB connection Notice image/svg+xml Damage of the product and/or external hardware due to potential differences on the USB. Connecting the USB cable while the electronic is powered on (Hot-Plugging) possibly causes damage. ► Connect the USB bevor you switch on the voltage supply. ► If possible, balance any potential differences between PC and the product or use a USB isolator. ► Connect the USB cable first to the product and then to the PC. If the controller is connected to a PC via a USB cable, an MTP device is created in the Windows file explorer, which contains a data storage device. Three files are displayed: the configuration file (cfg*.txt), the NanoJ program (nanoj*.usr) and the firmware file (*.fw). You can thereby store the configuration file or the NanoJ program on the controller. The voltage supply of the controller must also be connected during USB operation. Note: Only use a standard Micro USB cable. Never use a USB cable that manufacturers of mobile phones include with their products. These USB cables could have a different plug shape or pin assignment. Do not save any files on the controller other than those listed below: cfg*.txt nanoj*.usr reset.txt Any other file is deleted when the voltage supply of the controller is switched on! PowerShell scripts In the download area of the product website at nanotec.com you can find the file mtp.ps1 with examples for the Windiws PowerShell console. With these you can: List all stored files:.\mtp.ps1 -Action list -DeviceName N6-1-1-1 Copy a file from the current script folder to the device:.\mtp.ps1 -Action copy -DeviceName N6-1-1-1 -FileName cfg_Example.txt Delete a file:.\mtp.ps1 -Action delete -DeviceName N6-1-1-1 -FileName cfg_Example.txt MTP in Linux Nanotec recommends the following: MTP-Tools. Should the usually included in Linux distributions GVfs be already installed, deinstall it beforehand: sudo apt remove gvfs Afterwards install MTP-Tools and libmtp and reboot: sudo apt-get install mtp-tools sudo apt-get install libmtp-runtime reboot After connecting the USB, check that the device is detected: mtp-detect The device responds to this with its properties (manufacturer, designation, serial number etc.) You can now: List all stored files with their ID:mtp-files Copy a file from the current script folder to the device (the name must be identical):mtp-sendfile cfg_Out.txt cfg_Out.txt Copy a file from the device (file ID as listed by mtp-files):mtp-getfile 1072922872 cfg_Or.txt Delete a file:mtp-delfile -f cfg_Example.txt
Configuration file General The cfg.txt configuration file is used to preset values for the object dictionary to a certain value during startup. This file uses a special syntax to make accessing the objects of the object dictionary as easy as possible. The controller evaluates all assignments in the file from top to bottom. Note: If you delete the configuration file, the controller recreates the file (without content) on the next restart. Reading and writing the file How to access the file: Connect and switch on the voltage supply. Connect the controller to your PC using the USB cable. After the PC has detected the device as a removable storage device, navigate in the Explorer to the directory of the controller. File cfg.txt is stored there. Open this file with a simple text editor, such as Notepad or Vi. Do not use any programs that use markup (LibreOffice or similar). After you have made changes to the file, proceed as follows to apply the changes through a restart: Save the file if you have not yet already done so. The motor stops. Disconnect the USB cable from the controller. Disconnect the voltage supply from the controller for approx. 1 second until the power LEDs stop flashing. Reconnect the voltage supply. When the controller is now restarted, the values in the configuration file are read out and applied. Tip: To restart the controller, you can also copy an empty reset.txt file to the controller. This restarts the controller. The reset.txt file is deleted on the next restart. Structure of the configuration file Comments Lines that begin with a semicolon are ignored by the controller. Example ; This is a comment line Assignments Note: Before setting a value, determine its data type (see chapter Description of the object dictionary)! The controller does not validate entries for logical errors! Values in the object dictionary can be set with the following syntax: <Index>:<Subindex>=<Value> <Index> This value corresponds to the index of the object and is interpreted as a hexadecimal number. The value must always be specified with four digits. <Subindex> This value corresponds to the subindex of the object and is interpreted as a hexadecimal number. The value must always be specified with two digits and can be omitted if the subindex is 00h. <Value> The value that is to be written in the object is interpreted as a hexadecimal number. Hexadecimal numbers are to be prefixed with "0x". You can also set individual bits: Set bit 3202:00.01=1 Reset bit 3202:00.01=0 Bitwise OR 3202:00|=0x01 Bitwise AND 3202:00&=0x01 Example Set object 6075h (rated current) to the value "600" (mA):6075:00=600 Set object 3202h:00 to the value "1" (activate closed-loop mode): 3202:00=1 or only set bit 0 3202:00.00=1 Note: There must be no blank characters to the left and right of the equal sign. The following assignments are not correct: 6040:00 =5 6040:00= 5 6040:00 = 5 The number of places must not be changed. The index must be four characters long and the subindex two characters long. The following assignments are not correct: 6040:0=6 6040=6 Blank spaces at the start of the line are not permitted.
General The cfg.txt configuration file is used to preset values for the object dictionary to a certain value during startup. This file uses a special syntax to make accessing the objects of the object dictionary as easy as possible. The controller evaluates all assignments in the file from top to bottom. Note: If you delete the configuration file, the controller recreates the file (without content) on the next restart.
Reading and writing the file How to access the file: Connect and switch on the voltage supply. Connect the controller to your PC using the USB cable. After the PC has detected the device as a removable storage device, navigate in the Explorer to the directory of the controller. File cfg.txt is stored there. Open this file with a simple text editor, such as Notepad or Vi. Do not use any programs that use markup (LibreOffice or similar). After you have made changes to the file, proceed as follows to apply the changes through a restart: Save the file if you have not yet already done so. The motor stops. Disconnect the USB cable from the controller. Disconnect the voltage supply from the controller for approx. 1 second until the power LEDs stop flashing. Reconnect the voltage supply. When the controller is now restarted, the values in the configuration file are read out and applied. Tip: To restart the controller, you can also copy an empty reset.txt file to the controller. This restarts the controller. The reset.txt file is deleted on the next restart.
Structure of the configuration file Comments Lines that begin with a semicolon are ignored by the controller. Example ; This is a comment line Assignments Note: Before setting a value, determine its data type (see chapter Description of the object dictionary)! The controller does not validate entries for logical errors! Values in the object dictionary can be set with the following syntax: <Index>:<Subindex>=<Value> <Index> This value corresponds to the index of the object and is interpreted as a hexadecimal number. The value must always be specified with four digits. <Subindex> This value corresponds to the subindex of the object and is interpreted as a hexadecimal number. The value must always be specified with two digits and can be omitted if the subindex is 00h. <Value> The value that is to be written in the object is interpreted as a hexadecimal number. Hexadecimal numbers are to be prefixed with "0x". You can also set individual bits: Set bit 3202:00.01=1 Reset bit 3202:00.01=0 Bitwise OR 3202:00|=0x01 Bitwise AND 3202:00&=0x01 Example Set object 6075h (rated current) to the value "600" (mA):6075:00=600 Set object 3202h:00 to the value "1" (activate closed-loop mode): 3202:00=1 or only set bit 0 3202:00.00=1 Note: There must be no blank characters to the left and right of the equal sign. The following assignments are not correct: 6040:00 =5 6040:00= 5 6040:00 = 5 The number of places must not be changed. The index must be four characters long and the subindex two characters long. The following assignments are not correct: 6040:0=6 6040=6 Blank spaces at the start of the line are not permitted.
Comments Lines that begin with a semicolon are ignored by the controller. Example ; This is a comment line
Assignments Note: Before setting a value, determine its data type (see chapter Description of the object dictionary)! The controller does not validate entries for logical errors! Values in the object dictionary can be set with the following syntax: <Index>:<Subindex>=<Value> <Index> This value corresponds to the index of the object and is interpreted as a hexadecimal number. The value must always be specified with four digits. <Subindex> This value corresponds to the subindex of the object and is interpreted as a hexadecimal number. The value must always be specified with two digits and can be omitted if the subindex is 00h. <Value> The value that is to be written in the object is interpreted as a hexadecimal number. Hexadecimal numbers are to be prefixed with "0x". You can also set individual bits: Set bit 3202:00.01=1 Reset bit 3202:00.01=0 Bitwise OR 3202:00|=0x01 Bitwise AND 3202:00&=0x01 Example Set object 6075h (rated current) to the value "600" (mA):6075:00=600 Set object 3202h:00 to the value "1" (activate closed-loop mode): 3202:00=1 or only set bit 0 3202:00.00=1 Note: There must be no blank characters to the left and right of the equal sign. The following assignments are not correct: 6040:00 =5 6040:00= 5 6040:00 = 5 The number of places must not be changed. The index must be four characters long and the subindex two characters long. The following assignments are not correct: 6040:0=6 6040=6 Blank spaces at the start of the line are not permitted.
NanoJ program A NanoJ program can be executed on the controller. To load and start a program on the controller, proceed as follows: Write and compile your program as described in chapter Programming with NanoJ. Connect the voltage supply to the controller and switch on the voltage supply. Connect the controller to your PC using the USB cable. After the PC has detected the device as a removable storage device, open an Explorer window and delete file nanoj*.usr on the controller. Navigate in the Explorer to the directory with your program. The compiled file has the same name as the source code file, only with file extension .usr. Rename this file nanoj*.usr. Copy file nanoj*.usr to the controller. To start the NanoJ program the next time the controller is restarted, add the following line to the configuration file: 2300:00=1 Disconnect the voltage supply from the controller for approx. 1 second until the power LEDs stop flashing. Reconnect the voltage supply. When the controller now starts, the new NanoJ program is read in and started. Tip: To restart the controller, you can also copy an empty reset.txt file to the controller. This restarts the controller. The reset.txt file is deleted on the next restart. Note: The NanoJ program on the controller must have file name nanoj*.usr. If the NanoJ program was deleted, an empty file named nanoj*.usr is created the next time the controller is started. Tip: It is possible to automate the deletion of the old NanoJ program and the copying of the new one with a script file: Under Windows, you can create a file with file extension bat and the following content: copy <SOURCE_PATH>\<OUTPUT>.usr <TARGET>:\nanoj*.usr For example: copy c:\test\main.usr n:\nanoj*.usr Under Linux, you can create a script with file extension sh and the following content: #!/bin/bash cp <SOURCE_PATH>/<OUTPUT>.usr <TARGET_PATH>/nanoj*.usr