发表于:2006/2/28 15:18:00
#0楼
[size=3][size=2]我现在想用FM353精确的发出单个的脉冲,到底怎么用定时器来实现,比如我如果给10Hz的速度,如果用定时器定时1S,就发出10个脉冲,下面是我的主程序,不能达到我所说的那样,请哪位高手给我指点一下。
L B#16#2
L "DB_FM".MODE_IN
==I
JC JOG
JU END
JOG: A I 0.6
JC STP
A I 0.5
JC S2
SET
= "DB_FM".RESET_AX
S "DB_FM".CLEV_EN // Transfer velocity levels
CLR
= "DB_FM".DIR_M
= "DB_FM".DIR_P
L L#0
T "DB_FM".CLEVEL_1
T "DB_FM".CLEVEL_2
JU END
S2: L L#200 // Entry of default values
T "DB_FM".CLEVEL_2 // Value for velocity level 1
S "DB_FM".CLEV_EN // Transfer velocity levels
L B#16#2
T "DB_FM".MODE_TYPE
SET
= "DBEX".EX1.DIR_P
CLR
= "DBEX".EX1.DIR_M
A "DBEX".EX1.DIR_M // Travel - command
= "DB_FM".DIR_M
A "DBEX".EX1.DIR_P // Travel + command
= "DB_FM".DIR_P
JU END
STP: L L#0 // Entry of default values
T "DB_FM".CLEVEL_2 // Value for velocity level 1
S "DB_FM".CLEV_EN // Transfer velocity levels
L B#16#2
T "DB_FM".MODE_TYPE
SET
= "DBEX".EX1.DIR_P
CLR
= "DBEX".EX1.DIR_M
A "DBEX".EX1.DIR_M // Travel - command
= "DB_FM".DIR_M
A "DBEX".EX1.DIR_P // Travel + command
= "DB_FM".DIR_P
A I 0.4
JCN END
A I 0.4
L S5T#1S
SD T 0
L L#10 // Entry of default values
T "DB_FM".CLEVEL_2 // Value for velocity level 1
S "DB_FM".CLEV_EN // Transfer velocity levels
L B#16#2
T "DB_FM".MODE_TYPE
SET
= "DBEX".EX1.DIR_P
CLR
= "DBEX".EX1.DIR_M
A "DBEX".EX1.DIR_P // Travel + command
= "DB_FM".DIR_P
A "DBEX".EX1.DIR_M // Travel - command
= "DB_FM".DIR_M
A T 0
R "DB_FM".DIR_P
L B#16#2
L "DB_FM".MODE_IN
==I
JC JOG
JU END
JOG: A I 0.6
JC STP
A I 0.5
JC S2
SET
= "DB_FM".RESET_AX
S "DB_FM".CLEV_EN // Transfer velocity levels
CLR
= "DB_FM".DIR_M
= "DB_FM".DIR_P
L L#0
T "DB_FM".CLEVEL_1
T "DB_FM".CLEVEL_2
JU END
S2: L L#200 // Entry of default values
T "DB_FM".CLEVEL_2 // Value for velocity level 1
S "DB_FM".CLEV_EN // Transfer velocity levels
L B#16#2
T "DB_FM".MODE_TYPE
SET
= "DBEX".EX1.DIR_P
CLR
= "DBEX".EX1.DIR_M
A "DBEX".EX1.DIR_M // Travel - command
= "DB_FM".DIR_M
A "DBEX".EX1.DIR_P // Travel + command
= "DB_FM".DIR_P
JU END
STP: L L#0 // Entry of default values
T "DB_FM".CLEVEL_2 // Value for velocity level 1
S "DB_FM".CLEV_EN // Transfer velocity levels
L B#16#2
T "DB_FM".MODE_TYPE
SET
= "DBEX".EX1.DIR_P
CLR
= "DBEX".EX1.DIR_M
A "DBEX".EX1.DIR_M // Travel - command
= "DB_FM".DIR_M
A "DBEX".EX1.DIR_P // Travel + command
= "DB_FM".DIR_P
A I 0.4
JCN END
A I 0.4
L S5T#1S
SD T 0
L L#10 // Entry of default values
T "DB_FM".CLEVEL_2 // Value for velocity level 1
S "DB_FM".CLEV_EN // Transfer velocity levels
L B#16#2
T "DB_FM".MODE_TYPE
SET
= "DBEX".EX1.DIR_P
CLR
= "DBEX".EX1.DIR_M
A "DBEX".EX1.DIR_P // Travel + command
= "DB_FM".DIR_P
A "DBEX".EX1.DIR_M // Travel - command
= "DB_FM".DIR_M
A T 0
R "DB_FM".DIR_P