beautypg.com

Discrete i/o configuration window, Configured, Discrete i/o configuration – Delta RMC151 User Manual

Page 260

background image

RMC70/150 and RMCTools User Manual

Exporting User Functions

1. Right-click in the function list pane and choose Export User Functions.
2. Choose the functions to export, then click OK.
3. Browse to the desired location, enter a filename, then click Save.

Calling User Functions

To insert a user function into an expression:

1. Begin typing the name of the function and choose the function from the pop-up list.

Or, browse for the function on the Function tab of the Expression Editor and double-

click it.

2. Type an opening parenthesis. A pop-up window will open, listing the required

parameters for your convenience.

3. Make sure to enter all required parameters, separated with a comma.
4. Type a closing parenthesis.

Using the Function's Return Value
Typically, when calling a user function, the function's return value is assigned to some

register. For example, the return value of the user function

inch2mm

is assigned to the

variable

MyPos

here:

MyPos

:=

inch2mm

(

_Axis[0].ActPos

);

A user function can also be called without assigning the function's result to a register.

This is useful when the function has output parameters. For example, consider the

following user function that converts polar coordinates (radius and angle) to cartesian

coordinates (x and y). The function has two input parameters and two output

parameters:

BOOL Polar2Cart( [in] REAL radius, [in] REAL angle, [out] REAL x, [out] REAL y)

This user function can be used in an expression as follows:

Polar2Cart

(

MyRadius

,

MyAngle

,

MyX

,

MyY

);

Limitations
The following limitations apply to calling user functions:

Any Output and Input/Output type parameters can only be step-local variables or

variables in the Variable Table. They cannot be system tags. If the result of the

function must go to a system tag, you can use a variable for the Output parameter,

then use a separate expression to assign the variable value to the system tag.

4.11.7. Discrete I/O Configuration Window

To access this editor:

In the Project pane, expand Programming. Double-click Discrete I/O.

Use this window to configure Discrete I/O on the RMC. This topic describes the columns in the

Discrete I/O Configuration window. For instructions on how to configure the Discrete I/O, see

the Configuring Discrete IO topic.

Columns

Column

Name

Description

First

Displays the address of the I/O point. This address can be used to

240

Delta Computer Systems, Inc.

This manual is related to the following products: