Chapter 6 Applied Instructions Symbol S 1 : Data source1 S 2 : Data source2 Taking AND$= for example Explanation 1. These instructions compare the strings in S 1 and S 2 . 2. S 1 and S 2 can contain string up to 256 characters (16#00 the end symbol is included). 3. Take the AND$= instruction for example. When the comparison result is that the value in S 1 is equal to that in S 2 , the 6_ continuity condition of the instruction is met. When the comparison result is that the value in S 1 is not equal to that in S 2 , the discontinuity condition of the instruction is met.
Only when the data in S – S +n (n indicates the n th device, up to 256 characters in each string) includes 16#00 can the instruction compare the data as complete strings. For example:
S b15 b8 b7 b0 16#32(2) 16#31(1) S+1 16#34(4) 16#33(3) S+2 16#35(5) 16#00 " " 12345 6-21 API Instruction code Operand Function 0042-0043 AND$※ S1,S2 Comparing strings AND$※ Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 Pulse Instruction 16-bit instruction 32-bit instruction - ES3 - 16-bit Continuity Discontinuity API number instruction condition condition 0042 AND$= S1=S2 S1≠S2 0043 AND$<> S1≠S2 S1=S2