AH500 Programming Manual Symbol: S 1 : Data source 1 String Taking AND$= 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 AND$= 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. 3.
When the strings are completely the same, the corresponding comparison operation results of the instructions are listed below. S1 b15 b8 b7 b0 Comparison sign S2 b15 b8 b7 b0 S1 +1 S2 +1 S1 +2 " " ABCDE S2 +2 " " ABCDE 4. When the lengths of the strings are the same, but their contents are different, the first different values (ASCII codes) met in the strings are compared. For example, the string in S 1 is “ABCDF”, and the string in S 1 is “ABCDE”. The first different values met in the strings are “F” (16#46) and “E” (16#45). Owing to the fact that 16#46 is greater than 16#45, the string in S 1 is greater than that in S 1 .
The corresponding comparison operation results of the instructions are listed below. 6-19 API Instruction code Operand Function 0042~ 0047 AND$※ 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 - 16#42(B) 16#41(A) 16#44(D) 16#00 16#43(C) 16#45(E) 16#42(B) 16#41(A) 16#44(D) 16#00 16#43(C) 16#45(E) Comparison symbol Comparison operation result $= ON $<> OFF $> OFF $>= ON $< OFF $<= ON