08M2 serin and qualifier to get following 7 bytes - how?

ferrymanr

Member
I need a very simple RS-232 monitor to sniff an RS-232 9600bd line and wait for an ASCII "W" then store the next 7 bytes for a simple calculation and the turn an output off or on. The 08M2 should be more than enough to do this but not sure how to use serin with a qualifier to get the next 7 bytes. actually I only need the last three of the seven bytes. Can someone point me the right way.
Im more used to using hserin on the X2 chips!
Thanks
Dick
 

geoff07

Senior Member
SERIN pin,baudmode,(qualifier,qualifier...),{#}variable,{#}variable..

Put "W" as the qualifier in the brackets, then list the bytes you want to fill. Manual 2.
 

westaust55

Moderator
If only the last three bytes are required then try:

setfreq m16
serin C.1,T9600_16,("W"),b1,b1,b1,b1,b1,b2,b3

That will save using 4 other byte variables if you program gets short on variables.
 
Top