beautypg.com

Plc programming – Lenze ETC Motion Control User Manual

Page 373

background image

PLC programming

Library

General functions

8

8.8

8.8.1

l

373

EDSTCXN EN 2.0

8.8.1.23

SYSERROR

FUNCTION SYSERROR: BOOL

VAR_INPUT

fehler_di

: DINT;

(* error number *)

klasse_dw

: DWORD;

(* error class *)

formatstring

: STRING(80); (* Format string *)

PARAMETER_P

: DINT;

(* Address of a structure containing the parameters *)

END_VAR

The function SYSERROR is used like the function SPSERROR.

This function can be used to display control−internal errors.

8.8.1.24

TRACE

FUNCTION TRACE: BOOL

VAR_INPUT

Idx

: DINT;

(* Trace index *)

formatstring

STRING(80);

(* Format string *)

PARAMETER_P

: DINT;

(* Address of a structure *)

END_VAR

The trace function can be very useful when debugging dynamic processes.
Each trace can be purposefully enabled or disabled in the diagnostics
monitor. For this a number to identify the trace is issued when the trace
function is called. The trace numbers idx100 ... 200 are reserved for the PLC,
all others are reserved for the NC computer.

The trace buffer in the NC computer holds 512 trace messages. If the trace
messages arrive quicker in the buffer than they can be sent via the
diagnostics interface (RS232), the buffer can overrun and the messages may
be lost.

The return value of the function is of no consequence.

TYPE PARAMETER_TR

STRUCT

param1_r

: REAL;

param2_di

: DINT;

END_STRUCT

END_TYPE

param_tr:

PARAMETER_TR;

parameter_tr.param1_r

: = 30.2

parameter_tr.param2_di : = 20;

TRACE(100, ’REAL:%f DINT:%d’, ADR(param_tr));

Declaration

Description

Declaration

Description

Example