EasyManua.ls Logo

NANOTEC PD4-C - Page 101

Default Icon
256 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
8 Programming with NanoJ
Note
Active waiting for a value in the object dictionary should always be associated with a yield().
Example
while (od_read(2400,2) != 0) // wait until 2400:2 is set
{ yield(); }
8.3.2 Process control
void yield()
This function returns the processor time to the operating system. In the next time slot, the program continues
at the location after the call.
void sleep (U32 ms)
This function returns the processor time to the operating system for the specified number of milliseconds.
The user program is then continued at the location after the call.
ms Time to be waited in milliseconds
8.3.3 Debug output
The following functions output a value in the debug console. They differ with respect to the data type of the
parameter to be passed.
bool VmmDebugOutputString (const char *outstring)
bool VmmDebugOutputInt (const U32 val)
bool VmmDebugOutputByte (const U08 val)
bool VmmDebugOutputHalfWord (const U16 val)
bool VmmDebugOutputWord (const U32 val)
bool VmmDebugOutputFloat (const float val)
Note
The debug outputs are first written to a separate area of the object dictionary and read from there
by the Plug & Drive Studio.
This OD entry has index 2600
h
and is 64 characters long, see 2600h NanoJ Debug Output. Subindex
00 always contains the number of characters already written.
If the buffer is full, VmmDebugOutputxxx() initially fails; execution of the user program ceases and it stops
at the location of the debug output. Only after the GUI has read the buffer and after subindex 00 has been
reset does the program continue and VmmDebugOutputxxx() returns to the user program.
Version: 2.0.1 / FIR-v1650 101

Table of Contents