10-06-2020 03:17 AM
Use "SimpleReadWrite.2015" combine "Micosoft Visual Studio 2017".
Sometimes it will get error message at random part (Write part).
Error Message:
Ivi.Visa.IOTimeoutException:'Exception of type'Ivi.Visa.IOTimeoutException' was thrown'.
How can I do to let it fix this issue?
10-08-2020 04:18 PM
Timeout often occurs on read because it can take time to prepare the data (especially when the measurement itself is triggered by the read command) but if it occurs on write then check your connections first. Or maybe the device is still busy with processing previous commands if you send many commands too fast.
First you can set a longer timeout delay in the visa settings.
Otherwise there is a simple way to make the program handle such exception: first call the Visa "Clear" function (to flush the device IO buffers so that the faulty command won't interfere and the device will be ready to receive a new command) and then repeat the whole sequence after some time. I'm not using ivi (I mean I use Visa without the ivi layer) so I can't give you the exact syntax but the scheme might be something like (here in a vb-like pseudocode):
repeat=false
do
try
write command
read data
catch IOTimeoutException
repeat=true //set repeat flag
end try
if repeat then
. device.clear
wait a short delay (say 10ms)
endif
until not repeat (you may add "or userabort")
This code should recover gracefully from intermittent timeout errors, whether on write or read.
04-24-2022 10:13 PM
Hello Sir,
Thanks for your sharing and we can use repeat mechanism to reduce timeout issue. Any configuration VISA session to fix it ?
01-09-2023 12:44 AM
can you help me
06-14-2023 09:36 AM
Can you query the instrument in NIMAX without any issue?
one assumption is that you might need to enable termination character if instrument is not connected through GPIB
06-14-2023 10:06 AM
thank you,i have solved it by enable termination character
09-18-2023 09:45 PM
兄弟你这个情况可能是因为你的仪表厂家没有内置结束符,你需要手动给一个“\n”的结束符,然后记得转义。
然后需要在写入读取命令之前加上一个使结束符标识为true的语句:
mbSession.TerminationCharacterEnabled = true;
就可以了,记得每一句读取命令之前都要加这一句
这个问题确实很坑,我之前也是折腾了很久,还是问了仪器公司的人才知道。
09-18-2023 10:46 PM
感谢回复,之前自己偶然发现有个终止符使能,确实使能了终止符后就没那个报错了,虽然偶尔还有这个报错,但我没管,反正已经和我没关了