//Header is ASCII, get 2nd byte and convert to int.
StringBuilder sCount = new StringBuilder(responseString, i++, 1, 1);
int count1 = int.Parse(sCount.ToString());
//now read the bytecount string and convert to int
StringBuilder sBytes = new StringBuilder(responseString,i,count1,count1);
int count2 = int.Parse(sBytes.ToString());
//set the index of the start of the data
i += count1;
//return the string with the header stripped off
strReturn = responseString.Substring(i);
}
return strReturn;
}
}
}
Example 4 – Discussion
1. Output result values are the same for Native mode and Lightning mode (since we put the unit in HOLD) but the delimiters are different.
• Native mode uses a comma to separate the two values at each frequency and a newline (\n) to separate pairs of values while Lightning mode separates each value with a comma. The display was set for Smith chart, impedance.
Example 4 – Listing and Graph Outputs
OFD command output on left. Resultant Smith Chart on right.
2. The OFD command returns an arbitrary block containing either ASCII or Binary data depending on the currently selected format.
• In this example we select ASCII using the FMA command.
• The Arbitrary block header is stripped off with the stripHeader(string responseString) function.