BS2 and RFID Reader.... How to know when the reader is inactive
ok so i have a parallax rfid reader hooked into my basic stamp. I read my tags in the the VAR buf. My question is how can i determine when the reader is not reading a tag. My thought was to set the buf=0 and then do this piece of code.
LOWEnable 'activatethereader
SERINRX,T2400,150,Notag_,[WAIT($0A),SKIP6,HEX4buf] 'waitforhdr+ID
HIGHEnable
And if my reader dosnt read a tag my buf should still equal zero. So then i can say
If(buf = 0) THEN
Debug "There is no tag in range"
Anybody know how i can do this.
LOWEnable 'activatethereader
SERINRX,T2400,150,Notag_,[WAIT($0A),SKIP6,HEX4buf] 'waitforhdr+ID
HIGHEnable
And if my reader dosnt read a tag my buf should still equal zero. So then i can say
If(buf = 0) THEN
Debug "There is no tag in range"
Anybody know how i can do this.

Comments
The "Notag_" part is the name of a subroutine that the program jumps to if the tag reading times out. The "150" before it is the time in milliseconds that it waits to read a tag before making the jump. If a tag is read then the jump is not made.
Rich H
can i just go
NotTag:
debug "There is no tag in range"
See if this works;
' {$STAMP BS2} ' {$PBASIC 2.5} RX PIN 5 ' change to suit Enable PIN 3 ' change to suit tag VAR Word(5) ' an array of 5 buf VAR Word i VAR Byte T2400 CON 396 Main: DO FOR i = 0 TO 4 LOW Enable 'activate the reader SERIN RX, T2400, 150, Notag, [WAIT($0A), SKIP 6, HEX4 buf] HIGH Enable SELECT buf ' look at contents of buf CASE tag(0) ' if buf = the first tag DEBUG "This is tag 1" EXIT ' exit the FOR..NEXT loop CASE tag(1) DEBUG "This is tag 2" EXIT CASE tag(2) DEBUG "This is tag 3" EXIT CASE tag(3) DEBUG "This is tag 4" EXIT CASE tag(4) DEBUG "This is tag 5" EXIT CASE ELSE DEBUG "This tag stored as tag ", DEC i+1 tag(i) = buf ENDSELECT NEXT GOTO Main Notag: DEBUG "There is no tag in range" LOOPRich H