02-15-2007 01:36 AM
02-15-2007 10:05 PM
It seems like you are trying to read an IEEE488.2-formatted block response data, which begins with #nXXXXXXXX style header. This is size-oriented data format I think it is easier to use viRead() rather than viScanf().
To read a 488.2 block resoponse, read the first 2 bytes (which shall be "#<number>"), read the next <number> bytes (which is normally 1 to 9 bytes such as "00004096" or any) to acquire the info about data entity length. Then finally read the remaining data entity.
For example, if the response data begins with #800004096XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..., the "X" array must have 4096 bytes without newline (LF) termination. In this case you can read it by splitting to 3 time intermitted readings using size-oriented viRead() function.
07-17-2007 02:57 AM
Hi Makoto,
I've met the same problem of Roman_Vasiliev, and I'm new to Oscilloscope too. Could you give an example that can store the waveform to an array? I've modified the source code, it occurs error when it reads the very character after #, I cannot figure how this happen.
Makoto wrote:It seems like you are trying to read an IEEE488.2-formatted block response data, which begins with #nXXXXXXXX style header. This is size-oriented data format I think it is easier to use viRead() rather than viScanf().
To read a 488.2 block resoponse, read the first 2 bytes (which shall be "#<number>"), read the next <number> bytes (which is normally 1 to 9 bytes such as "00004096" or any) to acquire the info about data entity length. Then finally read the remaining data entity.
For example, if the response data begins with #800004096XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..., the "X" array must have 4096 bytes without newline (LF) termination. In this case you can read it by splitting to 3 time intermitted readings using size-oriented viRead() function.
07-17-2007 07:48 PM
Sorry but I do not have Tek DSO models, so I can't provide example codes here. If the waveform response data sent from your instrument is IEEE488.2/SCPI binary block format, the same #dnnnnnnnnXXXX.... rule must be applied. This is one of the IEEE488.2/SCPI standard data format and not specific to Tek scopes.
Actually what data image (expressing a BYTE array) do you receive the instrument? Probably it begins with "#" and some decimal characters.
07-17-2007 07:59 PM
07-17-2007 08:15 PM - edited 07-17-2007 08:15 PM
このメッセージは 07-18-2007 10:19 AMに Makoto が編集しています。
07-17-2007 11:47 PM
Yes, I use viRead to read as many data as it can, and it turns out that only 7 characters are read. I think that's it. TekVISA has something called "talk listener" thing does the same thing as NI-SPY, I suppose. And it gets all the message I need.
When using viScanf, only the first sharp symbol is read. So I think it's not an option here.
07-23-2007 03:16 AM
07-23-2007 07:04 AM
@Makoto wrote:
> With LabVIEW, I can read the whole waveform but LabVIEW is not an optionIf you could acquire the whole waveform from LabVIEW program, try to capture the successfull traffic. Then compare it with the traffic log on your problem case. Something must be different.
Yes, I've saved some traffic as in the attached file, but it has some very strange visa commands which I didn't use and how to use them. e.g., viGetAttribute.