Appendix 3 GM Function Block Conversion Program
App3-1
1. Preset value setting Function Block
(1) Preset value setting Function Block of GN (HSCC-PRE)
- Preset value setting Function Block sets count start value of HSC module. To change Count, execute Enable Preset after
Preset value setting Function Block acts.
Function Block
type
Classific
ation
Variable
name
Type
Contents
REQ BOOL
FB execution
Executed when changing “0->1” ( : Rising edge)
BASE USINT
Base Number
Base number where HSC module is equipped
SLOT USINT
Slot Number
Slot number where HSC module is equipped
Ch0
0
CH BOOL
Channel
Ch1
1
Input
PSET
_VAL
DINT
Preset range
-2,147,483,648 ~ 2,147,483,647
DONE BOOL
Execution status
If it completes, it outputs 1 and holds. If error occurs, it
outputs 0
Output
STAT USINT
Error status
In case of error, outputs error code
(2) Preset value setting FB of XGI/XGR
Function Block
type
Classific
ation
Variable
name
Type
Contents
REQ BOOL
FB execution
Executed when changing “0->1” ( : Rising edge)
BASE USINT
Base Number
Base number where HSC module is equipped
SLOT USINT
Slot Number
Slot number where HSC module is equipped
Ch0
_F01_CH0_PRESET 02
MADDR USINT
Channel
Ch1
_F01_CH1PRESET 27
Input
PSET
_VAL
DWORD
Preset range
-2,147,483,648 ~ 2,147,483,647
DONE BOOL
Execution status
If it completes, it outputs 1 and holds. If error occurs, it
outputs 0
Output
STAT USINT
Error status
In case of error, outputs error code
Remark
(1) Input variable ‘MADDR’ of XGI/XGR FB indicates internal memory. Constant or Global variable is inputted. If we refer to
above example, “_F01_CH0_PRESET” is Global constant indicating “02”. Namely, if you input “02” at “MADDR”, result of
XGI/XGR FB is same.
(2) If you use “PUT_DINT” instead of “PUT_DWORD”, preset action is same. At this time, data type of input variable “DATA”
becomes DINT.
(3) Not Preset value setting FB (HSCC_PRE) but also Mode setting function (HSCC_NOD), Auxiliary function setting function
(HSCC_AUX), Comparison setting function (HSCC_CMP), Count read function (HSCC_CNT), Operation information setting
function (HSCC_WR), Operation status read function (HSCC_RD), Comparison output setting function (HSCC_OUT) apply
to (1), (2).
(4) When writing conversion program, if input enters REQ and next input is connected with DONE, execution status of
previous instruction should complete to be used as input of next instruction. If it is error status, it doesn’t operate.
(5) In case of XGR CPU, HSC module should be equipped at extension base.
Appendix 3 GM Function Block Conversion Program
Summary of Contents for XGF-HD2A
Page 56: ...Chapter 4 Operation Procedures and Monitoring 4 12 ...
Page 59: ...Chapter 4 Operation Procedures and Monitoring 4 15 ...
Page 90: ...Chapter 7 Program 7 24 b Scan program of XGI XGR series ...
Page 127: ...Appendix 3 GM Function Block Conversion Program App3 20 e Auxiliary Function Operating ...