From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ReadString() get time limit exceed to complete operation error

I have a device name Time Electronics 5075. I am trying to use the SimpleReadWrite.2010 in National Instruments\NI-488.2\Examples\DotNET4.0\SimpleReadWrite\cs to comunicate with the device.

I can open the connection and send commands to the device by using this code

 

device = new Device((int)boardIdNumericUpDown.Value,(byte)primaryAddressNumericUpDown.Value,(byte)currentSecondaryAddress);
device.IOTimeout = TimeoutValue.T100s;
device.Write("X0/A1/F0{13}");

 But I am stuck at 

 

stringReadTextBox.Text = device.ReadString();

 

I get the error "Time limit exceeded to complete operation."

I don't know exactly should I add 

 

device.Write("T/D{13}");

before the device.ReadString() or not. But I get the same error for both cases.

Some info: Visual Studio 2010, Measurement Studio 2013, NI.488.2, Windows 7 Pro

Any idea?

0 Kudos
Message 1 of 32
(6,995 Views)

Have you actually read the manual for this instrument or are you just guessing?

0 Kudos
Message 2 of 32
(6,968 Views)

I did read the manual. But it is quite short that you can see in the attachment. Thanks

0 Kudos
Message 3 of 32
(6,953 Views)

Hi,

 

instead of: device.Write("X0/A1/F0{13}");

 

try

 

device.Write("X0/A1/F0\n");

 

or

 

device.Write("X0/A1/F0\r");

 

Given the age of your device you might have to change some of the settings for your gpib board. (Bus timing for example)

 

Are you able to communicate with the device in NI-MAX?

 

Curt

 

 

0 Kudos
Message 4 of 32
(6,948 Views)

Hi,

 

I have adjusted my code according to your suggestions and now I can send commands to the instrument except reading data from it. I also changed the bus timing but it does not work. I cannot use NI MAX to communicate with the instrument. It just does not show when scanning instruments even though another TE 5025 instrument connects in the same GPIB cable and working normally. I guess the reason NI MAX does not work with TE 5075 sine it is compatiple with IEEE 488/1978 interface bus but NI GPIB USB HS is compatiple with IEEE 488.2. However EasyCal, a software that accompanies with the TE 5025 communicate normally with it. Any new idea?

 

Many thanks,

Thang

0 Kudos
Message 5 of 32
(6,924 Views)

Hi,

 

Did you try sending

 

device.Write("D\n");

 

before the readstring command?

 

Curt

0 Kudos
Message 6 of 32
(6,917 Views)

Hi,

 

Yes, I did. Hereafter is my actions (just for testing) by entering a single command into a text box and send to the instrument by pressing the Send button, i.e not hard code.

 

device.Write("A0\n"); // AUTORANGE OFF -> worked

device.Write("A1\n"); // AUTORANGE ON -> worked

device.Write("X1\n"); // 150ms -> worked

device.Write("X0\n"); // FILTER OFF -> worked

device.Write("F1\n"); // AC VOLTAGE ->worked

device.Write("F0\n"); // DC VOLTAGE -> worked

device.Write("T\n"); // TAKE READING -> worked

device.Write("D\n"); TRANSMIT VALUE TO IEEE -> nothing happens

 

Press Read button

device.ReadString(); -> timeout error

 

Thanks

Thang

0 Kudos
Message 7 of 32
(6,914 Views)

HI,

 

Have you used NI OI Trace or NI-Spy to track comms between the pc and meter?

 

Curt

0 Kudos
Message 8 of 32
(6,908 Views)

Hi,

 

There might be an issue with the terminating character.

 

In the manual it states

 

6.10 Terminating Character
All command strings must end with a terminator character for the string to execute. This may
be either a line feed or carriage return character as set by the T1 or T2 command.

 

but there's no T! or T2 listed in the command set

 

There's a V1 and V2

 

 

Maybe you can try sending one of these commands to set the terminating character

 

Jusu a thought

 

Curt

0 Kudos
Message 9 of 32
(6,905 Views)

Thank you Curt_C,

 

I have attached the screen capture of NI IO Trace. I just open the session, send two commands T\n and D\n to the device and readstring. The red one are errors on reading. The last one is close session.

 

I think \n is the correct terminator. It works with most of commands, just get stuck with ReadString.

 

Kind regards,

Thang

 

PS: I also attached GPIB Interface Properties for more info

Download All
0 Kudos
Message 10 of 32
(6,888 Views)