
Chapter 4. FUNCTION BLOCK
4 - 2
4.2.1 Module Initialization :
(G3F-AD4A: AD4INI, G4F-AD2A: AD2INI, G3F-AD4B: AD4BINI)
Module Initialization function block is a program for the use in setting base location number and the slot
location number of an A/D conversion module, specifying an available channel enable, a data type for
A/D conversion, filter processing data, and average processing data.
Function
block
I/O
Variable Data
type
Descriptions
REQ
BOOL
Function Block Execution Request Area
- The execution of function block initialization is requested in this area.
- If the status to be connected with this area is satisfied on the program operation and
input condition changes from low(0) to high(1), function block initialization for the
module is executed.
BASE
USINT
Base Location Number Area
- The base No. on which A/D conversion module is mounted is written on this area.
- Setting range : GM1 series( 0 to 31 ), GM2 series( 0 to 7), GM3/4 series( 0 to 3)
SLOT
USINT
Slot Location Number Area
- The slot No. on which A/D conversion module is mounted is written on this area.
- Setting range: 0 to 7
CH
BOOL
[Array]
*note1
Available Channel Specification Area
- Available channels are specified in this area.
- Enabled channels are specified to 1 and disabled channels are specified to 0.
IN_
SEL
*note3
BOOL
[Array]
Analog Input Type(current/voltage) Specification Area
- 0 is for the select of current input
- 1 is for the select of voltage input
DATA
TYPE
BOOL
[Array]
*note1
Output Data Type Specification Area
- Output digital data type for each channel is specified in this area.
- 0 is for the range of -192 to 16191. (G3F-AD4B: 0~16000)
- 1 is for the range of -8192 to 8191. (G3F-AD4B: -8000~8000)
FILT
_EN
BOOL
[Array]
*note2
Filter Processing Enable Specification Area
- 0 is for the sampling processing.
- 1 is for the filter processing.
FILT
_VAL
USINT
[Array]
*note2
Filter Constant Setting Area
- Setting range: 1 to 99
AVG_
EN
BOOL
[Array]
*note2
Average Processing Enable Specification Area
- 1 is for the average processing.
- 0 is for the sampling process.
AVG_
SEL
BOOL
[Array]
*note2
Average process Type Specification Area
- 1 is for the time average.
- 0 is for the numb er average.
Input
NUM/
TIME
USINT
[Array]
*note2
Average Number or Average Time Set Area
- The number or time is set in accordance with the average process type
specified on the AVG_SEL.
- Average number :2 to 4000 (count)
- Average time : G3F-AD4A/G3F-AD4B: 96 to12,000(ms), G4F-AD2A: 40 to 20,000(ms)
DONE
BOOL
Function Block Execution Complete Area
- When function block initialization is executed with no error, 1 is written and until next
execution, 1 is continuing. When error occurs, 0 is written and operation come to stop.
STAT
USINT
Error Code Display Area
- When error occurs during function block initialization, the error code number is written.
- Error code is referred to GM Section 1.4.
Output
ACT
BOOL
[Array]
*note1
Channel Operation Display Area
- The channel specified after executing the function block initialization with no error is
right, 1 is written and, on the non-specified channel, 0 is written.
REMARK
*note 1 : The number of array is G3F-AD4A of 16, G3F-AD4B of 16 and G4F-AD2A of 4 .
*note 2 : The number of array is G3F-AD4A of 4, G3F -AD4B of 16 and G4F-AD2A of 4 .
On the G3F-AD4A, the element number (0) is specified to channel 0, 1, 2, 3 in block,
the element number (1) is specified to channel 4, 5, 6, 7, in block.
the element number (2) is specified to channel 8, 9, 10, 11 in block.
the element number (3) is specified to channel 12, 13, 14, 15 in block.
On the G4F-AD2A, the element numbers means the channel ones.
*note 3 : Only on the G3F-AD4B, the number of array is 16, the element numbers means the channel ones.
4.2 Local Function Block
REQ
BASE
SLOT
CH
DATA
TYPE
AVG_
EN
AVG_
SEL
AD4INI
(AD2INI)
STAT
ACT
DONE
NUM/
TIME
FILT
_EN
FILT
_VAL
G3F-AD4A
(G4F-AD2A)
REQ
BASE
SLOT
CH
DATA
TYPE
AVG_
EN
AVG_
SEL
AD4BINI
STAT
ACT
DONE
NUM/
TIME
FILT
_EN
FILT
_VAL
G3F-AD4B
IN_
SEL