Mitsubishi Electric MELSEC-Q/L Programming Manual page 215

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents