Chapter 6 0BApplied Instructions Symbol: S 1 : Data source 1 String Taking LD$= for example S 2 : Data source 2 String Explanation: 1. The instructions are used to compare the data in S 1 with that in S 2 , and the data compared is strings. Take the instruction LD$= for example. When the comparison result is that the data in S 1 is equal to that in S 2 , the condition of the contact is met. When the comparison result is that the data in S 1 is not equal to that in S 2 , the condition of the contact is not met. 2. Only when the data in S ~ S +n (n indicates the n th device) includes 16#00 can the data be judged as a complete string.
b15 b8 b7 b0 16#32(2) 16#31(1) S+1 S 16#34(4) 16#33(3) S+2 16#35(5) 16#00 " " 12345 3. When two strings are the same, the corresponding comparison operation results of the instructions are listed below.
b15 b8 b7 b0 b15 b8 b7 b0 S1 Comparison sign S2 S1 +1 S2 +1 S1 +2 " " ABCDE S2 +2 " " ABCDE 6-16 API Instruction code Operand Function 0036~ 0041 LD$※ S , S 1 2 Comparing the strings Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 Pulse instruction 16-bit instruction (5-17 steps) 32-bit instruction - AH500 - API Comparison operation result Instruction number ON OFF 0036 LD$= S =S 1 2 S ≠S 1 2 0037 LD$<> S ≠S 1 2 S =S 1 2 0038 LD$> S >S 1 2 S ≦S 1 2 0039 LD$>= S ≧S 1 2 S <S 1 2 0040 LD$< S <S 1 2 S ≧S 1 2 0041 LD$<= S ≦S 1 2 S >S 1 2 16#42(B) 16#41(A) 16#44(D) 16#43(C) 16#00 16#45(E) 16#42(B) 16#41(A) 16#44(D) 16#43(C) 16#00 16#45(E)