May be you need something like:

if my_var=11 then portb.1=1
if my_var=129 then portb.1=0

Ioannis