converting basic stamp2 codes into arduino codes

@Coding Badly.... hey sir...could you please take a look in our codings....the
5 volts dc to VCC
Pin 6 to SIN
Pin 8 to SOUT
0 volts to GROUND

Here is the sample code.....

#include <NewSoftSerial.h>
#define RFID_WRITE 0x02
#define txPin 6
#define rxPin 8


#define mem 7


#define first 3
#define second 12
#define third 4
#define fourth 16


NewSoftSerial mySerial(rxPin, txPin);


void setup()
{
Serial.begin(9600);
Serial.println("RFID Write Test");
mySerial.begin(9600);
pinMode(txPin, OUTPUT); 
pinMode(rxPin, INPUT); 
}





void loop()
{
int val;

mySerial.print("!RW");
mySerial.print(RFID_WRITE, BYTE);
mySerial.print(mem, BYTE);
mySerial.print(first, BYTE);
mySerial.print(second, BYTE);
mySerial.print(third, BYTE);
mySerial.print(fourth, BYTE);


if(mySerial.available() > 0) { 
val = mySerial.read();
if (val == 1) //If data was written successfully
{ Serial.println("Data written succesfully!");

}
else Serial.println("Error Code: ");
//If an error occured during writing, discard all data recieved from the RFID writer
}
delay(250);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////

the following code generates and output of
Erro Code: 2
Erro Code: 2
Erro Code: 2
Erro Code: 2
Erro Code: 2

//////////////////////////////////////////////////////////////////////////////////////////////////////////
and according to the datasheet of the parallax 28440
Error Checking

Value Name Description
0x01 ERR_OK No Errors
0x02 ERR_LIW Could not find a Listen Window (LIW) from the tag
0x03 ERR_NAK Received a No Acknowledge (NAK), possible communication error or
invalid command/data
0x04 ERR_NAK_OLDPW Received a No Acknowledge (NAK) sending the current password during
the RFID SetPass command, possible incorrect password
0x05 ERR_NAK_NEWPW Received a No Acknowledge (NAK) sending the new password during the
RFID SetPass command
0x06 ERR_LIW_NEWPW Could not find a Listen Window (LIW) from the tag after setting the new
password during the RFID SetPass command
0x07 ERR_PARITY Parity error when reading data from the tag

///////////////////////////////////////////////////////////////////////////////
the error above correspond to the error 0x02 which is the ERR_LIW could not find a listen Window(LIW) from the tag...
i don't know what is the meaning of this..can somebody give me an advice how to solved it.... thank you in advance.....

///////////////////////////////////////////////////////////////////////////////

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.