6F3B0253

7. Instructions

FUN 165

FG

Function generator

Expression

Input [ A FG (n) B C ]Output

Function

When the input is ON, this instruction finds the function value f(x) for A as x, and stores it in C. The function f(x) is defined by the parameters stored in 2 n registers starting with B.

Execution condition

Input

 

Operation

Output

OFF

No execution

 

OFF

ON

Execution

 

ON

Operand

 

Name

 

 

Device

 

 

 

 

 

 

 

 

 

Register

 

 

 

 

 

Constant

Index

 

 

X

Y

R

S

T.

C.

XW

YW

RW

SW

T

C

D

I

 

J

K

 

 

A

Input value x

 

 

 

 

 

 

 

 

 

 

 

n

Parameter size

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 - 32

 

B

Start of

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

parameters

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

Function value

 

 

 

 

 

 

 

 

 

 

 

 

 

 

f(x)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Example

When R010 is ON, the FG instruction finds the function value f(x) for x = XW004, and stores the result in D0100.

The function f(x) is defined by 2 4 = 8 parameters stored in D0600 to D0607. In this example, these parameters are set at the first scan.

Basic Hardware and Function 229

Page 231
Image 231
Toshiba 6F3B0253 user manual FUN Function generator