Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB .NET IOTimeout

Here are 3 questions related to the IOTimeout property of the NationalInstruments.NI4882.dll assembly in MeasurementStudio2003.NET.
 
1.) Using the IOTImeout property as a property
 
The following code results in a compile time error: "The name T1s does not exist in the class or namespace 'MyApplication.Form1'
 

board =

new Board(0);

board.IOTimeout= T1s;

0 Kudos
Message 1 of 4
(4,214 Views)

I am replying to my own posting subject GPIB .NET IOTimeout because my message was prematurely submitted (I don't know how) before I finished typing my questions.  It would be useful if a forum moderator can stitch these two postings together .

Product: Measurement Studio2003.NET, NationalInstruments.NI4882.dll assembly

Bus: GPIB

Language: C#

1.) Using the IOTImeout property as a property
 
The following code results in a compile time error: "The name T1s does not exist in the class or namespace 'MyApplication.Form1'
 
board = new Board(0);

board.IOTimeout= T1s;

Here IOTimeout isn't acting as a traditional property in C# where you can set a property with an assignment statement.

Question 1: how do I set the IOTimeout property?

2.) What's the difference between Board.IOTimeout and Device.IOTimeout?  When should each be used?

3.) I am trying to send the *IDN? query to all instruments on the bus, found previously with Board.FindListeners();

One instrument is old and doesn't respond to *IDN?, so it results in a timeout (which I am trying to shorten with the IOTimeout property).

Question 3: What's the best way to deal with instruments that don't respond to the *IDN? query?

 

0 Kudos
Message 2 of 4
(4,210 Views)

Hi Tony,

1)  The correct assignment statement is:

board.IOTimeout = TimeoutValue.T1s

2)  The two different IOTimeout parameters are used with either device-level functions or board-level functions.  Look at the last section of the GPIB Messages Tutorial for an expanation of device-level vs. board-level.

3)  Some older instruments that are 488.1-compliant but not 488.2 compliant may not respond to *IDN?  The best way to deal with instruments that don't respond to the *IDN? query is to either do what you are doing which is shorten the timeout value and just wait for the wuery to timeout, or to not query the devices.  In most cases the default 10 second timeout value is overkill.  You should be able to set the timout value to something like 500ms and still be able to catch all 488.2 devices.

0 Kudos
Message 3 of 4
(4,164 Views)
Hi,

if no *idn? command exist, you need your instrument documentation (
remote programming manual ... ) and to be sure that the terminator or
EOI is ok

instead of using GPIB API functions, privilege a direct communication
tool ...

Programming with IO timeouts in GPIB is a severe handicap in terms of
bandwidth so investigating a bit is good fo the future of your programs
....

Regards,

FG

0 Kudos
Message 4 of 4
(4,155 Views)