|
In this example the files compared when A goes true. Both files start at B3:0 and B9:0 and 10 bits are to be compared. When differences are found the bit numbers will be stored in a list starting at N10:0, the list can have up to three values (integer words). The Cmp Control word is for the bits being compared. The Result Control word is for the list of differences. The manual recommends clearing S:24 before running this instruction to avoid a possible processor fault. The DDT instruction is the same as the FBC instruction, except that when a different bit is found the source bit overwrites the reference bit. It is useful for storing a reference pattern for later use by a FBC.
Status Bits: EN (Cmp) enable -enabled when the instruction input is active
DN (Cmp) done -enabled when the operation is complete
ER (Cmp) error -set if an error occurred during the operation
IN (Cmp) inhibit -set when mismatch found, must be cleared to
continue the comparison
FD (Cmp) found -set when a mismatch is found
DN (Result) done -set when the result list is full
ER (Result) error -set if an error occurred with the results list
Registers: LEN (Cmp) length -the number of bits to be compared
POS (Cmp) position -the position of the current bit being compared
LEN (Result) length -the number of result positions allowed
POS (Result) position -the location of the last result added
Available on: Micrologix, PLC-5
plc function ref -34.13
LIM -LIMit
LIM LIMIT TEST (CIRC)
A Low limit N7:0 Test N7:1 High Limit N7:2
Description: This function will check to see if a value is between two limits. BACK | NEXT Easy Access To All Pages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|