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.