The document provides 13 examples of comparator logic programs for PLC ladder logic. The examples demonstrate how to turn outputs on based on comparing values from different bytes and bits, including turning on outputs if bytes or bits are equal, not equal, greater than, greater than or equal to, less than, or less than or equal to each other. The final example describes running two motors based on different bit conditions from two bytes and individually turning one motor on based on another bit condition.
The document provides 13 examples of comparator logic programs for PLC ladder logic. The examples demonstrate how to turn outputs on based on comparing values from different bytes and bits, including turning on outputs if bytes or bits are equal, not equal, greater than, greater than or equal to, less than, or less than or equal to each other. The final example describes running two motors based on different bit conditions from two bytes and individually turning one motor on based on another bit condition.
The document provides 13 examples of comparator logic programs for PLC ladder logic. The examples demonstrate how to turn outputs on based on comparing values from different bytes and bits, including turning on outputs if bytes or bits are equal, not equal, greater than, greater than or equal to, less than, or less than or equal to each other. The final example describes running two motors based on different bit conditions from two bytes and individually turning one motor on based on another bit condition.
Example 1: The output is ON only if a value of 5 comes from the byte 1.
Example 2: The output is ON only if a value
of 127 comes from the byte 0.
Example 3: The output is ON only if a value
of 65 comes from the byte 1.
Example 4: The output is ON only if a value
of 36 comes from the byte 0.
Example 5: The lamp should glow only if
the byte 0 and byte 1 is equal.
Example 6: The lamp should glow only if
byte 0 & byte 1 is not equal.
Example 7: The lamp should glow only if
the byte 0 is greater than byte 1.
Example 8: The lamp should glow only if
the byte 0 is greater than or equal to byte 1. Example 9: The lamp should glow only if the byte 0 is less than byte 1.
Example 10: The lamp should glow only if
byte 0 is less than or equal to byte 1.
Example 11: A motor M1 should run when
there is a signal from bit no 7 and bit no 0 of an input byte 0 of a plc.
Example 12: A motor M2 should run when
there is a signal from bit no 4 and bit no 2 of an input byte 0.
Example 13: A motor M1 should run when
there is a signal from bit no 7 and bit no 0 of an input byte 0 of a plc. A motor M2 should run when there is a signal from bit no 4 and bit no 2 of an input byte 0 when M2 starts it makes motor M1 off. Even if only bit no 5 and bit no 7 gives the signal to PLC from byte 1 Motor M2 also starts individually.