I have a TI TRF7960 EVM RFID Reader. I would integrate this reader into an own C# Program. I did read the whole documentation. I sent commands to the reader with the .net SerialPort Class. I can open the port and I can read and write with the .net SerialPort, but nothing happens. Must I use a special DLL like CP210xManufacturing.dll? Can I only use the .net SerialPort Class?
Here is my Code:
SerialPort() _serialPort = new SerialPort();
//Set properties
_serialPort.PortName = "COM21";
_serialPort.BaudRate = 9600;
_serialPort.Parity = Parity.None;
_serialPort.DataBits = 8;
_serialPort.StopBits = StopBits.One;
_serialPort.Handshake = Handshake.None;
_serialPort.ReadTimeout = -1;
_serialPort.WriteTimeout = -1;
//Open port
_serialPort.Open();
byte[] WriteToReader = new byte[12];
//Send Command RegisterWrite 01 0C 00 03 04 10 00 21 01 02 00 00 (ISO 15693)
WriteToReader[0] = 0x01;
WriteToReader[1] = 0x0C;
WriteToReader[2] = 0x00;
WriteToReader[3] = 0x03;
WriteToReader[4] = 0x04;
WriteToReader[5] = 0x10;
WriteToReader[6] = 0x00;
WriteToReader[7] = 0x21;
WriteToReader[8] = 0x01;
WriteToReader[9] = 0x02;
WriteToReader[10] = 0x00;
WriteToReader[11] = 0x00;
//Write to SerialPort
_serialPort.Write(WriteToReader, 0, WriteToReader.Length);
//Read from SerialPort
byte[] bReaderLength = new byte[_serialPort.BytesToRead];
_serialPort.Read(bReaderLength, 0, _serialPort.BytesToRead);
I open the port. Then you see I send the Command but I get no response from the SerialPort. BytesToRead are 0.
What is wrong?
Thank you.
Florian