是德科技
直播中

王锦霞

7年用户 960经验值
私信 关注
[问答]

ReadIEEEBlock不工作怎么办

我正在尝试读取DSA-X 93304Q上的一个跟踪,并且使用“WAV:FORM ASCII”和Instrument.ReadString工作正常我想加快传输过程,所以我试图使用“WAV:FORM WORD”
,但我的Instrument.ReadIEEEBlock似乎没有返回任何东西。
VB.NET代码:###### Dim Instrument as new Ivi.Visa.Interop.FormattedIO488 Dim VISAMgr as new Ivi.Visa.Interop.ResourceManager Instrument.IO = VISAMgr.Open(“USB0 :: etc.etc”)
Instrument.WriteString“:SYST:HEAD OFF”Instrument.WriteString“:WAV:STR ON”Instrument.WriteString“:WAV:SOUR CHAN1”Instrument.WriteString“:WAV:FORM WORD”Instrument.WriteString“:WAV:DATA?”
Dim Data as Object = Instrument.ReadIEEEBlock(Ivi.Visa.Interop.IEEEBinaryType.BinaryType_I2)######这不返回Data变量,在IO Trace中,我在ReadIEEEBlock命令中看到以下内容:viSetAttribute TerminationCharacterEnabled,VI_FALSE
viRead“#”viRead“0”viSetAttribute TerminationCharacterEnabled,VI_FALSE在作用域上或代码运行时没有报告错误。
有任何想法吗?

以上来自于谷歌翻译


     以下为原文

  I'm trying to read a trace off a DSA-X 93304Q, and it's working fine using "WAV:FORM ASCII" and Instrument.ReadString

I want to speed up the transfer process, so I attempted to use "WAV:FORM WORD", but my Instrument.ReadIEEEBlock doesn't seem to be returning anything.

VB.NET Code:
######
Dim Instrument as new Ivi.Visa.Interop.FormattedIO488
Dim VISAMgr as new Ivi.Visa.Interop.ResourceManager
Instrument.IO = VISAMgr.Open("USB0::etc.etc")

Instrument.WriteString ":SYST:HEAD OFF"  
Instrument.WriteString ":WAV:STR ON"  
Instrument.WriteString ":WAV:SOUR CHAN1"
Instrument.WriteString ":WAV:FORM WORD"  
Instrument.WriteString ":WAV:DATA?"
Dim Data as Object = Instrument.ReadIEEEBlock(Ivi.Visa.Interop.IEEEBinaryType.BinaryType_I2)
######

This returns nothing into the Data variable, and in IO Trace I see the following during the ReadIEEEBlock command:
viSetAttribute TerminationCharacterEnabled, VI_FALSE
viRead "#"
viRead "0"
viSetAttribute TerminationCharacterEnabled, VI_FALSE

There aren't an errors reported on the scope, or while the code is running. Any ideas?  

回帖(2)

徐音之

2018-9-11 16:35:57
我相信问题是ReadIEEEBlock不理解“:WAV:STR ON”返回数据的方式。
我认为它看到“#”,然后看到“0”表示长度,然后停止。
如果您使用“:WAV:STR OFF”,它应该可以工作。
如果您需要使用“:WAV:STR ON”(由于OFF时500,000,000点限制),您可以使用VISA API和非格式化I / O viRead函数来解释流ON数据。

以上来自于谷歌翻译


     以下为原文

  I believe the problem is that ReadIEEEBlock doesn't understand the way data is returned with ":WAV:STR ON". I think it sees the "#", then sees the "0" for length, and stops.

If you use ":WAV:STR OFF", it should work.

If you need to use ":WAV:STR ON" (because of the 500,000,000 point limitation when OFF), you could use the VISA API and the non-formatted I/O viRead function to interpret the streaming ON data.
举报

王锦霞

2018-9-11 16:53:32
引用: xiuyuan56789 发表于 2018-9-11 16:12
我相信问题是ReadIEEEBlock不理解“:WAV:STR ON”返回数据的方式。
我认为它看到“#”,然后看到“0”表示长度,然后停止。
如果您使用“:WAV:STR OFF”,它应该可以工作。

谢谢,这完美地运作。
速度提升与ASCII相比令人难以置信。

以上来自于谷歌翻译


     以下为原文

  Thanks, that works perfectly. The speed improvement vs ASCII is incredible.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分