Manual PD4-C (USB)
11 Programming with NanoJ
Version: 1.4.1 / 22.07.2016 / FIR-v1626
77
11.4 Object dictionary entries for controlling and configuring the VMM
11.4.1 Object dictionary entries
The VMM is controlled and configured by means of object dictionary entries in the object range 2300
.
object dictionary Index
Name
h
NanoJ Control
h
NanoJ Status
h
NanoJ Error Code
h
NanoJ Input Data Selection
h
NanoJ Output Data Selection
h
NanoJ In/output Data Selection
11.4.2 Example
To select and start the "TEST1.USR" user program, the following sequence can be used for instance:
•
Rename the file "
TEST1.USR
" to "
vmmcode.usr
".
•
Copy the file "
vmmcode.usr
" via USB to the controller.
•
Start the NanoJ program with setting the object 2300
, Bit 0 to "1". or restart the controller.
•
Check the object 2302
h
if an error has occurred and check the objects 2301
h
, Bit 0 to be set to
"1" (vmm is actually running).
Note
Due to limitations in the USB implementation, after a restart of the controller the file "
vmmcode.usr
"
will get set to a size of 16kB and the creation date is reset to 13.03.2012.
To stop a running program: Write the bit 0-value = "0" to the entry 2300
.
11.5 NanoJ Easy V2
11.5.1 Installation and use
Introduction
As an alternative to NanoIP, a user program can also be programmed, uploaded, and controlled with
the NanoJ Easy V2 software.
Installation
Proceed as follows for installation:
1. Unpack "NanoJEasyV2.zip" into a directory of your choice.
2. Launch the program with the file "NanoJEasy.exe".
11.5.2 Programming of user programs
User program structure
A user program consists of at least two instructions:
1. The
#include "wrapper.h"
preprocessor instruction
2. The
void user(){}
function