2 function block for local, Remark – LG G4F-AD3A User Manual
Page 29
Chapter 4. FUNCTION BLOCK
4 - 2
4.2.1 Module Initialization
1) G3F-AD3A, G4F-AD3A
Module Initialization function block is used in a program with setting of A/D conversion module located
base number, slot number of located module on base, specifying a channel enable, analog input data
type and the information of average processing.
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 of condition connected with this area is changed 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 : 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[8]
Available Channel Specification Area
- Enabled channels are specified to 1 and disabled channels are specified to 0.
TYPE
BOOL[8]
Analog Input Data Type Specification Area
- Output digital data type for each channel is specified in this area.
- 0 is for the range of 1 ~ 5VDC and DC4 ~ 20mA.
- 1 is for the range of 0 ~ 10VDC
AVG_
EN
BOOL[8]
Enable / Disable of Average processing
- 0 is for the sampling processing.
- 1 is for the average processing of the number of times.
Input
AVG_
NUM
USINT
[8]
Set a constant of the average processing of the number of times.
- Setting range : 2 ~ 255
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.
Output
ACT
BOOL[8]
Channel Operation Display Area
- After execution the function block of initialization with no error, if the setting
condition of specified channel is normal then output ‘1’, or if abnormal, output 0’.
- No specified channel is ‘0’.-
REMARK
BOOL[8] and USINT[8] of data type means that the number of element is 8, and also this means the whole number of channels and channel
number.
4.2 Function Block for Local
REQ
BASE
SLOT
CH
TYPE
AVG_
EN
AVG_
NUM
AD3INI
STAT
ACT
DONE