Advanced Function Instruction
7 -7 8
FUN 93
P
HSCTW
HARDWARE HIGH SPEED COUNTER CURRENT VALUE AND PRESET
VALUE WRITING
FUN 93
P
HSCTW
S : The source data for writing
CN : Hardware high speed counter to be written
0: HSC0 or HST1
1: HSC1 or HST2
2: HSC2 or HST3
3: HSC3 or HST4
4: HSTA
D : Write target (0 represents CV, 1 represents PV)
z
Please refer first to FUN92 for the relation between the CV or PV value of HSC0
~
HSC3 and HSTA within
ASIC and their corresponding CV and PV registers in CPU.
z
When write control “EN”=1 or “EN
↑
” (
P
instruction) changes from 0
→
1, it writes the content of CV or PV
register of high speed counter designed by CN of CPU, to the corresponding CV or PV of HSC within ASIC.
z
It is quit often to set the PV value for most application program, When the count value reaches the preset
value, the counter will send out interrupt signal immediately. By way of the interrupt service program, you can
implement different kinds of precision counting or positioning control.
z
When there is an interrupt of power supply for FBs-PLC, the values of current value registers CV of HSC0
~
HSC3 within ASIC will be read out and wrote into the HSC0
~
HSC3 CV registers (with power retentive
function) of CPU automatically. When power comes up, these CV values will be restored to ASIC. However,
if your application demands that when power is on, the values should be cleared to 0 or begin counting from a
certain value, then you have to use this instruction to write in the CV value for HSC in ASIC.
z
When write a non-zero value into the PV register of HSTA will cause the HSTAI interrupt subroutine to be
executed for every PV
×
0.1ms.
z
For detailed applications, please refer Chapter 10 “The high speed counter and high speed timer of
FBs-PLC”.
EN S :
D :
EN
EN
D :
S :
M1
M0
M0
93D.HSCTW
92
93D.HSCTW
CN :
HSC0
CV
0
HSC0
HSCTR
CN :
R500
HSC0
PV
z
As the program in the left diagram, when M0 changes
from 0
→
1, it clears the current value of HSC0 to 0,
and writes into ASIC hardware through FUN93.
z
When M0 is 0, it reads out the current counting value.
z
When M1 changes from 0
→
1, it moves DR500 to
DR4098, and writes the preset value into ASIC
hardware through FUN93.
z
Whenever the current value equals to the DR500,
The HSC0I interrupt sub program will be executed.
Содержание FBs-CBE
Страница 78: ...MEMO ...
Страница 111: ...4 6 X0 X1 Node A Y0 Y1 Node B differential down Incerse differential up t Scan time Inverse t t ...
Страница 141: ...Basic Function Instruction 6 16 FUN 2 SKP SKIP START FUN 2 SKP Y2 Y1 Y0 T201 10S X0 X1 X2 0 10 0 ...
Страница 305: ...MEMO ...
Страница 348: ...MEMO ...