336A5026ADP13通用電氣模塊
監(jiān)控通信信道您可以使用提供給應(yīng)用程序的狀態(tài)數(shù)據(jù)來(lái)監(jiān)視
通信活動(dòng),并對(duì)某些事件采取所需的行動(dòng)。初選通信信道的指示符是信道狀態(tài)位:信道錯(cuò)誤位
以及數(shù)據(jù)傳輸位。此外,COMREQ狀態(tài)字和詳細(xì)通道狀態(tài)詞可用于更精確地排除可能出現(xiàn)的任何問(wèn)題。
監(jiān)視信道命令的COMREQ狀態(tài)字監(jiān)控每個(gè)COMREQ功能的COMREQ狀態(tài)字至關(guān)重要。第一在執(zhí)行COMREQ功能之前,將相關(guān)COMREQ狀態(tài)字歸零。
當(dāng)COMREQ狀態(tài)字變?yōu)榉橇銜r(shí),您知道總線(xiàn)控制器具有更新了它。如果COMREQ狀態(tài)字更新為一(1),則命令塊已由總線(xiàn)控制器成功處理。如果COMREQ狀態(tài)字為更新為1以外的值時(shí),處理命令塊時(shí)出錯(cuò)。
有關(guān)COMREQ狀態(tài)字的更多信息,請(qǐng)參閱第7章。在COMREQ狀態(tài)字之前,不要使用從信道接收的數(shù)據(jù)信道為1或數(shù)據(jù)傳輸位變?yōu)?。
總線(xiàn)控制器狀態(tài)位的監(jiān)視器位9
總線(xiàn)控制器狀態(tài)自動(dòng)返回的狀態(tài)位的第9位為通道這是一個(gè)錯(cuò)誤位。該位(通常為0)是信道上錯(cuò)誤的主要指示器。它指示任何通道錯(cuò)誤,致命或非致命。程序可以監(jiān)控該位,并且
如果位指示錯(cuò)誤,則重新初始化讀或?qū)懲ǖ烂??;虺绦蚩梢詧?zhí)行“檢索詳細(xì)通道狀態(tài)”命令,以確定
信道空閑,獲取該信道的最新?tīng)顟B(tài)代碼。請(qǐng)記住狀態(tài)代碼可能在信道錯(cuò)誤位指示錯(cuò)誤的時(shí)間和檢索詳細(xì)通道狀態(tài)命令檢索錯(cuò)誤代碼的時(shí)間。
通道的通道錯(cuò)誤位在總線(xiàn)控制器之后才有意義更新COMREQ狀態(tài)字,確認(rèn)讀或?qū)懨?/p>
頻道在建立信道命令的情況下,COMREQ狀態(tài)字為在信道錯(cuò)誤位設(shè)置為1之前更新。在狀態(tài)位中監(jiān)控信道的數(shù)據(jù)傳輸位通常,您將設(shè)置一個(gè)通道來(lái)執(zhí)行重復(fù)讀或?qū)?。公共汽?chē)控制器自動(dòng)返回32個(gè)電位中每個(gè)電位的數(shù)據(jù)傳輸位通信渠道。該位脈沖(0→ 1.→ 0)每次成功讀取或者寫(xiě)。這可以提醒程序?qū)⒆钚聰?shù)據(jù)移動(dòng)到另一個(gè)位置。數(shù)據(jù)傳輸位在總線(xiàn)控制器更新COMREQ狀態(tài)字,用于確認(rèn)該通道的讀或?qū)懨睢?/p>
數(shù)據(jù)傳輸位在時(shí)間上與傳輸不緊密同步。只有一點(diǎn)點(diǎn)指示在過(guò)去的掃描中發(fā)生了傳輸。數(shù)據(jù)傳輸?shù)纳仙厔?shì)
指示傳輸已成功完成的位不能保證下一個(gè)傳輸尚未開(kāi)始或完成。不要使用從服務(wù)器接收的數(shù)據(jù),直到確認(rèn)該通道讀取命令的COMREQ狀態(tài)字為1或數(shù)據(jù)傳輸位變?yōu)?。
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.