I've written an application using C# which queries an Instron 8800 controller (very old controller). While the program is running I get seemingly random timeout errors (error code defined in title), which eventually lead to an EABO error. The program will typically start and query fine for 2 - 3 iterations, and then give the aforementioned timeout error. It will then work for another few iterations and timeout again.
I've adjusted bus timing values per Instron's suggestion, but to no avail--does anyone have any ideas? I've attemped using both the GpibInterface and MessageBasedSession classes.
Code below:
using NationalInstruments.VisaNS;
namespace niVISAInstronTest
{
public partial class Form1 : Form
{
private MessageBasedSession mbSession;
private GpibInterface instron_GPIB;
private void button1_Click(object sender, EventArgs e) { timer_Cyclic.Enabled = true; textBox1.Enabled = false; button1.Enabled = false; GPIB_Address = textBox1.Text; instron_GPIB = new GpibInterface(GPIB_Address, AccessModes.NoLock, 0, false); instron_GPIB.SendEndEnabled = true; instron_GPIB.Timeout = 10000; } private void timer_Cyclic_Tick(object sender, EventArgs e) { WriteToConsole(Query("Q210").ToString()); } /// <summary> /// 500ms timeout seems to work best so far /// </summary> /// <param name="query"></param> /// <returns></returns> public double Query(string query) { double response = -1; try { //response = double.Parse(mbSession.Query(query)); instron_GPIB.Write(query); string response_s = instron_GPIB.ReadString(); response = double.Parse(response_s); return response; } catch (Exception EX) { WriteToConsole(EX.GetBaseException().ToString()); } return response; } public void WriteToConsole(string msg) { textBox_Console.Text += Environment.NewLine + msg; textBox_Console.SelectionStart = textBox_Console.TextLength; textBox_Console.ScrollToCaret(); }