i am trying with serin2, the timeout is working properly,
but i faced another problem which is the [str varname\n]

serin2 IN_PIN,84,[str buffer\2] ' baud 9600
if buffer[0] = "A" and buffer[1] = "B" then
LED1 = 1
LED2 = 0
else
LED1 = 0
LED2 = 1
endif

The above code makes LED2 ON when sending "AB" to the microcontroller (which is wrong) while the below code makes LED1 ON (which is correct)

serin2 IN_PIN,84,[buffer[0],buffer[1]]
if buffer[0] = "A" and buffer[1] = "B" then
LED1 = 1
LED2 = 0
else
LED1 = 0
LED2 = 1
endif

where is the problem in my code ???
i have a buffer of around 50 bytes, so it is preferable to use the [str buffer\50]

Note that i tested the debugin instead of serin2, but same problem !!!