
6F3B0250
7. Instructions
FUN 165
FG
Function generator
Expression
Input
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 247
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net