beautypg.com

Fndefine, fnparam and fncall functions, 4 f o rm ulas – HEIDENHAIN ND 2100G User Manual

Page 238

background image

238

2 Installation and Specifications

2.4 F

o

rm

ulas

FnDefine, FnParam and FnCall functions

A custom ND 2100G function is a collection of formula operations that
perform a specific task and is relatively independent of other formula
operations. Calling a custom function in a formula returns a value
calculated by the function.

Advantages to creating custom functions include:

„

Reducing the duplication of formula operations in a part program

„

Reuse of formula operations in multiple part program locations

„

Compressing complex operations into short, simple statements that
improve readability

ND 2100G custom functions always include:

„

A collection of formula operations to be executed when the function
is called

ND 2100G custom functions can also include:

„

Parameters that are passed to the function and will be used in the
calculation of the returned value

Custom functions are created using FnDefine. Custom functions that
are passed parameters also use FnParam. Functions are executed
when FnCall is included in a formula. Functions can be defined with or
without input parameters and return the result of the included formula
operations.

Functions must be defined on hidden dimension formula lines, but can
be called from hidden or visible dimension formulas.

Defining and calling custom functions

To insert the define or call a custom function:

U

Press the OTHER... soft key

U

Press the XTRA dimension key

U

Use the arrow cursor keys to highlight FnDefine or FnCall

U

Press the ENTER key

FnDefine function.

FnCall function.

FnDefine function syntax

Hn = DefFn#(action 1, action 2, …action n)
Actions are combinations of ND 2100G formula operations.

FnCall function syntax

A = Fn#(param1, param2, …param n)
Parameters are passed to the function and used to calculate the
result.