How to Create the Compare function for Analog input and operate the Digital output for Alarm and Control