布尔异或 (BXOR)

此信息适用于 CompactLogix 5370、ControlLogix 5570、Compact GuardLogix 5370、GuardLogix 5570、Compact GuardLogix 5380、CompactLogix 5380、ControlLogix 5580、GuardLogix 5580 和 ControlLogix 5590 控制器。
BXOR 指令可对两个布尔型输入执行异或运算。
可用语言
梯形图
此指令不可用于梯形图中。
功能块图
功能块图支持以下元素:
FBD 块
BXOR_FBD_avail_v31
FBD 函数
小贴士: FBD 函数仅适用于 CompactLogix 5380、ControlLogix 5580、Compact GuardLogix 5380、GuardLogix 5580 和 ControlLogix 5590 控制器。
BXOR_FBD func
结构化文本
此指令不可用于结构化文本中。
操作数
功能块图
FBD 块
操作数
数据类型
格式
说明
BXOR tag
FBD_BOOLEAN_XOR
结构
BXOR 结构
FBD_BOOLEAN_XOR 结构
输入成员
数据类型
说明
EnableIn
BOOL
启用输入。如果此参数清零,指令不会执行,也不会更新输出。
默认置位。
In1
BOOL
第一个布尔型输入。
默认清零。
In2
BOOL
第二个布尔型输入。
默认清零。
输出成员
数据类型
说明
EnableOut
BOOL
指示指令是否处于启用状态。
Out
BOOL
指令的输出。
FBD 函数
小贴士: FBD 函数仅适用于 CompactLogix 5380、ControlLogix 5580、Compact GuardLogix 5380、GuardLogix 5580 和 ControlLogix 5590 控制器。
输入操作数(左侧引脚)
数据类型
CompactLogix 5380、ControlLogix 5580、Compact GuardLogix 5380、GuardLogix 5580 和 ControlLogix 5590 控制器
说明
In1
BOOL
第一个布尔型输入。
In2
BOOL
第二个布尔型输入。
输出操作数(右侧引脚)
数据类型
CompactLogix 5380、ControlLogix 5580、Compact GuardLogix 5380、GuardLogix 5580 和 ControlLogix 5590 控制器
说明
Out
BOOL
指令的输出。
请参见 FBD 函数FBD 函数。
操作
BXOR 指令可对两个布尔型输入执行异或运算。
Out = In1 XOR In2
影响数学状态标志
严重/轻微故障
没有特定于此指令的故障。
执行
功能块图
FBD 块
条件/状态
执行的操作
预扫描
EnableIn 和 EnableOut 位设置为假。
Tag.EnableIn 为假
EnableIn 和 EnableOut 位设置为假。
Tag.EnableIn 为真
EnableIn 和 EnableOut 位设置为真。
此指令按运行部分所述执行。
指令首次运行
不适用
指令首次扫描
不适用
后扫描
EnableIn 和 EnableOut 位设置为假。
FBD 函数
小贴士: FBD 函数仅适用于 CompactLogix 5380、ControlLogix 5580、Compact GuardLogix 5380、GuardLogix 5580 和 ControlLogix 5590 控制器。
条件/状态
执行的操作
预扫描
不适用
普通扫描
Out = In1 XOR In2
指令首次运行
不适用
指令首次扫描
不适用
后扫描
不适用
示例
功能块图
在本例中,bool_in1 复制到 BXOR_02.In1 中,bool_in2 复制到 BXOR_02.In2 中,对 BXOR_02.In1 和 BXOR_02.In2 执行异或运算的结果放入 BXOR_02.Out 中,BXOR_02.Out 随后复制到 value_result_xor 中。
如果 bool_in1 为:
如果 bool_in2 为:
则 value_result_xor 为:
0
0
0
0
1
1
1
0
1
1
1
0
FBD 块
本示例将对 bool_in1 和 bool_in2 执行异或运算,并将结果放入 value_result_xor。
BXOR_FBD_ex_v31
FBD 函数
BXOR_FBD func_e
提供反馈
对本文档有问题或反馈吗? 请在这里提交您的反馈
Normal