



下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、1、 STEP7使用的AR1地址寄存器來訪問FC接口(包括in out 和inout)以及FB接口的復(fù)雜型參數(shù),如array、struct date_and_time.這就是我們?yōu)槭裁丛贔C接口中使用out型參數(shù)訪問DB1.DBXX會出現(xiàn)錯誤,因為AR1寄存器不能完全描述DB1.DBXX地址,完全描述需要6長度字節(jié)。2、 FC FB 本質(zhì)上一樣調(diào)用FB相當于在FC里opn di ,并使用ar2來索引變量FB的優(yōu)點是數(shù)據(jù)塊里的變量可按名字使用,僅僅是顯示而已,執(zhí)行效率和fc一樣3、 fb中為了方便背景數(shù)據(jù)塊參數(shù)的尋址,自動使用ar2寄存器,ar2寄存器指向背景數(shù)據(jù)塊的首地址p#dbx0.0,如果
2、改變了這個寄存器的值,你再訪問背景數(shù)據(jù)塊參數(shù)時將不會得到正確的數(shù)值.所以,在fb里使用ar2寄存器要小心,對這兩個寄存器改變后不要再使用背景數(shù)據(jù)塊參數(shù),當要使用背景數(shù)據(jù)塊參數(shù)時要先恢復(fù)這兩個寄存器的值。有一個常用的用法是多重背景fb的接口參數(shù)的尋址用法,需要用到ar2:(因為在多重背景中,變量的地址并不是其在背景數(shù)據(jù)塊中的絕對地址,而是其相對于ar2的偏移地址),所以:在多重背景fb中,如果要得到某變量variable在背景數(shù)據(jù)塊中的絕對地址,可以使用以下代碼:tar2/將地址寄存器裝入累加器ac1(偏移量),也就是多重背景fb中第一個變量在背景數(shù)據(jù)塊中的地址。addw#16#00ffffff
3、/關(guān)閉區(qū)域idlp#variable/裝載變量的地址+d/加上偏移量和變量地址lar1/將結(jié)果保存到地址寄存器ar1中Notes on Changing the Contents of RegistersIf you use the programming options below together with the registers and accumulators listed, you must make sure you restore the contents of the registers or accumulators yourself, otherwise errors
4、may occur. Using the following higher-language constructions may cause the contents of the DB register and address register AR1 to be modified:Fully-qualified DB access (for example, DB20.DBW10) as an actual parameter for a function (FC) Function block (FB) and multiple-instance callsStructure compo
5、nents of a formal parameter as an address within an FC or FBStructure components of a formal parameter as an actual parameter for an FC or FBWith FB, FC, and multiple-instance calls, you should not use the RLO or accumulator 1 or 2 as additional (implicit) parameters.The DI register and address regi
6、ster AR2 are used on the system side for the FB and multiple-instance calls and should not therefore be modified within FBs.Address register AR1 is used by some of the loadable standard blocks. The command L P#parameter_name loads the address offset of the specified parameter within an FB, relative to address register AR2. In order to determine the absolute offset in the instance data block in multiple-instance type FBs, you must also add the area-internal poin
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 個人借款擔保人合同
- 電子商務(wù)網(wǎng)絡(luò)推廣合作免責協(xié)議
- 夫妻房屋財產(chǎn)約定協(xié)議書
- 商鋪招商代理合同
- 三農(nóng)村基層民主監(jiān)督與管理制度化方案
- 電子簽名認證技術(shù)研究開發(fā)合作協(xié)議
- 工業(yè)地產(chǎn)租賃合同
- 油漆工種勞務(wù)分包合同
- 小學(xué)禁毒宣傳活動方案
- 樓梯口拆除改造合同
- 公司EHS知識競賽題庫附答案
- 社區(qū)健康促進工作計劃
- 2025年度移動端SEO服務(wù)及用戶體驗優(yōu)化合同
- 中小學(xué)《清明節(jié)活動方案》班會課件
- 特殊教育學(xué)校2024-2025學(xué)年度第二學(xué)期教學(xué)工作計劃
- 寧夏銀川一中2025屆高三上學(xué)期第五次月考數(shù)學(xué)試卷(含答案)
- 2024年物聯(lián)網(wǎng)安裝調(diào)試員(初級工)職業(yè)資格鑒定考試題庫(含答案)
- 《設(shè)備科安全培訓(xùn)》課件
- 延長石油招聘筆試題庫
- 人教鄂教版六年級下冊科學(xué)全冊知識點
- 鄭州市地圖含區(qū)縣可編輯可填充動畫演示矢量分層地圖課件模板
評論
0/150
提交評論