Hi All,

First post on here hoping you guys can help as I'm pulling my hair out with this one.

What I trying to do seems simple in my head.

I have a project using a RFID board in which I'm trying to eventually get to the stage where I can program some information onto the card.

The thing is it's a little complicated for a learner like me to complete the Authentication of the card which involves sending a code something like ":002000" which puts the RFID board into "request mode"

I can send the commands to the board via a textbox and outputting via the serialport1.writeline

the problem I have is that the board requires a carrige return to denote the end of the ascii code and I have to physically hit enter in the textbox for it to recognise a carrige return.

Now Obviously I won't have a textbox in the finished program as the procedure will be automated from a button click, this being the case how do I output a carrige return via the serial port Iv'e tried all the usuall suspects for ascii equivelent but nothing. I will also need to compare the ascii codes coming back frm the RFID borad to see what VB code to execute depending on what code is returned so is there an easy way to do a comparison of the strings

Any help would be much appreciated as this could be a matter of keep customer or loose customer.

Thanks in advance.


Re: Visual Basic Express Edition Comparing Ascii Code String

Carsten Kanstrup

serialport1.NewLine = Chr(13)

This replaces the default newline character, which is LineFeed, with CR. Then you can just use ReadLine and WriteLine.

Re: Visual Basic Express Edition Comparing Ascii Code String


You might want to try Environment.Newline()... Some people prefer it over Chr(13) & Chr(10).

Re: Visual Basic Express Edition Comparing Ascii Code String


Thanks guys, very helpfull.

It's always the simplest of soloutions!

Any ideas on comparing strings or byte arrays would be much appreciated

Thanks again,