Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

readbytearray timeout

Hello, I am using the command readbytearray to read values from my instrument (hp8902). Once in a while the read hands up. I have set the iotimeout to 1s, but it never aborts. How can i force and arbort of the readbyte array?

 

Thanks,

 

RJJ

0 Kudos
Message 1 of 4
(5,535 Views)

Hi there,

Make sure the call is outside an infinitely loop. After the timeout the function should error out but if the error is not being catch then that may be another cause. Since ReadByteArray is part of the VISA driver check if there is not another error involved using the IO trace tool.

I hope this helps

Alejandro C. | National Instruments
0 Kudos
Message 2 of 4
(5,496 Views)

Alejandro,

 

 

Using the IO trace, the last command out is a read to the receiver. The receiver  never replies to the laptop. How can I force a timeout error?

I added a timer, but the timer never goers off either.

 

Thanks,

 

 

RJJ

0 Kudos
Message 3 of 4
(5,488 Views)

You can play with the openTimeout parameter on viOpen to setup the time period before generating an error.

 

I encourage you to take a look at the examples (Document ID: 2HH9BUQS shows where to find them on your PC), they can give you ideas for error catching.

Alejandro C. | National Instruments
0 Kudos
Message 4 of 4
(5,471 Views)