EasyManuals Logo

Omron CX-PROGRAMMER V8.1 User Manual

Omron CX-PROGRAMMER V8.1
231 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #190 background imageLoading...
Page #190 background image
165
Statement Descriptions Section 5-5
Instance_FB(FB_IN1:=IN1,FB_IN2:=IN2,FB_IN3:=IN3,
FB_OUT1=>OUT1,FB_OUT3=>OUT3)
Different order of entry:
Instance_FB(EN:=A,FB_IN1:=IN1,FB_OUT1=> OUT1,FB_IN2:=IN2,
FB_OUT2=>OUT2,FB_IN3:= IN3,FB_OUT3=> OUT3,ENO=>B)
Example of Entry Method 2
In this example, only parameter variables (including constants) of a new
instance are entered.
Instance_FB(IN1, IN2, IN3, OUT1, OUT2, OUT3)
Instance_FB(IN1, IN2, IN3, OUT1)
The arguments and return values must be listed in a fixed order.
Input variable 1, Input variable 2, ..., Output variable 1, Output variable 2,
...
The input variables’ arguments must be at the beginning of the list, or just
after the EN variable if the EN variable is listed.
An output variable can be omitted if the data is not actually being used
and the output variable is not in the middle of the list of output variables.
Example: Instance_FB(IN1, IN2, IN3, OUT1, OUT3)
In this case, the OUT3 at the end of the list would return the value from
FB_OUT2.
The EN and ENO data cannot be entered as an argument or return value.
Specification method 1 cannot be used together with specification method
B in the same function block call statement.
Example 2
In the following example, function block 1 calls function block 2, which calcu-
late the average value by calling a function block from within a function block.
Function Block 1
Variable Table
FB1
Instance_FB1
FB1 (ST)
FB2 (ST)
average := ( input1 + input2 + input3 ) / 3 ;
Program
Average_FB( input1 := data1, input2 := data2,
input3 := data3, average => AVG );
The data1, data2, and data3 values are
passed to input1, input2, and input3.
The average value is
returned in AVG.
Avera
g
e_FB is an instance name with data t
yp
e FUNCTION BLOCK.
Variable type Variable name Data type Passage to/from FB2
Input variable EN BOOL ---
Input variable data1 INT Passed to input1
Input variable data2 INT Passed to input2
Input variable data3 INT Passed to input3
Input variable bCheck BOOL ---
Output variable ENO BOOL ---
Output variable AVG INT Received from average
Internal variable Average_FB FUNCTION BLOCK
Called function block definition:
Function block 2
---

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CX-PROGRAMMER V8.1 and is the answer not in the manual?

Omron CX-PROGRAMMER V8.1 Specifications

General IconGeneral
BrandOmron
ModelCX-PROGRAMMER V8.1
CategorySoftware
LanguageEnglish

Related product manuals