发布于 2006-06-27 17:42:12
0楼
这是帮助中对于BR的说明。
2个功能,如果不需要对BR进行任何操作,那就在程序开始的时候保存调用该块之前的BR,然后在块结束时恢复BR,另外是判断块中程序是否正确执行而设置BR位,
The BR bit is bit 8 of the status word. The BR bit transfers thesults
obtained from processing Statement List (STL) instructions on to the
next instructions to be processed. When writing a function block or
function in STL that you want to call from LAD/FBD, you have to store
the result of the logic operation (RLO) in the BR bit immediately
before leaving the block in order to provide the enable output (ENO)
or the LAD/FBD box. You do this using the SAVE, JCB, JNB
instructions. When you call a system function block (SFB) or a system
function (SFC) in your program, the SFB or SFC indicates whether the
CPU was able to execute the function with or without errors by
providing the following information in the binary result bit: ? If an
error occurred during execution, the BR bit is ‘’ 0 ” . ? If the
function was executed with no error, the BR bit is ‘’ 1 ” .