DMX woes...

so do anyone know what could be the problem with the sketch

Well I can't follow it too well. I always find that lots of "else if" can be confusing and easy misunderstood. Try and re arrange this part maybe using a switch construct.