Try this
Code:
if ( GetDigitalInput ( 1 ) && Input > 127 )
{
Input = 127 ;
}
else if ( GetDigitalInput ( 2 ) && Input < 127 )
{
Input = 127 ;
}
If you are using an OI to PWM Block
Then delete it and add this.
Code:
Input = GetOIAInput ( 1 , 1 ) ;
if ( GetDigitalInput ( 1 ) && Input > 127 )
{
Input = 127 ;
}
else if ( GetDigitalInput ( 2 ) && Input < 127 )
{
Input = 127 ;
}
SetPWM ( 1 , Input ) ;