Kulicke&Soffa 00780-4400-000缺點(diǎn)是要多占用兩字節(jié)的內(nèi)存,以后程序中不能使用VW0。但S7-200的RAM空間很大,一般是用不完的,以226為例,有多達(dá)10K的RAM,偶從來(lái)沒(méi)有超過(guò)1K。這些RAM都是花錢(qián)買(mǎi)來(lái)的,不用白不用,不用也是浪費(fèi)了。
Kulicke&Soffa 00780-4400-000同理,如果有字節(jié)型變量經(jīng)常需要與字類(lèi)型變量相互轉(zhuǎn)換,讓字節(jié)變量占用一個(gè)字的內(nèi)存寬度浪費(fèi)一個(gè)字節(jié),避免類(lèi)型轉(zhuǎn)換。
關(guān)于第3點(diǎn)"使用SET指令只執(zhí)行一次即可,不必每次掃描都執(zhí)行這個(gè)指令,有些工程人員忽視了這個(gè)問(wèn)題,使用了常規(guī)的方法來(lái)驅(qū)動(dòng)SET指令,無(wú)意中增加了PLC程序掃描運(yùn)行時(shí)間"
不是很理解,能不能說(shuō)得細(xì)一點(diǎn)
1:如果在ob里編寫(xiě)子程序段,是掃描的,但是如果您編寫(xiě)為FC調(diào)用,那么在FC的調(diào)用條件沒(méi)有滿(mǎn)足時(shí),F(xiàn)C中的程序暫時(shí)不執(zhí)行。這也是我所說(shuō)節(jié)省時(shí)間的意思。
2:PLC的執(zhí)行步數(shù)根據(jù)程序長(zhǎng)短會(huì)不同,掃描時(shí)間會(huì)根據(jù)執(zhí)行步數(shù)的不同而不同,如果用一個(gè)mov指令完成8個(gè)數(shù)字量輸出的控制,當(dāng)然比用8個(gè)mov指令完成8個(gè)數(shù)字量輸出的控制所需要的程序步數(shù)少。
添加一個(gè):
Kulicke&Soffa 00780-4400-000避免了類(lèi)型轉(zhuǎn)換,方法如下:
以S7-200為例,它的內(nèi)存格式與我們常用的PC機(jī)正好相反,它是高字在前,低字在后的。所以我們可以將字變量放在后兩個(gè)字節(jié),在程序初始化時(shí)將前兩個(gè)字節(jié)清零(程序的其它地方不得使用這兩個(gè)字節(jié))。
如我們定義符號(hào)時(shí)將字變量定義在VW2,同時(shí)保持VW0的值為零。則程序中可以用VW2以字型訪問(wèn)該變量,同時(shí)也可以VD0以雙字型訪問(wèn),避免了類(lèi)型轉(zhuǎn)換。
為了避免使用時(shí)混淆,最好以明確的符號(hào)定義來(lái)區(qū)分字類(lèi)型和雙字類(lèi)型。在此強(qiáng)烈推薦類(lèi)匈牙利命名法:以前綴指示變量類(lèi)型,用首字母大寫(xiě)的有意義的英文單詞的組合作變量名。本人習(xí)慣用以下綴:
b----字節(jié)型變量(byte)
w----字型變量(word)
d----雙字變量(double)
r----實(shí)型變量(real)
f----位變量(flag)
btn---自復(fù)位按鈕式輸入(button)
sw----切換開(kāi)關(guān)或自鎖按鈕輸入(switch)
sig---傳感器、編碼等電平信號(hào)輸入(signal)
rly---輸出繼電器位(relay)
……
當(dāng)然,這個(gè)根據(jù)個(gè)人習(xí)慣來(lái),沒(méi)有定則,主要是利于自己區(qū)分。
假如有一個(gè)字類(lèi)型變量名為VarName,為使用前面的轉(zhuǎn)換技巧,我們可以這樣定義:
wVarName----VW2
dVarName----VD0
Kulicke&Soffa 00780-4400-000在程序初始化時(shí)將VW0清零(如果是不需要記憶的變量,直接將dVarName清零也可)或者在數(shù)據(jù)塊中將VW0設(shè)置為零。則以后需要以字類(lèi)型訪問(wèn)變量時(shí)就用wVarName,需要以雙字類(lèi)型訪問(wèn)變量時(shí)就用dVarName。完全不需要類(lèi)型轉(zhuǎn)換。
本方法可以極大的減少程序語(yǔ)句數(shù),使程序更簡(jiǎn)潔、可讀性更好,由于不需要做耗時(shí)的類(lèi)型轉(zhuǎn)換,程序運(yùn)行效率也得到提高。且數(shù)學(xué)運(yùn)算量越大,效率提高越明顯。
缺點(diǎn)是要多占用兩字節(jié)的內(nèi)存,以后程序中不能使用VW0。但S7-200的RAM空間很大,一般是用不完的,以226為例,有多達(dá)10K的RAM,偶從來(lái)沒(méi)有超過(guò)1K。這些RAM都是花錢(qián)買(mǎi)來(lái)的,不用白不用,不用也是浪費(fèi)了。
Kulicke&Soffa 00780-4400-000同理,如果有字節(jié)型變量經(jīng)常需要與字類(lèi)型變量相互轉(zhuǎn)換,讓字節(jié)變量占用一個(gè)字的內(nèi)存寬度浪費(fèi)一個(gè)字節(jié),避免類(lèi)型轉(zhuǎn)換。
以上就是提高PLC運(yùn)行速度的編程方法。
----商務(wù)熱線---廈門(mén)興銳達(dá)自動(dòng)化設(shè)備有限公司
聯(lián)系人:王文光
++QQ:2851759104
手機(jī):15359273780
電話(huà):0592-5580707 400-855-5103轉(zhuǎn)001
傳真:0592-5361289
郵箱:2851759103@qq.com
網(wǎng)址:http://www.xmxrdauto.com
Kulicke&Soffa 00780-4400-000
KULICKE&SOFFA 007759120000
KULICKE&SOFFA 075-00372-10
KULICKE&SOFFA 00860-1001-000-02
KULICKE&SOFFA 01483-4033-000-01
KULICKE&SOFFA 01483-4086-000-02
KULICKE&SOFFA 1482-4004-000-01
KULICKE&SOFFA 00835-4549-000-01
KULICKE&SOFFA 01474-4001-000-81
KULICKE&SOFFA 01482-4001-000-03
KULICKE&SOFFA 06150-4150-001-02
Kulicke&Soffa 00835-4547-000-02
Kulicke&Soffa 06150-4145-000-02
Kulicke&Soffa 06100-4100-000-61
KULICKE&SOFFA 06980-4020-000
KULICKE&SOFFA 01483-4014-000-07
KULICKE&SOFFA 01483-4029-000-02
KULICKE&SOFFA 835-4550-001
KULICKE&SOFFA 01483-4035-000-03
KULICKE&SOFFA 01483-4005-000-12
KULICKE&SOFFA 02010-4015-001-00
KULICKE&SOFFA 01483-4005-000-13
Kulicke&Soffa 01471-4000
KULICKE&SOFFA 06100-4011-000-01
KULICKE&SOFFA 01418-4050-001
KULICKE&SOFFA 06100-4805-000-01
KULICKE&SOFFA 00B35-4506-000
KULICKE&SOFFA 0210-4012-000-03
Kulicke&Soffa 00797-4235-001-02
Kulicke&Soffa 00835-4547-000-03
KULICKE&SOFFA 06100-4135-61
Kulicke&Soffa 06300-4541-000-10
Kulicke&Soffa 00797-4188-000-70
KULICKE&SOFFA 06100-4003-000
KULICKE&SOFFA 06150-4160-000-61R
KULICKE&SOFFA 06100-4125-000-61
KULICKE&SOFFA 00835-4550-000
KULICKE&SOFFA 00835-4530-001
KULICKE&SOFFA 1483-4029-000-14R
KULICKE&SOFFA 06100-4003-000
KULICKE&SOFFA 01483-4013-000-00
KULICKE&SOFFA 00860-1001-000-01
KULICKE&SOFFA 4590-44-1
KULICKE&SOFFA 01471-4000-000-62
KULICKE&SOFFA 06100-4330-000-60
Kulicke&Soffa 01482-4031-000-15
Kulicke&Soffa 02920-4130-000-21
Kulicke&Soffa 00797-4315-000-45
Kulicke&Soffa 06100-4100-000-60
KULICKE&SOFFA 01471-4000-000-41
KULICKE&SOFFA 0183-4029-000-14
Kulicke&Soffa 06100-4330-000-67
KULICKE&SOFFA 00835-4580-000-21
KULICKE&SOFFA 835-4502-000-02
KULICKE&SOFFA 05100-4200-000-08
KULICKE&SOFFA 00860-1000-000-02
KULICKE&SOFFA 860-1001-000-01
Kulicke&Soffa 00797-4315-000-44
KULICKE&SOFFA 01471-4000-000-38
KULICKE&SOFFA 01471-4000-000-20
KULICKE&SOFFA 01471-4000-000-16
KULICKE&SOFFA 01471-4001-000-71
KULICKE&SOFFA 0183-4029-000-08
KULICKE&SOFFA 04590-0044-000
KULICKE&SOFFA 06100-4025-000-60
Kulicke&Soffa 02920-4086-000-12
Kulicke&Soffa 1483-8027-000-02
Kulicke&Soffa 01482-4031-000-60
Kulicke&Soffa 01483-4014-000-62
KULICKE&SOFFA 01471-4000-000-19
Kulicke&Soffa 06100-4330-000-64
Kulicke&Soffa 01482-4001-000-06
KULICKE&SOFFA 835-4545-001-01
KULICKE&SOFFA 01474-4001-000-81
Kulicke&Soffa 01483-4033-000-20
Kulicke&Soffa 01488-4229-000-42
KULICKE&SOFFA 00860-1001-000-00
Kulicke&Soffa 01483-4033-000-03
Kulicke&Soffa 01471-4000-000-62
KULICKE&SOFFA 00835-4545-000-03
KULICKE&SOFFA 00797-4235-001-02
KULICKE&SOFFA 01474-4001-000-71
KULICKE&SOFFA 01471-4000-000-17
FISHER CP7202
FISHER CP7202X1-A1
FISHER 3610J
FISHER 40A0384C
FISHER 40A0389C
FISHER CD6201X1-EB2
FISHER DPR900X1-A5
FISHER 415002D1ARSB1000
FISHER CL7011X1-A2
FISHER 20088G4S33A3B4
FISHER 05-00002
FISHER 05-00003
FISHER 05-0002
FISHER 27501710102
FISHER 249B2502
FISHER 21008-815
FISHER 30A8595X022
FISHER 30B2787X032
FISHER 30B4113X01R
FISHER 30B6053X012
FISHER 30B8625X01R
FISHER 31B0955X02R
FISHER 34A8609X012
FISHER 36A2654X02R
FISHER 36A2654X05R
FISHER 36A3012X012-0
FISHER 36A3562
FISHER 36A4586X012
FISHER 36A4749X02R
FISHER 36A7633X022
FISHER 37A0346X012
FISHER 37A0401X032
FISHER 37A8986X01R
FISHER 38A1533X01R
FISHER 38A9426X02R
FISHER 38A9822-L5C
FISHER 39A0724X05R
FISHER 39A2990X11R
FISHER 39A5396X03R
FISHER 39A72665X12
FISHER 40A0386
FISHER 40B8624-SSB
FISHER 4100ZR
FISHER 42A5711X0A2
FISHER 42A5769X0A2
FISHER 43A1763X0A2
FISHER 43A1763X0AS
FISHER 43A6829X0A2
FISHER 46A2825X012
FISHER 46A3008-L54
FISHER 46A3562-L5C
FISHER 46A3909-L5F
FISHER 46A4589-L5J
FISHER 46A4748-L5D
FISHER 6003X1-FA1
FISHER CL6003
FISHER CL6003X1
FISHER CL6003X1-A3
FISHER CL6011X1-B1
FISHER CL6011X1-BA1
FISHER CL7002X1-A1
FISHER CL7004
FISHER CL7004X1
FISHER CL7004X1-A1
FISHER CL7005
FISHER CL7005X1-A1
FISHER CL7014-A1
FISHER CL7014X1-A1
FISHER CL7015X1-A1
FISHER CL7015X1-A3
FISHER CP6201
FISHER CP6211
FISHER 46A7632
FISHER 470
FISHER 47A4175
FISHER 47A8988-L5C
FISHER 47A9717X012
FISHER 48A6602X042
FISHER 48A8364-L5C
FISHER 48A9790-L5A
FISHER 48A9821-L7D
FISHER 49A2988-L5B
FISHER 513GS
FISHER CP6701
FISHER CP7202X1
FISHER CS-6201
FISHER CS6201X1-FA1
FISHER DC6554X1-DA1
FISHER DH-6003
FISHER DH6003X1
FISHER DH6003X1-GA1
FISHER DH6003X1-HA1
FISHER DH60051-DA1
FISHER DH6005X1-DA1
FISHER DH6005X1-EA4
FISHER DH6011
FISHER DH6011-X1
FISHER DH6011X1-DA1
FISHER DH6011X1-GA1
FISHER DH6011X1-GA2
FISHER DH7001
FISHER DH7001X1-A3
FISHER DH7201X1-A1
FISHER DH7201X1-A3
FISHER DH7202X1-A1
FISHER DM-6001
FISHER DM6001X1
FISHER DM6001X1-C1
FISHER DM6001X1-EA3
FISHER DM6001X1-FA1
FISHER DM6001X1-GA1
FISHER DM6001X1-KA13
FISHER DM6001X1-KA24
FISHER DM6003X1-GA1
FISHER DM6003X1GA2
FISHER DM6004X1-EA2
FISHER DM6004X1-FA1
FISHER DM600713
FISHER DM7051
FISHER DM7051X1-A1
FISHER FS67CFR-225/GF
FISHER FSCL7014-A1
FISHER 10P53330001
FISHER 120556X152
FISHER 12P0556X112A
FISHER 12P1509X092
FISHER 275
FISHER 32B2291X052
FISHER 32B7743X062
FISHER 3582G14
FISHER 3600
FISHER 36A0044X012
FISHER 36A0044X032
FISHER 38A9784L3D
FISHER 39A0477X012
FISHER 39A6178X01R
FISHER 39A7265X012
FISHER 39A7278
FISHER 400389B
FISHER 4160R
FISHER 4195KB
FISHER 41A8494B
FISHER 41A8494D
FISHER 41B6030
FISHER 42B0135X012
FISHER 43B5335X02233
FISHER 44A8291X012
FISHER 46A3677X012
FISHER 49A40495L3A
FISHER CL6640X1-A1
FISHER CL6721X1-A4
FISHER CL6821X1A
FISHER CL6821X1-A5
FISHER CL6861
FISHER CL7002
FISHER CL7002X1A2
FISHER CONTROLLER
FISHER CP6103XCA1
FISHER DC9430X1-CA2
FISHER DM6312X1-A1
FISHER DM6351X1-A1
FISHER DM6361X1-A1
FISHER DP4900X1A7
FISHER DPR-960
FISHER MC1651
FISHER MC768X
FISHER PM513
FISHER DM6311X1-A1
FISHER CL6601X1-HA5
FISHER CL6923X1-A1
FISHER DH6011X1-GA4
FISHER CL7001X1-A9
FISHER DH6012X1
FISHER DH6021X1-EA1
FISHER DH7010X1-A1
FISHER DM63621X1-A1
FISHER FSDVC6010100GP0P
FISHER FS3582I
FISHER 32B7743X102
FISHER 39A1173X042
FISHER 41B1841X022
FISHER 43B336X022
FISHER CL7652X1-A2
FISHER CL7675X1-BA5
FISHER CP6601X1-CA3
FISHER CP6701X1-FA8
FISHER DM6461X1-A4
FISHER MANUFACTCERT
FISHER CL6826X1-A2
FISHER DC6490X1-GA1
FISHER CD5613X1-CD5
FISHER MC751
FISHER DC6400X1-FC5
FISHER MC702
FISHER MC703
FISHER RD222
FISHER 95H24
FISHER 01984-3222-2004
FISHER TL107
FISHER TL113
FISHER TL121
FISHER TL122
FISHER TL123
FISHER TL131
FISHER TL132
FISHER TL143
FISHER TL156
FISHER TL157
FISHER TL172
FISHER TL173
FISHER TL175
FISHER CIPS3D3F
FISHER I2PX1B
FISHER MC709
FISHER MC716
FISHER MC752
FISHER MC756
FISHER MC759
FISHER 34A3136L3E
FISHER C1PS1D3E
FISHER 12P0083X032
FISHER 12P0097X012
FISHER 41B5215X122
FISHER 41B5222X42R
FISHER 41B5228X243
FISHER 41B7284X022
FISHER 43B5452X042
FISHER 43B5797X052
FISHER 44B2733X012
FISHER 44B2940X012
FISHER 44B2955X032
FISHER 12P0146X022
FISHER 12P0236X012
FISHER 12P0479X04
FISHER 32B7734X022
FISHER 32B9835X01R
FISHER 32B9836X012
FISHER 33B5239X352
FISHER 37A4680X012
FISHER 41B1427X052
FISHER 42B0649X012
FISHER 42B0652X012
FISHER 43B5336X022
FISHER 43B5797X032
FISHER 01984-4080-0001
FISHER 01984-4121-0001
FISHER 01984-4124-0001
FISHER 01984-4414-1001
FISHER 01984-4418-0001
FISHER 10P53520006
FISHER 10P54040004
FISHER 10P54080004
FISHER 10P54770001
FISHER CL6784X1-A
FISHER CL6784X-A1
FISHER CL6853X1-A13
FISHER CL6863X1-A13
FISHER CL6863X1-A2
FISHER CR1M1SCX1-A3
FISHER DC6450X1-HA5
FISHER DH-6002
FISHER DH6008X1-EA1
FISHER DH6220X1-BA3
FISHER DH-6221
FISHER DM6001X1-KA15
FISHER DM6003
FISHER DM6311
FISHER DM6321
FISHER DM6331
FISHER DM6361
FISHER DM6361X1-A4
FISHER DM6362
FISHER ESPL-210
FISHER CP6221X1-BB1
FISHER 36A2654X032
FISHER 30B7248X022
FISHER 36A2654X032
FISHER 36A3886X072