Read data
// using System.Runtime.InteropServices;
private void ftspcControl1_OnReceive(object Sender, uint Count)
{
try
{
IntPtr Ptr = IntPtr.Zero;
byte[] ReadBuffer = new byte[Count];
Ptr = Marshal.AllocHGlobal((int)Count);
ftspcControl1.Read(Ptr, Count);
Marshal.Copy(Ptr, ReadBuffer, 0, (int)Count);
TextBox_Data.Text =
System.Text.Encoding.ASCII.GetString(ReadBuffer);
}
catch (FTSPCException E)
{
MessageBox.Show("Error " + E.ErrorCode.ToString() + "\r\n" +
E.ErrorSource, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}