-------------------------------------------- CONPROSYS Script sample programs No. 012 -------------------------------------------- Process name: Monitor upper and lower limits of analog input Date of creation: April 18, 2016 Processing content: Monitor the analog input value and turn the output ON if it is outside the upper and lower limit values. [Signals] AI0 - Analog Input 1 DO0 - Output [Operation] 1. Read the value of analog input 1. 2. Monitor whether the inputted value is outside the upper and lower limit values. 3. When the value is outside the upper and lower limit values, turn the output to ON. [Description] The sample program has a main task (TASK9) and a subroutine (SUB9). To use this sample program, restores this sample program to the M2M controller and names the task number and the subroutine number. If the subroutine is renamed to a number that is not SUB9, change the calling number to the new one. Set the AI0 value into the LTAG90, the upper limit value (*1) into LTAG91, and the lower limit value (*2) into LTGA92, then call the subroutine SUB9. The subroutine compares the inputted value with the upper limit value and the lower limit values, set the result to LTAG99. Output the LTAG99 state to DO0. *1 In this sample program the upper limit value is 2000. *2 In this sample program the lower limit value is 1000.