<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁(yè) > 手機(jī)與無(wú)線通信 > 設(shè)計(jì)應(yīng)用 > 1553B總線控制器設(shè)計(jì)與調(diào)試

          1553B總線控制器設(shè)計(jì)與調(diào)試

          作者: 時(shí)間:2009-06-25 來(lái)源:網(wǎng)絡(luò) 收藏

          (2)的重試與消息重復(fù):當(dāng)消息中出現(xiàn)狀態(tài)地址錯(cuò),字計(jì)數(shù)錯(cuò),同步類型錯(cuò),校驗(yàn)錯(cuò)時(shí)會(huì)進(jìn)行標(biāo)記,所以程序時(shí)應(yīng)當(dāng)打開(kāi)錯(cuò)誤檢測(cè)位。同時(shí)由于是多余度總線,當(dāng)某一個(gè)總線出現(xiàn)差錯(cuò)時(shí),系統(tǒng)會(huì)根據(jù)設(shè)定在另外一個(gè)BUS上重試,也可以在本條總線重試,所以在程序時(shí)要靈活運(yùn)用。然而對(duì)總線上的廣播消息,由于這類消息沒(méi)有狀態(tài)返回,因此總線重試的意義在這里就沒(méi)有了。
          (3)避免沖突:總線必須考慮到各個(gè)終端的響應(yīng)及處理,在安排通訊時(shí)應(yīng)該避免對(duì)同一終端地址連續(xù)發(fā)送總線消息(針對(duì)同一子地址的連續(xù)消息發(fā)送除外),由于大多數(shù)終端的通訊處理是在中斷情況下進(jìn)行的,如果連續(xù)發(fā)送則有可能使終端丟失消息或者處理沖突,所以總線要給同一終端留下足夠的處理時(shí)間。
          下面是筆者編寫(xiě)的總線程序中的部分代碼:
          ////////////中斷函數(shù)////////////////////
          ViInt32 _stdcall demo_rt_watch_function(ViUInt32 cardnum,ViUInt16 chnum,struct api_int_fifo *sIntFIFO)
          { ViUInt32 tail; // FIFO Tail index
          ViUInt32 messno,wordcount,i=0,j=0; // Message number to be updated
          ViStatus hr;
          API_BC_MBUF api_message;
          ViUInt16 rtaddr,subaddr,transrec;
          API_RT_MBUF_READ mbuf;
          /***********************************************
          * Loop on all entries in the FIFO. Get the tail pointer and extract
          * the FIFO entry it points to. When head == tail FIFO is empty
          ******************************************/
          tail = sIntFIFO->tail_index;
          while (tail != sIntFIFO->head_index )
          {
          // Extract the buffer ID from the FIFO and read the message from the board
          messno = sIntFIFO->fifo[tail].bufferID;
          if (sIntFIFO->fifo[tail].event_type==EVENT_BC_MESSAGE)
          {
          hr=Eph6273_BC_MessageRead(
          cardnum,
          // (i)card number (0 - based)
          chnum,
          // (i)channel number (0 - based)
          messno,
          // (i)index of BC message to read
          api_message);
          // (o)user's buffer to write message into
          tail++;
          // Next entry
          tail = sIntFIFO->mask_index;
          // Wrap the index
          sIntFIFO->tail_index = tail;
          // Save the index
          }
          return API_SUCCESS;
          }
          4 總線系統(tǒng)連接與
          總線采用雙鉸屏蔽線傳輸,當(dāng)終端離總線很近時(shí)(0.3米)可以直接通過(guò)隔離變壓器與總線連接,當(dāng)終端離總線較遠(yuǎn)(最遠(yuǎn)不應(yīng)超過(guò)6.1米)時(shí)要在變壓器與總線之間插入耦合器。這兩種方式比較變壓器耦合具有更好的抗干擾能力,能用在長(zhǎng)距離的通訊上,而直接耦合不利于RT故障的隔離,會(huì)因?yàn)槟骋粋€(gè)RT故障造成系統(tǒng)網(wǎng)絡(luò)的通訊不正常。圖1就是一個(gè)簡(jiǎn)單的系統(tǒng)連接圖,當(dāng)然設(shè)計(jì)者可以根據(jù)系統(tǒng)需求在總線上連接更多的終端,也可以掛總線監(jiān)視器用以監(jiān)視總線信息。


          評(píng)論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();