336A5026ADP13通用電氣模塊
監控通信信道您可以使用提供給應用程序的狀態數據來監視
通信活動,并對某些事件采取所需的行動。初選通信信道的指示符是信道狀態位:信道錯誤位
以及數據傳輸位。此外,COMREQ狀態字和詳細通道狀態詞可用于更精確地排除可能出現的任何問題。
監視信道命令的COMREQ狀態字監控每個COMREQ功能的COMREQ狀態字至關重要。第一在執行COMREQ功能之前,將相關COMREQ狀態字歸零。
當COMREQ狀態字變為非零時,您知道總線控制器具有更新了它。如果COMREQ狀態字更新為一(1),則命令塊已由總線控制器成功處理。如果COMREQ狀態字為更新為1以外的值時,處理命令塊時出錯。
有關COMREQ狀態字的更多信息,請參閱第7章。在COMREQ狀態字之前,不要使用從信道接收的數據信道為1或數據傳輸位變為1。
總線控制器狀態位的監視器位9
總線控制器狀態自動返回的狀態位的第9位為通道這是一個錯誤位。該位(通常為0)是信道上錯誤的主要指示器。它指示任何通道錯誤,致命或非致命。程序可以監控該位,并且
如果位指示錯誤,則重新初始化讀或寫通道命令。或程序可以執行“檢索詳細通道狀態”命令,以確定
信道空閑,獲取該信道的最新狀態代碼。請記住狀態代碼可能在信道錯誤位指示錯誤的時間和檢索詳細通道狀態命令檢索錯誤代碼的時間。
通道的通道錯誤位在總線控制器之后才有意義更新COMREQ狀態字,確認讀或寫命令
頻道在建立信道命令的情況下,COMREQ狀態字為在信道錯誤位設置為1之前更新。在狀態位中監控信道的數據傳輸位通常,您將設置一個通道來執行重復讀或寫。公共汽車控制器自動返回32個電位中每個電位的數據傳輸位通信渠道。該位脈沖(0→ 1.→ 0)每次成功讀取或者寫。這可以提醒程序將最新數據移動到另一個位置。數據傳輸位在總線控制器更新COMREQ狀態字,用于確認該通道的讀或寫命令。
數據傳輸位在時間上與傳輸不緊密同步。只有一點點指示在過去的掃描中發生了傳輸。數據傳輸的上升趨勢
指示傳輸已成功完成的位不能保證下一個傳輸尚未開始或完成。不要使用從服務器接收的數據,直到確認該通道讀取命令的COMREQ狀態字為1或數據傳輸位變為1。
Monitoring a Communications Channel
You can use the status data provided to the application program to monitor your
communications activity and take the desired action upon certain events. The primary
indicators of a communications channel are the Channel Status bits: Channel Error bit
and Data Transfer bit. In addition, the COMREQ Status Word and the Detailed Channel
Status Words can be used to more precisely troubleshoot any problems that may occur.
Monitor the COMREQ Status Word for the Channel Command
It is critical to monitor the COMREQ Status Word for each COMREQ function. First,
zero the associated COMREQ Status Word before executing the COMREQ function.
When the COMREQ Status Word becomes non-zero, you know the Bus Controller has
updated it. If the COMREQ Status Word is updated to a one (1), the Command Block
was processed successfully by the Bus Controller. If the COMREQ Status Word is
updated to a value other than 1, an error occurred in processing the Command Block.
See chapter 7 for more information about the COMREQ Status Word.
Do not use data received from a channel until the COMREQ Status Word for that
channel is 1 or the Data Transfer bit goes to 1.
Monitor Bit 9 of the Bus Controller Status Bits
Bit 9 of the status bits automatically returned by the Bus Controller Status is the Channel
Error bit. This bit (normally 0) is the primary indicator for an error on a channel. It
indicates any channel error, fatal or non-fatal. The program can monitor this bit and
reinitiate the Read or Write Channel command if the bit indicates an error. Or the
program may execute the Retrieve Detailed Channel Status Command to find out if the
channel is idle and obtain the latest status codes for that channel. Keep in mind that the
status code may change between the time the Channel Error bit indicates an error and
the time the Retrieve Detailed Channel Status Command retrieves the error code.
The Channel Error bit for a channel is not meaningful until after the Bus Controller
updates the COMREQ Status Word confirming the Read or Write command for that
channel. In the case of an Establish channel command, the COMREQ Status Word is
updated before the Channel Error bit is set to 1.Monitor the Channel’s Data Transfer Bit in the Status Bits
Typically you will set up a channel to perform repetitive reads or writes. The Bus
Controller automatically returns a Data Transfer bit for each of 32 potential
communications channels. This bit pulses (0 → 1 → 0) each time there is a successful read
or write. This can alert the program to move the most recent data to another location.
The Data Transfer bit is not meaningful until after the Bus Controller updates the
COMREQ Status Word confirming the Read or Write command for that channel.
The Data Transfer bit is not closely synchronized in time with the transfer. The bit only
indicates that a transfer has occurred in a past scan. A rising edge on the Data Transfer
bit indicating that a transfer has completed successfully does not guarantee that the next
transfer has not begun or completed. Do not use data received from a server until the
COMREQ Status Word confirming the Read command for that channel is 1 or the Data
Transfer bit goes to 1.