Skip navigationLog in to create and rate content, and to follow, bookmark, and share content with other members. Hi All,I have been trying to download IQ data to E4438C over LAN but I got "-103, Invalid Seperator" Eror. I could not locate the soruce of error in my code. Any help would be appreciated. I attached my code.RegardsCengiz EKEN
StreamWriter sr = new StreamWriter(Directory.GetCurrentDirectory() + "/IQData.txt");
const int NUMSAMPLES = 500;
byte[] iqBuffer = new byte[NUMSAMPLES * 4];
short[] idata = new short[NUMSAMPLES];
short[] qdata = new short[NUMSAMPLES];
short ivalue;
short qvalue;
int numsamples = NUMSAMPLES;
for (int index = 0; index < numsamples; index++)
{
idata[index] = (short)(23000 * Math.Sin((2 * 3.14 * index) / numsamples));
qdata[index] = (short)(23000 * Math.Cos((2 * 3.14 * index) / numsamples));
}
for (int index = 0; index < numsamples; index++)
{
sr.Write(idata[index] + " ");
sr.WriteLine(qdata[index]);
sr.Flush();
}
sr.Close();
for (int index = 0; index < numsamples; index++)
{
ivalue = idata[index];
qvalue = qdata[index];
iqBuffer[index * 4] = (byte)((ivalue >> 8) & 0xFF);
iqBuffer[index * 4 + 1] = (byte)(ivalue & 0xFF);
iqBuffer[index * 4 + 2] = (byte)((qvalue >> 8) & 0xFF);
iqBuffer[index * 4 + 3] = (byte)(qvalue & 0xFF);
}
String iqBufferStr = System.Text.Encoding.UTF8.GetString(iqBuffer);
writeLine(":MEM:DATA:UNPR \'WFM1:myDataDosya\' #" + iqBuffer.Length.ToString().Length + iqBuffer.Length + " " + iqBufferStr);
PS:I got this example E4400-90627.pdf "Agilent Technologies Signal Generators Creating And Downloading Waveform Files for c++ and converted to c#
I Have found why "-103,Invalid seperator" occurs. The instrument command line should be
I forgot the ",".But now another problem. I think I could not send the I/Q data. Because, although there is a data download UI on Signal Generator, Progress Bar remains at %0 and some time later it disappears without completing the download.
I think I have to implement MATLAB's "binblockwrite(...)" or VEE's "WRITE BINBLOCK Int16" command in C#. Is anyone out there who did that before?
Any Help?
Regards
Cengiz EKEN