NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

利用visa与USB接口程控电源通信读电压时出现超时错误

已解决!
转到解答

第一次用visa控制仪器因此不懂得很多,希望各位大神能帮帮忙。

在labview编程环境下,我用visa提供的read and write的demo控制一台RIGOlDP1308A的程控电源时,当发出识别器件的命令“*idn?”时,visa能读回字符串;但当我发出测量电压指令时“meas p25v”(测量正25V输出通道电压值)时显示错误:     VISA:(hex 0xbfff0015)Timeout expired before operation completed.

有人说是字符串个数的问题,但USB的属性节点中没有可提取字符串长度的啊?

0 项奖励
1 条消息(共 6 条)
10,088 次查看

If you are using VISA Read, what is the set value for Byte Count? How many bytes of data do you expect from the device after sending the command?

 

If, for example, you set Byte Count = 100, but the VISA Read is unable to receive 100 bytes of data returning from the device (after command is sent), there will be timeout error. 

Message Edited by ian fung on 01-21-2010 12:22 AM
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
2 条消息(共 6 条)
10,079 次查看

非常谢谢你的回复,我发现当我写入meas p25v这个命令,读寄存器中好像没有1个字节的返回值。

因为当我首先写入*idn?命令,返回了器件信息“rigol technologies,DP1A111500130,...”无错误。此时我不重启程控电源(读寄存器中值未清除),继续发出meas p25v命令。此时不再出现错误但没有返回电压值,仍然返回了器件信息。这是不是说“meas p25v”根本就没有返回值,所以没有改写读寄存器中内容,而开始出现错误是因为寄存器中根本没有一个字节?

请指教.

0 项奖励
3 条消息(共 6 条)
10,060 次查看

Are you able to post your code here?

 

PS: If you are performing continuous VISA Write and Read, please place the VISA Open and VISA Close outside the Read/Write loop i.e. VISA Open --> (Write/ Read loop) --> VISA Close. 

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
4 条消息(共 6 条)
10,055 次查看

我并未连续执行读写,只是依次输入两次命令分别运行了两次,所以仪器应当可以收到我的命令。

后来发现编程手册上的标准格式是“MEAsure[:VOLTage][:DC]?[{P6V|P25V|N25V}]”,后来我输入"meas:volt:dc? p25v"仪器返回了具体电压值。是我的粗心所致,你的建议给了我很大帮助,不好意思耽搁了你的宝贵时间。谢谢。

5 条消息(共 6 条)
10,047 次查看
解答
已被主题作者 pyz 接受
So, it was that the SCPI command(s) being incorrectly entered 极度高兴的表情
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
6 条消息(共 6 条)
10,040 次查看