3 calling a user function – Yaskawa MP900 Series Ladder Programming Manual User Manual

Page 53

Advertising
background image

4.3 User Functions

4.3.3 Calling a User Function

4-12

4.3.3 Calling a User Function

You can call a user function by using a FUNC instruction in the ladder drawing.
This section describes how to call the user function that was created in the previous section from the high-speed draw-
ing (DWG.H).

„

Example for Calling the FUNC01 User Function from DWG.H

Program a FUNC instruction in DWG.H as shown below.

This diagram shows a conceptual image of what the programming shown above accomplishes.

In this example, when DW00000 in DWG.H is set to 10, DW00001 becomes 20 and DW00002 becomes 30, demon-
strating that the user function was called correctly.

Input defined in
the user function

Output defined in
the user function

Program number of
the user function to call

XB000000 to XB00000F

XW00001

XW00002

XW00016

YB000000 to YB00000F

YW00003

YW00016

X Registers

(Function Input Registers)

Y Registers

(Function Output Registers)

Registers within the FUNC01 User Function

DW00001

Values that are set

Undefined values

DW00002

YW00001

YW00002

DW00000

×2

×3

IN

OUT1

OUT2

Advertising
This manual is related to the following products: