You have to initial your analog module at beginning in your program, this function is "Enable" your analog module. and you can just use CMP as OMRON Davy said to check your input value and set point, if larger ,equal or smaller, then you can set a value to output channel. See attached my used Two heads Self teaching Leak tester program for your reference, hope it helps.
附件: doc/tech/oq200305100430412884.cxt