Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Tektronix TDS1002 rise time measurment problem

Thanks for your reply.

I've been fiddling with it for the past hour and the problem appears to be in "Read Waveform to Array.vi". If I use the lightbulb on that (which also slows down its execution?) the rest of the program runs fine, no errors, and can be run many times. The problem still remains however that not all data points are being gathered onto the PC. It appears (though it might be a coincidence) that the more peaks that are displayed on the oscilloscope, the more data points the PC will gather (inspecting the code, and from the screenshot below this is 2513 in total, and 2500 waveform points, and sometimes it does gather 2500). However, sometimes it can be as low as around 150.

After this VI has been run the buffer is flushed so the rise time can be measured without error, however i really would like the whole waveform to be displayed. Im wondering whether to set the data points to manually be 2500 rather than let the program determine it, as the example is obviously written for a general audience. Im starting to get the feeling i should write from scratch, however i feel that its easier to learn by tweaking an example.

Perhaps the read visa function is not reading all the points before moving on? Im not sure if it makes a difference but by typing the curve? command into hyperterminal and seeing the binary results being displayed it takes a good few seconds for it to be totally written out. Im not sure if thats a limitation of hyperterminal or the fact that the read buffer is slow. Any ideas? I really appreciate the help so far, im almost there!

Message Edited by Exulus on 01-23-2007 08:17 AM

Message Edited by Exulus on 01-23-2007 08:19 AM

0 Kudos
Message 11 of 30
(2,661 Views)
The software calculates the number of bytes to read based on the start and stop point and also assumes that the data type is binary. If you weren't getting binary data, the results would look pretty strange so I'll assume that there is a problem in the basic calculation. You should be safe in specifying some large number of bytes to read. One thing that you can do is wire an indicator to the VISA return count output. This will tell you how many actual bytes were read and the difference between that and the number of bytes that is being calculated could help.
0 Kudos
Message 12 of 30
(2,651 Views)
How do you mean? The VISA read special? I probed that and got this:
 
:CURV #42500ÂÂÂÂÁÁÁÂÂÂÂÂÂÁÁÂÂÂÂÂÁÂÁÂÁÂÂÂÁÂÂÂÂÃÂÃÂÁÂÂÂÂÂÂÁÂÂÂÂÂÂÂÂÁÁÂÂÂÂÂÁÁÂÂÁÂÂÂÁÁÁÂÂÂÂÂÁÂÁÁÁ>>>>>>>>>>?>>>>>
>>>>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>>?>>=>>>>>>>>>>>>>>>=>>>>>>>>>>>>>>>>>>>>>>>
>>>>???>>>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>>>>>>>>>>?>>>>>>?>>>=>>>>>>>=>>>>>>>>>>>>>>>>>>>
>>>>=>>>>>>>>>>>>?>ÁÁÂÂÂÂÂÁÁÁÁÂÂÂÂÂÂÂÁÁÂÂÂÂÂÂÁÁÂÂÂÂÂÁÁÁÁÂÂÂÂÁÁÁÂÂÂÂÂÂÁÁÂÁÂÂÂÂÂÂÂÂÂÂÂÁÁÂÂÂÂÃÂÂÂÂÂÂÂÂÂÂÁÂÁÂÁÂÂÂ
ÁÁÁÁÂÂÁÁÂÁÁÁÂÃÂÁÂÁÂÂÂÂÂÂÁÁ
ÂÁÂÂÂÁÁÂÂÂÂÂÂÂÁÁÂÁÂÂÂÂÂÂÁÂÂÂÂÂÁÁÁÁÂÃÃÂÂÁÁÂÂÂÂÂÁÂÁÂÂÂÂÂÂÁÂÁÂÂÂÁÂÁÁÂÂÃÂÂÂÁÁÂÂÁÂÂÁÂÁÂÂÂÂÂÁÂÁÁÂÂÂÂÂÁÁÂÁÂÂÂÂÂÁÁÂÂÂ
ÂÂÁÂÁÁÂÂÂÁÁÁÂÂÂÃÂÂÁÁÁÂÂÂÂÂÂÂÁ>>>?>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>>>>>=>==>>>>>>>>?>>>>>>>>>>>>>>>>>>>>=>>?>>?>>>
>>>>>>>>>>>>>>>>>>>>>>>>=>>?>>>>>>>>>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>?>>>>>>?>>>>>>>>>>>=>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>>?>>>>>>>>>>>>>>>>>>>>>>>?ÁÂÂÁÁÁÂÂÂÂÁÁÂÂÂÂÂÂÂÁÁÁÂÂÂÂÂÁÂÁ€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€>>?>>>=>>>>>>>>>>?>>>>>>>>>>>==>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>=>>>?>>>>>>>>>>>>>>>>>>=>>>>>>?>>>>?>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>?>>>>>>>>>>>>=>>ÂÂÂ
ÁÂÁÂÂÂÂÂÁÁÁÁÂÂÂÁÁÁÂÁÂÂÂÁÂÂÂÁÂÂÂÂÁÁÂÂÂÂÂÂÂÂÂÂÂÃÃÂÂÁÂÁÂÂÂÂÂÁÁÂÂÂÂÂÂÂÁÂÂÂÂÂÁÁÁÁÂÂÂÁÂÁÂÂÂÃÂÁÂÁÂÁÂ
ÂÃÂÂÂÁÁÂÁÂÂÂÁÁÂÂÂÁÃÂÁÁÁÂÂÂÂÂÂÁÂÁÂÂÂÂÂÁÂÂÂÂÂÁÂÁÂÂÂÂÂÂÁÁÁÁÂÂÂÂÂÁÂÂÂÂÂÂÂÂÁÁÂÂÂÂÂÁÁÁÂÂÂÂÁÁÂÁÁÂÂÃÂÁÂÁÂÂÂÂÂÁÂÁÁÂÂÃÂÁÁÁ
ÁÂÂÂÂÂÁÂÂÂÂÂÂÁÂÁÁÂÂÂÂÂÁÁÂÁÂÁÂÂÁÂÁÂÂÂÁÂÂÁÂÂÂÂÂÂ=>>>>>?>>>>>>>>>>>=>>?>>>>>>?>>>>>>>>>>>>>>>>>>>>>>>>??>>>==>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>=>>>>>>>>>>>>>?>>>>>>>?>>>>>>?>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>?>>>>>?>?>>>>>?>>>>>>>>>>>>>>>>>>>>=>>>>>>>>>>>>?>>>>>>>?>>>>>>>>>>>>>ÂÂÂÂÂÂÂÂÁÂÂÃÂÂÁÁÂÂÂÂÁÁÁÂÂÂÂÃÁÂÂÁÁ
ÂÃÃÂÂÁÂÂÂÂÂÂÂÁÁÂÂÂÂÂÂÁÁÂÂÂÂÂÂÁÁÁÂÃÂÁÂÁÂÁÂÂÂÂÁÂÂÂÂÂÂÂÂÁÂÁÂÁÂÂÂÁÁÁÁ
ÂÂÂÂÂÁÂÂÂÂÂÂÂÁÂÁÂÂÂÂÁÁÂÁÂÂÂÂÁÂÂÂÂÂÂÂÂÁÂÁÂÂÂÁÁÁÂÂÂÂÂÂÂÁÁÂÁÂÂÂÂÁÂÁÁÂÂÂÁÂÁÁÂÂÂÂÂÂÁÁÁÂÂÁÂÁÂÂÁÂÂÂÁÂÂÁÂÂÂÂÁÁÁÂÁÂÁÂÂÁÂ
ÂÂÂÂÂÂÁÂÂÁÂÂÂÁÂÂÁÁÂÂÂÂÁÁÁÂÁÂÂÂÂÂÂÁÂÂÁÂÁÁÂÂÂÂÂ>>>>>>>?>>>>>>>>>>>>>>>>>>>>>>>>>>>=>>>??>>>>>>>>>>>>>>??>>>>>>>>>
>>>>>>??>>>>>>>>>>=>>>>>>>>>>??>>>>>>>>>>>>>>>>>>>>>>>?>?>>>>>?>>>>>>>>?>>>>>>>?>>>>>>>>>>=>>>>>>>>>>>>?>>>>>>>?>
>>>>>>>>>>>>>>>>>>>>>?>>>>>>>>>?>>>>>>?>>>>=>>>>>>>>>>>?>>>>>>>>>>>>>>>>>>>ÁÁÂÃÂÂÂÁÂÂÁÂÂÂÂÁÁÂÂÂÂÂÁÂÂÁÁÂÂÂÁÁÁÁÁÂÂ
ÂÂÁÂÁÂÁÂÂÂÂÂÁÂÂÂÂÂÂÁÁÂÂÂÂÂÂÁÁÂÂÂÂÂÂÁÁÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÁÁÂÂÂÂÂÂÁÁÂÂÂÂÂÁÁÂÂÂÂÂÂÁÁÂÂÂÂÂÁÂÂÂÂÂÂÂÂÂÁÂÂÂÂÂÂÁÂÁÂÂÂÂÂÂÁÂÂÂ
ÂÂÂÁÁÁÂÂÂÂÂÂÁÂÁÂÁÃÃÂÁÁÁÂ
 
Which i believe is to be expected as it is binary data and doesnt look too good in a probe.
 
I've realised that when i have an RC circuit set up (with square wave input) , the waveform program works fine for anything 1ms and faster, however slower than that and the count starts dropping from 2500. However, If I just have a resistor circuit and a square wave put in, I can select whatever time base i want, i've just tried 500ms and it gave back 2500 read points (half the waveform was corrupt but that is probably due to scan mode?).
 
This is really starting to get quite bizzare!

Message Edited by Exulus on 01-24-2007 04:22 AM

0 Kudos
Message 13 of 30
(2,633 Views)

No, what I wanted probed was the return count output which will have the exact number of bytes read and not the number of bytes requested. In any case, my previous answer about hard coding some large number of bytes to read would probably not work because you have a serial connection and forgot that for a moment.

I wish I had access to the actual scope but that would mean that I would have to take one away from one of the debug techs on the floor for some amount of time. There are a couple of things that you can try. First, have you simply tried changing the stop point? Instead of 2500, try some higher number and see if you get an error. The other thing that could be done is place a VISA Bytes at Serial Port just before the VISA Read in the TKTDS1K2K Read subVI. This function will report the number of bytes that are in the serial port buffer. If there is a difference between this value and the number of bytes that has been calculated, then that will tell us something.

Message 14 of 30
(2,627 Views)
Cheers! I realised the VISA read in the waveform to array vi was a sub vi in itself which didnt do anything particularly useful, so i have substituted it for a standard read. I probed the byte counts out and they change as usual to anything from 2500 and below. I will try your suggestion re:visa bytes at serial port on Friday as i do not have any free time between now and then (unless i can quickly get in tomorrow). Thanks for your help! I had a project supervisor and expert at Labview both have a look for 2 hours today and neither could solve the problem either..its odd.
0 Kudos
Message 15 of 30
(2,613 Views)
I would like to get to the bottom of this issue so that we can address it in the driver if necessary.  I do want to make you aware of the IVI driver (also called tktds1k2k) that is available in LabVIEW 7.1 and later, and a Plug and Play (project-style) driver (called Tektronix TDS 200 1000 2000 Series) available for 8.0 and later.  The project-style driver is fairly new and includes several improvements over the older tktds1k2k driver.  If you have LabVIEW 8.0 or later, I highly recommend you use this driver.
 
As for the tktds1k2k LabVIEW driver, the special Read VI is important for serial communication.  This VI temporarily disables the termination character while reading waveform data.  Some part of the binary data in the waveform may be equivalent to an ASCII linefeed, which would cause VISA to stop reading from the instrument if a linefeed termchar were enabled. I'm having a difficult time understanding the particular issue as described so I have saved the Fetch Waveform VI from the new project-style driver back to version 7.0.  Please let me know what version of LabVIEW you are using and if you are any more successful with this attached VI.  If so, it will help us identify the issue to fix in the older driver.

Message Edited by Jason Hobbs on 01-24-2007 06:14 PM

0 Kudos
Message 16 of 30
(2,611 Views)
Ah, I see. I'll put the special read back in then.
 
I had originally been working with the plug and play style drivers however they did not work at all, generating framing errors and all sorts. As soon as i can get in the lab to try this i will,it will either be today or tomorrow.
 
The jist of the problem is that leaving the timebase at 50ms (what we were working with yesterday), and putting a square wave on the oscilloscope allows Labview to capture all the data, however changing the square wave to a sine wave, or putting a capacitor in the circuit so there is some rise time, makes Labview only seem to capture about half the data. The rest is left in the read buffer. Either by using the visa interactive control to manually read the rest of the buffer, or flushing the buffer, or creating a quick VI to flush/close the session fixes the problem.
0 Kudos
Message 17 of 30
(2,600 Views)
Hi, thanks for the help. I have version 8.0. I just downloaded the VI and tried running it, I received the error:
 
-1073807339
VISA Read in tktds1k2k Fetch Waveform.vi
 
I have tried integrating it into my program (replacing "read waveform to array.vi") however although it does not give an error it seems to return nothing either. I have attached some screenshots of the program so you can see the graphical output, and I have also attached the VI i have made. I hope this helps.
Download All
0 Kudos
Message 18 of 30
(2,593 Views)
The VI and another screenshot. Notice the weird parts to the square wave also gathered for 100ms. they are definitely not present on the scope!!
Download All
0 Kudos
Message 19 of 30
(2,592 Views)
I've played with this some and have been more successful with the project-style driver for LabVIEW 8.0.  Can you try this driver and let me know the results?  I have found serial communication with the instrument to be inconsistent, even with proper settings in either driver. Do you have access to a GPIB controller to see if that improves your success rate?
0 Kudos
Message 20 of 30
(2,564 Views)