If the OUT instruction using the device number of the latch target device exists in a sequence program, the latched data may be overwritten by execution of the OUT instruction.
Use the SET instruction instead of the OUT instruction for the device numbers that need to be latched.