Try something like this:
Code:
IF mydata1=%01011001 THEN
WHILE  mydata1=%01011001
HIGH 1
WEND
ELSE
LOW 1
ENDIF