Program example
■AND, &
The program which performs Boolean AND on bit, word (unsigned)/16-bit string type data input to (s1) and (s2) bit by bit, and
outputs the operation result from (d) in the same data type as that of (s1) and (s2).
[Structured ladder/FBD]
[ST]
g_word3:= (g_word1) AND (g_word2);
or
g_word3:= (g_word1) & (g_word2);
■OR
The program which performs Boolean OR on bit, word (unsigned)/16-bit string type data input to (s1) and (s2) bit by bit, and
outputs the operation result from (d) in the same data type as that of (s1) and (s2).
[Structured ladder/FBD]
[ST]
g_word3:= (g_word1) OR (g_word2);
■XOR
The program which performs Boolean XOR on bit, word (unsigned)/16-bit string type data input to (s1) and (s2) bit by bit, and
outputs the operation result from (d) in the same data type as that of (s1) and (s2).
[Structured ladder/FBD]
[ST]
g_word3:= (g_word1) XOR (g_word2);
■NOT
The program which performs Boolean NOT on bit, word (unsigned)/16-bit string type data input to (s1) bit by bit, and outputs
the operation result from (d) in the same data type as that of (s1).
[Structured ladder/FBD]
[ST]
g_word2:= NOT(g_word1);
6 OPERATOR
213
6.2 Logical Operations
6