i got an cobra 2 with RS232. serial
i got it connected with this code :
// This is the function that will be called when data is available
// on the serial port.
// This function will not be called again if the data isn't read in.
void serialPort_DataReceived(GT.Interfaces.Serial sender, System.IO.Ports.SerialData data)
{
// Create a buffer that is the length of the data that is available
// the BytesToRead variable tells us how many bytes are waiting in a buffer.
byte[] readData = new byte[rs232.serialPort.BytesToRead];
// Now we read the data into the buffer we just created, starting at the
// first byte.
rs232.serialPort.Read(readData, 0, readData.Length);
// Use the data that you just read however you need to
}
now it says :
// Use the data that you just read however you need to
im quite nooby and i cant figure out how to write these bytes to an string. i want to print the string on the char display i got.
can anyone help me out?
this is what i made :
string printdata = Convert.ToBase64String(readData);
char_Display.PrintString(printdata);
Debug.Print(printdata);
but i get nothing but blanks.
or im sending my data worng. im trying to send data using my PC COMPORT1.
using “hyperserialport.”
Thanks!!