![NANOTEC PD4-E-M Скачать руководство пользователя страница 96](http://html1.mh-extra.com/html/nanotec/pd4-e-m/pd4-e-m_technical-manual_3239651096.webp)
Technical Manual PD4-E-M (EtherCAT)
9 Programming with NanoJ
A list of available system calls can be found in chapter System calls in a NanoJ program.
Tip
Nanotec recommends accessing a given OD value either by mapping or using a system call with
od_write()
. If both are used simultaneously, the system call has no effect.
9.1.5 NanoJ program – OD entries
The NanoJ program is controlled and configured in object range 2300
h
to 2330
h
(see 2300h NanoJ
OD-Index
Name and description
2300
h
2301
h
2302
h
2310
h
2310h NanoJ Input Data Selection
2320
h
2320h NanoJ Output Data Selection
2330
h
2330h NanoJ In/output Data Selection
Example:
To select and start the TEST1.USR user program, the following sequence can, for example, be used:
•
Check entry 2302
h
for error code.
•
If no error:
Start the NanoJ program by writing object 2300
h
, bit 0 = "1".
Note
It can take up to 200 ms for the NanoJ program to start.
•
Check entry 2302
h
for error code and object 2301
, bit 0 = "1".
To stop a running program: write entry 2300
h
with bit 0 value = "0".
9.1.6 Structure of a NanoJ program
A user program consists of at least two instructions:
•
the preprocessor instruction
#include "wrapper.h"
•
the
void user(){}
function
The code to be executed can be stored in the
void user()
function.
Note
The file names of the user programs must not be longer than eight characters plus three characters
in the suffix; file name
main.cpp
is permissible, file name
aLongFileName.cpp
is not permissible.
Version: 1.0.1 / FIR-v1748
96