變頻試驗臺直線運動結(jié)構(gòu)及基于S7-200速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計【說明書+CAD】
變頻試驗臺直線運動結(jié)構(gòu)及基于S7-200速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計【說明書+CAD】,說明書+CAD,變頻試驗臺直線運動結(jié)構(gòu)及基于S7-200速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計【說明書+CAD】,變頻,試驗臺,直線運動,結(jié)構(gòu),基于,s7,速度,系統(tǒng),控制,節(jié)制,軟件,上位,監(jiān)控,設(shè)計
主程序:
Network 1 // 網(wǎng)絡(luò)標(biāo)題
// 初始化
LD SM0.1
CALL SBR0
Network 2
// 發(fā)送公共部分
LD SM0.1
MOVB 16, VB100
MOVB 16#05, VB101
MOVB 16#30, VB102
MOVB 16#31, VB103
MOVB 16#57, VB104
Network 3
// 發(fā)送寫好的協(xié)議
LD M0.0
CALL SBR2
Network 4
LD M0.1
CALL SBR3
Network 5
LD M0.2
CALL SBR7
Network 6
LD M0.3
CALL SBR4
Network 7
LD M0.4
CALL SBR8
Network 8
LD M0.5
CALL SBR6
Network 9
LD M0.6
CALL SBR5
Network 10
// 將輸入的電壓整數(shù)轉(zhuǎn)換成是實數(shù),并轉(zhuǎn)化成頻率值
LD SM0.0
CALL SBR9, AIW0, 32000, 0, 50.0, 0.0, VD117
Network 11
LD SM0.0
ROUND VD117, VD211
DTI VD211, VW215
Network 12
LD SM0.0
MOVW +100, VW217
*I VW215, VW217
Network 13
LD SM0.0
HTA VB217, VB219, 2
Network 14 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD M3.0
EU
MOVD &VB1100, VD1008
Network 15
LD M3.0
CALL SBR10
Network 16
LD M3.0
A SM0.5
EU
LD M3.0
EU
CTU C1, 32000
Network 17
LD M3.0
ED
MOVW C1, VW400
Network 18
LD M9.0
EU
MOVD &VB1095, VD1008
Network 19
LD M9.0
A SM0.5
EU
S M3.1, 1
Network 20
LD M3.2
TON T37, 5
A T37
CALL SBR13
Network 21
Network 22
LD M3.1
LPS
EU
+D 5, VD1008
LPP
CALL SBR14
Network 23
Network 24
LD M9.1
CALL SBR12
R M9.1, 1
Network 25
LD M9.0
A SM0.5
EU
LD M9.0
EU
CTD C3, VW400
Network 26
LD M9.0
AW= C3, 0
CALL SBR12
R M9.0, 1
初始化:
Network 1
LD SM0.0
MOVB 16#09, SMB130
MOVB 16#4B, SMB189
MOVW +0, SMW190
MOVW +2000, SMW192
MOVB 255, SMB194
FILL 0, MW0, 15
ATCH INT0, 26
ENI
發(fā)送子程序:
TITLE=
Network 1
LD SM0.0
R SM187.7, 1
S M11.0, 1
Network 2
// VB1700
LD SM4.6
XMT VB100, 1
R M0.0, 8
CRET
允許寫入子程序:
Network 1 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 16#30, VB105
MOVB 16#30, VB106
MOVB 16#30, VB107
MOVB 16#34, VB108
MOVB 16#31, VB109
MOVB 16#30, VB110
MOVB 16#30, VB111
MOVB 16#30, VB112
MOVB 16#31, VB113
MOVB 16#36, VB114
MOVB 16#45, VB115
MOVB 16#04, VB116
Network 2
LD SM0.0
CALL SBR1
Network 3
LD SM0.0
R V105.0, 96
給定頻率子程序:
Network 1 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 16#30, VB105
MOVB 16#30, VB106
MOVB 16#30, VB107
MOVB 16#35, VB108
MOVB 16#31, VB109
MOVB 16#30, VB110
MOVB 16#33, VB111
MOVB 16#45, VB112
MOVB 16#38, VB113
MOVB 16#38, VB114
MOVB 16#45, VB115
MOVB 16#04, VB116
Network 2
LD SM0.0
CALL SBR1
Network 3
LD SM0.0
R V105.0, 96
正向子程序:
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 16#30, VB105
MOVB 16#30, VB106
MOVB 16#30, VB107
MOVB 16#36, VB108
MOVB 16#31, VB109
MOVB 16#30, VB110
MOVB 16#30, VB111
MOVB 16#30, VB112
MOVB 16#32, VB113
MOVB 16#37, VB114
MOVB 16#31, VB115
MOVB 16#04, VB116
Network 2 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
CALL SBR1
Network 3
LD SM0.0
R V105.0, 96
停止子程序:
Network 1 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 16#30, VB105
MOVB 16#30, VB106
MOVB 16#30, VB107
MOVB 16#36, VB108
MOVB 16#31, VB109
MOVB 16#30, VB110
MOVB 16#30, VB111
MOVB 16#30, VB112
MOVB 16#30, VB113
MOVB 16#36, VB114
MOVB 16#46, VB115
MOVB 16#04, VB116
Network 2
LD SM0.0
CALL SBR1
Network 3
LD SM0.0
R V105.0, 96
反向子程序:
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 16#30, VB105
MOVB 16#30, VB106
MOVB 16#30, VB107
MOVB 16#36, VB108
MOVB 16#31, VB109
MOVB 16#30, VB110
MOVB 16#30, VB111
MOVB 16#34, VB112
MOVB 16#30, VB113
MOVB 16#37, VB114
MOVB 16#33, VB115
MOVB 16#04, VB116
Network 2 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
CALL SBR1
Network 3
LD SM0.0
R V105.0, 96
加速子程序:
Network 1 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 16#30, VB105
MOVB 16#30, VB106
MOVB 16#30, VB107
MOVB 16#37, VB108
MOVB 16#31, VB109
MOVB 16#30, VB110
MOVB 16#30, VB111
MOVB 16#33, VB112
MOVB 16#32, VB113
MOVB 16#37, VB114
MOVB 16#35, VB115
MOVB 16#04, VB116
Network 2 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
CALL SBR1
Network 3
LD SM0.0
R V105.0, 96
減速子程序:
Network 1 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 16#30, VB105
MOVB 16#30, VB106
MOVB 16#30, VB107
MOVB 16#38, VB108
MOVB 16#31, VB109
MOVB 16#30, VB110
MOVB 16#30, VB111
MOVB 16#33, VB112
MOVB 16#32, VB113
MOVB 16#37, VB114
MOVB 16#36, VB115
MOVB 16#04, VB116
Network 2 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
CALL SBR1
Network 3
LD SM0.0
R V105.0, 96
數(shù)值轉(zhuǎn)換子程序:
Network 1 // Scaling routine
// The formula is as follows:
// Ov = [(Osh - Osl) * (Iv - Isl) / (Ish - Isl)] + Osl
//
// Ov = scaled output value
// Iv = analog input value
// Osh = high limit of the scale for the scaled output value
// Osl = low limit of the scale for the scaled output value
// Ish = high limit of the scale for the analog input value
// Isl = low limit of the scale for the analog input value
//
Network 2
LD SM0.0
-R LD10, LD6
-I LW4, LW0
ITD LW0, LD22
DTR LD22, LD18
*R LD18, LD6
-I LW4, LW2
ITD LW2, LD22
DTR LD22, LD18
/R LD18, LD6
+R LD10, LD6
MOVR LD6, LD14
數(shù)據(jù)存儲子程序:
Network 1
LD I1.0
AN M2.1
= M2.0
Network 2
LD I1.1
AN M2.0
= M2.1
Network 3
LD M2.0
= Q1.0
Network 4
LD M2.1
= Q0.7
Network 5
LD SM0.0
R M2.2, 6
Network 6
LD SM0.5
EU
MOVD VD219, VD1000
MOVB MB2, VB1004
BMB VB1000, *VD1008, 5
+D 5, VD1008
結(jié)束在線模擬子程序:
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 0, *VD1024
CALL SBR13
發(fā)送方向子程序:
Network 1
Network 2 // 網(wǎng)絡(luò)標(biāo)題
LD M3.2
MOVD +4, VD1024
+D VD1008, VD1024
Network 3
LD SM0.0
LPS
AB= *VD1024, 0
CALL SBR5
LRD
AB= *VD1024, 1
CALL SBR4
LPP
AB= *VD1024, 2
CALL SBR6
發(fā)送頻率子程序:
Network 1 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD SM0.0
MOVB 16#30, VB105
MOVB 16#30, VB106
MOVB 16#30, VB107
MOVB 16#35, VB108
MOVB 16#31, VB109
BMB *VD1008, VB110, 4
BMB *VD1008, VB300, 4
MOVB VB300, VB310
MOVB VB301, VB312
MOVB VB302, VB314
MOVB VB303, VB316
Network 2
// 計算協(xié)議的SUM值
LD SM0.0
MOVW 16#01AE, VW200
+I VW309, VW200
MOVW VW200, VW202
+I VW311, VW202
MOVW VW202, VW204
+I VW313, VW204
MOVW VW204, VW206
+I VW315, VW206
Network 3
// 把協(xié)議轉(zhuǎn)換成AIISC碼,保留后兩個字節(jié)的AIISC碼進行發(fā)送
LD SM0.0
HTA VB206, VB208, 4
MOVB VB210, VB114
MOVB VB211, VB115
MOVB 16#04, VB116
Network 4
LD SM0.0
CALL SBR1
Network 5
LD SM0.0
R V105.0, 96
中斷:
Network 1
Network 2 // 網(wǎng)絡(luò)標(biāo)題
// 網(wǎng)絡(luò)注釋
LD M3.2
R M3.2, 1
Network 3
LD M3.1
R M3.1, 1
S M3.2, 1
收藏