#DEFAULT_VOLATILE
#ENABLE_STACK_CHECKING
#ENABLE_TRACE
DIGITAL_INPUT Enable,_skip_,Video_Detecte[4];
ANALOG_INPUT Ain[2];
ANALOG_OUTPUT out[2];
change Video_Detecte
{
if(enable)
{
if(Video_Detecte[1] = 1)
{
out[1] = 1;
out[2] = 1;
}
else if(Video_Detecte[1] = 0&&Video_Detecte[2] = 1)
{
out[1] = 2;
out[2] = 2;
}
else if(Video_Detecte[1] = 0&&Video_Detecte[2] = 0 &&Video_Detecte[3] = 1)
{
out[1] = 3;
out[2] = 3;
}
else if(Video_Detecte[1] = 0&&Video_Detecte[2] = 0 &&Video_Detecte[3] = 0 &&Video_Detecte[4] = 1)
{
out[1] = 4;
out[2] = 4;
}
else if(Video_Detecte[1] = 0&&Video_Detecte[2] = 0 &&Video_Detecte[3] = 0 &&Video_Detecte[4] = 0)
{
out[1] = 1;
out[2] = 1;
}
}
}
change AIN
{
integer i;
i = GetLastModifiedArrayIndex ();
out[i] = ain[i];
}