Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Controling Tektronix TDS 1002 using VISA/rs-232

Hi,
I can t find the way of controling my scope using labview 6.1 with visa 3.0 using rs-232. I know evrything works because I can communicate using hyperterminal, I get ID and evrythings works. I tried at first using the VISA exemple that comes with LabView just too write and read and I always get timout read error. I tried only write on the serial, and I get nothing.
Here is an exemple of the code I used.

thx for any help
0 Kudos
Message 1 of 7
(6,386 Views)
Hi,


I don't see anything wrong with your VI.

The fact that you are able to communicate with the instrument using hyperterminal shows that the cabling is right and that you now the serial port settings.

The best way to verify the operation of the serial port is to do a loopback test. This is acomplished by shorting (with a paper clip) pins 2 & 3 of the serial port. This allows you to test the serial port without depending on any external instrument. Anything you send will be received.

Once you setup the loopback, go to MAX >> Device and Interfaces >> Ports, and right click on the COM port you are using. Select Open VISA session. This opens the VISA interactive control. Click on the Basic I/O tab and Execute a write. Then click on the Read
tab and execute, you should get the same data send. If this test works it means that the VISA library is working. The Interactive Control uses the same VISA functions you would use in LabVIEW.

If you want to double check in LabVIEW, open the Serial Communication.vi example and do a loopback test.

Once you verify that the VISA library works (if it does) you need to focus on the commands you are sending. Practically all the Read timeout errors are caused by an incorrect command, specially missing the termination character. I can see from your VI that you are adding a termination character. double check that this is the termination character the instrument expects.

I think the best test you can do is capture the data send by Hyperterminal. Make a simple VI (or use the interactive control) to capture using another port the data send by Hyperterminal, Is there anything different?.

DiegoF
National Instruments
Message 2 of 7
(6,387 Views)
Hi

I figured it out after all, the problem was in the fact that the instrument needs the termination character at the beginning of a write sequence. It works fine now.

Thx

Luke
Message 3 of 7
(6,386 Views)
P.S. The most frustrating is that the official drivers that you can download from NI are full of bugs, code errors and with the same major flaw I had to struggle with. I had to modify all of the modules.
0 Kudos
Message 4 of 7
(6,386 Views)
Hello, I was looking at your comment and decided to investigate the driver. I used a TDS 2024 which should have the same firmware as your TDS 1002 as well as the LabView driver available on IDNet.

Looking at the documentation, I set the TDS 2024 to its default serial setting and set flow control to "Hard Flagging". I made no changes to the Initialize.vi or any other vi's because it looked like they all had the correct serial settings. After that, I opened the "TKTDS1K2K Getting Started.vi" and it worked without modification.

Next, I constructed a simple Initialize, Configure, Read, Close style VI which also worked without a problem.

The most important thing to remember when using a serial communication is that the VISA Serial settin
gs have to be set EXACTLY the same as they are on the instrument. The reason I mention this is that the VI you enclosed does not change any of the serial settings other than timeout. This may work sometimes, when the default VISA Serial Settings are the same as your device. In this case, however, the TDS 1K and 2K series use several non-default serial settings. Look at the TKTDS1K2K Initialize.vi to see all the VISA Serial settings.

It looks like since your post a document specifically addressing using the Tektronix 1K and 2K in serial mode has been added to the driver package. Glancing over it, it looks like some of the TDS models have some issues with the higher baud rates that they claim to support. If you are still having problems, I recommend you redownload the driver and check out this file. My specific model did not have any of these problems.

In summary, I had no problems using the TKTDS1K2K driver. Although I did not thoroughly test each VI in the driver, I was n
ot able to find any of the bugs you were referring to.

Good luck, and happy LabView coding,
Luke
0 Kudos
Message 5 of 7
(6,386 Views)
Hi Diego,

I seem to be having the same problem with my setup. It is as a matter of fact a TDS 1002 digital storage oscope with Labview 7.0 running on a host PC with windows 2000.
My first question is, to have a Labview code running, do i need either one of TekVISA or NI VISA, or do i need both !?..I am able to use the windows hyperterminal program and get ID information but i have a VISA library error which i havnt been able to resolve successfully.

Thanks for any help.

Mukul
0 Kudos
Message 6 of 7
(5,965 Views)

The simplest thing would be to just have NI-VISA installed.

If you get an error, you really need to post the error code to get someone help you resolve it.

0 Kudos
Message 7 of 7
(5,960 Views)