webcontrol inputs

siafu

Active Member
Hello all,
 
I purchased a keypad that I want to add outside the door. I want to be able to enter a pin code on the keypad and the signal from the keypad goes to IP2 on the board to give a signal to OP1 to trigger a relay (that I have in place and working via other cai programing)
 
Here is the code logic.
 
START    
      
    TSTGT IP2 0  
    CALLSUB KEYPAD   
END 

KEYPAD:
    SET OP1[1000] 1  
    SET OP1 0  
    RET

 
 
The problem is that I can see some signal being transmitted to the relay (it has a green light) but it just flickers on and off for the duration and the door does not open.
 
Any idea why it does not work properly?
 
 
 
It does work properly with the direct code as listed below is I press the TTL1 ON button in the output control. page.
 
 
START    
    TSTEQ OP1[1000] 1  
    SET OP1 0  
    RET    

    END

 


   
 
 
 
Yeah. It is "set op1 0" that is the problem
 
START    
      
    TSTGT IP2 0  
    CALLSUB KEYPAD   
END 

KEYPAD:
    SET OP1[1000] 1  This line turns the output on for 1 second assuming nothing else turns it off first.
    SET OP1 0    This line is turning the output off. . . like less than 1ms after the line above turns it on.  Delete this line.
    RET
 
Back
Top