2288 變頻試驗臺直線運動結(jié)構(gòu)及基于S7-200速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計
2288 變頻試驗臺直線運動結(jié)構(gòu)及基于S7-200速度示教系統(tǒng)控制軟件與上位監(jiān)控系統(tǒng)設(shè)計,變頻,試驗臺,直線運動,結(jié)構(gòu),基于,s7,速度,系統(tǒng),控制,節(jié)制,軟件,上位,監(jiān)控,設(shè)計
主程序:Network 1 // 網(wǎng)絡(luò)標題// 初始化LD SM0.1CALL SBR0Network 2 // 發(fā)送公共部分LD SM0.1MOVB 16, VB100MOVB 16#05, VB101MOVB 16#30, VB102MOVB 16#31, VB103MOVB 16#57, VB104Network 3 // 發(fā)送寫好的協(xié)議LD M0.0CALL SBR2Network 4 LD M0.1CALL SBR3Network 5 LD M0.2CALL SBR7Network 6 LD M0.3CALL SBR4Network 7 LD M0.4CALL SBR8Network 8 LD M0.5CALL SBR6Network 9 LD M0.6CALL SBR5Network 10 // 將輸入的電壓整數(shù)轉(zhuǎn)換成是實數(shù),并轉(zhuǎn)化成頻率值LD SM0.0CALL SBR9, AIW0, 32000, 0, 50.0, 0.0, VD117Network 11 LD SM0.0ROUND VD117, VD211DTI VD211, VW215Network 12 LD SM0.0MOVW +100, VW217*I VW215, VW217Network 13 LD SM0.0HTA VB217, VB219, 2Network 14 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD M3.0EUMOVD &VB1100, VD1008Network 15 LD M3.0CALL SBR10Network 16 LD M3.0A SM0.5EULD M3.0EUCTU C1, 32000Network 17 LD M3.0EDMOVW C1, VW400Network 18 LD M9.0EUMOVD &VB1095, VD1008Network 19 LD M9.0A SM0.5EUS M3.1, 1Network 20 LD M3.2TON T37, 5A T37CALL SBR13Network 21 Network 22 LD M3.1LPSEU+D 5, VD1008LPPCALL SBR14Network 23 Network 24 LD M9.1CALL SBR12R M9.1, 1Network 25 LD M9.0A SM0.5EULD M9.0EUCTD C3, VW400Network 26 LD M9.0AW= C3, 0CALL SBR12R M9.0, 1初始化:Network 1 LD SM0.0MOVB 16#09, SMB130MOVB 16#4B, SMB189MOVW +0, SMW190MOVW +2000, SMW192MOVB 255, SMB194FILL 0, MW0, 15ATCH INT0, 26ENI發(fā)送子程序:TITLE=Network 1 LD SM0.0R SM187.7, 1S M11.0, 1Network 2 // VB1700LD SM4.6XMT VB100, 1R M0.0, 8CRET允許寫入子程序:Network 1 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#34, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#30, VB112MOVB 16#31, VB113MOVB 16#36, VB114MOVB 16#45, VB115MOVB 16#04, VB116Network 2 LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96給定頻率子程序:Network 1 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#35, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#33, VB111MOVB 16#45, VB112MOVB 16#38, VB113MOVB 16#38, VB114MOVB 16#45, VB115MOVB 16#04, VB116Network 2 LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96正向子程序:// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#36, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#30, VB112MOVB 16#32, VB113MOVB 16#37, VB114MOVB 16#31, VB115MOVB 16#04, VB116Network 2 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96停止子程序:Network 1 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#36, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#30, VB112MOVB 16#30, VB113MOVB 16#36, VB114MOVB 16#46, VB115MOVB 16#04, VB116Network 2 LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96反向子程序:// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#36, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#34, VB112MOVB 16#30, VB113MOVB 16#37, VB114MOVB 16#33, VB115MOVB 16#04, VB116Network 2 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96加速子程序:Network 1 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#37, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#33, VB112MOVB 16#32, VB113MOVB 16#37, VB114MOVB 16#35, VB115MOVB 16#04, VB116Network 2 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0CALL SBR1Network 3 LD SM0.0R V105.0, 96減速子程序:Network 1 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#38, VB108MOVB 16#31, VB109MOVB 16#30, VB110MOVB 16#30, VB111MOVB 16#33, VB112MOVB 16#32, VB113MOVB 16#37, VB114MOVB 16#36, VB115MOVB 16#04, VB116Network 2 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0CALL SBR1Network 3 LD SM0.0R 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, LW0ITD LW0, LD22DTR LD22, LD18*R LD18, LD6-I LW4, LW2ITD LW2, LD22DTR LD22, LD18/R LD18, LD6+R LD10, LD6MOVR LD6, LD14數(shù)據(jù)存儲子程序:Network 1 LD I1.0AN M2.1= M2.0Network 2 LD I1.1AN M2.0= M2.1Network 3 LD M2.0= Q1.0Network 4 LD M2.1= Q0.7Network 5 LD SM0.0R M2.2, 6Network 6 LD SM0.5EUMOVD VD219, VD1000MOVB MB2, VB1004BMB VB1000, *VD1008, 5+D 5, VD1008結(jié)束在線模擬子程序:// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 0, *VD1024CALL SBR13發(fā)送方向子程序:Network 1 Network 2 // 網(wǎng)絡(luò)標題LD M3.2MOVD +4, VD1024+D VD1008, VD1024Network 3 LD SM0.0LPSAB= *VD1024, 0CALL SBR5LRDAB= *VD1024, 1CALL SBR4LPPAB= *VD1024, 2CALL SBR6發(fā)送頻率子程序:Network 1 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD SM0.0MOVB 16#30, VB105MOVB 16#30, VB106MOVB 16#30, VB107MOVB 16#35, VB108MOVB 16#31, VB109BMB *VD1008, VB110, 4BMB *VD1008, VB300, 4MOVB VB300, VB310MOVB VB301, VB312MOVB VB302, VB314MOVB VB303, VB316Network 2 // 計算協(xié)議的 SUM 值LD SM0.0MOVW 16#01AE, VW200+I VW309, VW200MOVW VW200, VW202+I VW311, VW202MOVW VW202, VW204+I VW313, VW204MOVW VW204, VW206+I VW315, VW206Network 3 // 把協(xié)議轉(zhuǎn)換成 AIISC 碼,保留后兩個字節(jié)的 AIISC 碼進行發(fā)送LD SM0.0HTA VB206, VB208, 4MOVB VB210, VB114MOVB VB211, VB115MOVB 16#04, VB116Network 4 LD SM0.0CALL SBR1Network 5 LD SM0.0R V105.0, 96中斷:Network 1 Network 2 // 網(wǎng)絡(luò)標題// 網(wǎng)絡(luò)注釋LD M3.2R M3.2, 1Network 3 LD M3.1R M3.1, 1S M3.2, 1
收藏