05-27-2012 04:37 AM
Hi,
I am trying to have a setup where i can read continous data(should i say synchronous read) from the multimeter 3458a, atleast 1000 readings per second. I am using Usb/GPIB to connet to the instrument. The 3458a manual mentions that its possible to have 100,000 readings/sec over GPIB, i am barely getting 40 readings/ second. I am using IVI.Visa.interop to communicate with the instrument.
public void create_connection()
{
ResourceManager rm = new ResourceManager();
FormattedIO488 dmm = new FormattedIO488();
string address = "GPIB0::25::INSTR";
int numReadings = 1000;
// Open path to DMM
dmm.IO = (IMessage)rm.Open(address, AccessMode.NO_LOCK, 0, "");
showreadings.text = ""; // text box
for (int i = 0 ; i < numReadings ; i++)
showreadings.text += dmm.IO.ReadString(100);
}
I configured the instrument to generate 1000 readings/s with aper and timer setting. But when i try to read in as shown above it takes more time.
What is that i am doing wrong here?. why the data rate from the instruemtent to the pc is so slow?...do i need to use some other command for reading continously from the insturment?. Please help me out here, i am new to working with this instrument.
05-29-2012 10:49 AM
int numReadings = 50;
txt_CommandLine.Text =
"";
DMM1.IO.Clear();
DMM1.WriteString(
"reset", true);
DMM1.WriteString(
"end on", true);
DMM1.WriteString(
"TARM SYN", true);
DMM1.WriteString(
"INBUF ON", true);
DMM1.WriteString(
"EXTOUT RCOMP", true);
DMM1.WriteString(
"oformat ASCII", true);
DMM1.WriteString(
"APER 0.00001", true);
DMM1.WriteString(
"TIMER 0.0001", true);
DMM1.WriteString(
"nrdgs " + numReadings.ToString() + ", AUTO" , true);
DMM1.WriteString(
"TBUFF ON", true);
txt_Aper.Text =DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss:ffff");
byte[] Data = DMM1.IO.Read(8 * numReadings);
txt_QueryCommand.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss:ffff");
textBox3.Text += System.BitConverter.ToDouble(swapDouble(rawData, i * 8, 8), 0) + "\t{" + i + "}\r\n";
using byte[] rawData = DMM1.IO.Read(8 * numReadings); to read stream of chacters somehow helps improve the reading rate but now the readings are stopped or required number of bytes are not retured all the time. if i define 100 readings , it may return 800(8*numReadings) bytes sometimes but for most of the time, number of bytes returned are less.. Has anyone done this ?..to read continous stream of reading/data from instrument ...please help, i am really stuck bad here =(