作者 | 主题 |
---|---|
殚精竭力的老马 游士 经验值:151 发帖数:9 精华帖:0 |
楼主 2019-01-17 16:36:12
主题:STL语句为啥要加CLR, BR 管理 不明白,这条STL语句为啥要加CLR?? 悬赏分:15 - 解决时间:2009-4-19 11:08 程序如下: 问题补充:帮助文档说的明白 “使用“与”指令可以检查被寻址位的信号状态是否为“1”,并将测试结果与逻辑
回答: CLR /FC First Check Bit (Status Word, Bit 0) The /FC bit signal state controls a logic operation string. The /FC bit is status word bit 0. Each logic operation queries the /FC bit signal state and the addressed contact. ?If the /FC bit signal state equals "1",an instruction logically combines the result of its signal state check on its addressed contact with the RLO generated since the first check and stores the result in the RLO bit. ?If the /FC bit signal state equals "0", the logic string begins with a first check. The logic string ends and the /FC bit is set to "0" with the assignment of a value (S,R,=) or with a RLO-dependent jump instruction.
------------------------------------------- 转抄相关问题: 上面的那段代码是由梯形图转换而来的,首先将"MT510".Powder1 BR Binary Result Bit (Status Word, Bit 8) The BR bit is bit 8 of the status word. The BR bit transfers the results 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) for 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? |