LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement and Automation Explorer: GPIB communication tool is freezing Tektronix scope

I'm not sure if this goes in the LabView forum. (If not, sorry!)

I'm writing a program to communicate with our Tektronix oscilloscope remotely.

My program works fine, but while I was testing additional commands with the GPIB communication tool packaged with LabView, the Tektronix kept freezing. It did not accept user input and stopped taking data; eventually it displayed a message "performing a long operation, please wait". It required a reboot to work again.

Here is the sequence of events. This sequence consistently produces this effect.
1. Start NI MAX. Open GPIB communication tool
2. Query the waveform using DAT:SOU CH1;:CURV?
3. Close NI MAX.
4. On closing, Tektronix freezes.

Querying other things (like IDN? and single measurements) don't have this effect.

Using the VISA open-write-read-close does not have this effect.

Why is this happening? Is there a fix for this?

Thanks!
🙂 jen
0 Kudos
Message 1 of 14
(4,202 Views)
Hi Jen:

What is expected to happen if you write DAT:SOU CH1::CURV? to the instrument then read? Is the NI-488.2 Communicator finished executing the Query before you close MAX? If you open a VISA session to this instrument and perform a VISA write of this command then a VISA read do you have the same problem? What about if you write this command then read in the NI-488.2 Communicator instead of using the Query option?

Is the program you have working using VISA? Does it execute this command in it?

Thank you,

Emilie S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 14
(4,179 Views)
The command should set the output to come from channel 1, then query the curve. I.e. it should return the data points read by the oscilloscope during one cycle.

It seems to finish. It doesn't add anymore data to the text. All the data seems to be printed out at once.

Doing a VISA open, VISA write (the curve? query), VISA read, then VISA close correctly opens the connection, queries the curve, reads the data, and closes the connection. This works fine. My program is not crashing the oscilloscope.

However with VISA, I do get a persistent warning that says I am not reading all of the data. Using the VISA command forces me to say how many bytes I want; I was using the GPIB communication tool to see how many bytes there were total to try to get rid of the warning. (There's an extra header that was messing up my count).

I haven't tried writing then reading.. I'll give that a try to see if that helps.

Note: I did call Tektronix.. they said that there is something in NI MAX that overrides user interaction at the scope. (But I still don't see why it would stop taking data at that point even if user interaction is frozen). For some reason this state persists after NI MAX is closed.

🙂 jen
0 Kudos
Message 3 of 14
(4,174 Views)
Hi Jen:

If you want to know how many bytes to specify, what you could try is opening a VISA session in MAX. If you click on your instrument, there should be a button on top of the right window that says "Open VISA Session". Then in the Basic I/O tab, write and execute your command, then go to the read tab and hit execute. This will get all the data and tell you how many bytes are included in the return count.

Let me know if this helps you out.

Emilie S.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 14
(4,170 Views)
The GPIB Query does a Write and Read sequentially---same as performing a single write and read. However, if your have some sort of combinational command that involves information exchange, you will need to use Write and Read commands separately.

For example, if your command first query for the status of the channel and then ask for the data to be send back, the instrument might need to perform these tasks separately. Usually commands that use ";" to separate different tasks within the single command line.

I think this is why the "query" function didn't work while the Write and Read works. You can verify this by using Write and Read separately in the GPIB communicator.
0 Kudos
Message 5 of 14
(4,152 Views)
Hi Jen,

First: What kind of TEK - scope do you use ?

Why do you want to invent the wheel again ??? - especially if yours has four corners ??

Try to use / modify the drivers delivered by TEKTRONIX - search for your scope @: http://zone.ni.com/idnet97.nsf/browse/

Find attached a sub.vi for channel reading (TDS 7054) - there you have to specify the lenght
"entire waveform" etc.

Hope this helps to guide you into the right direction.............

Regards
Werner
0 Kudos
Message 6 of 14
(4,145 Views)
sorry the attachment got lost somewhere

here again
0 Kudos
Message 7 of 14
(3,983 Views)
Thanks for all your replies.. sorry I didn't get back earlier.. it's finals week over here..:P

Well anyway I tried
1. Open NI MAX
2. Write "DAT:SOU CH1"
3. Write "CURV?"
4. Read
5. Exit

This worked up to step 5. When I exited, the Tektronix froze as it did when using the concatenated query.

😞 jen
0 Kudos
Message 8 of 14
(4,116 Views)
I'm using a TDS7000 series.

I wasn't aware there was a driver. I'll check it out. I'm updating someone else's code, and the previous guy used VISA read/write. (Which, aside from the header, works fine)

I'll check it out, but the subVI that gets data from the Tektronix is soooo simple it might just be overkill.

Note that the program will fix the setting on the scope, and once in my program it will read the same data over and over and over for days, maybe months.. Basically the program is: read curve, read curve, read curve.. The user is not allowed to do *anything* but read the curve.

Thanks!
🙂 jen
0 Kudos
Message 9 of 14
(4,113 Views)


@Emilie S. wrote:
Hi Jen:

If you want to know how many bytes to specify, what you could try is opening a VISA session in MAX. If you click on your instrument, there should be a button on top of the right window that says "Open VISA Session". Then in the Basic I/O tab, write and execute your command, then go to the read tab and hit execute. This will get all the data and tell you how many bytes are included in the return count.

Let me know if this helps you out.

Emilie S.
Applications Engineer
National Instruments




OK, I tried this and maybe I'm not using the same version of MAX you are but the MAX I have (version 3.1) does exactly the same thing as my program, that is, it does not read all of the data.

I know that I should receive about 8008 bytes, because there are 2000 points which are each 4 bytes. There is also a header which is about 8 bytes. The Write command in NI MAX asked for a byte count as an input, just like the VISA write in my LabView program. It says 1024 by default. So I got 1024 bytes. Is there a way to get around the "byte count" in the read command?

I tried this sequence of events:
1. Open NI MAX
2. Select GPIB device
3. Open VISA session
4. Went to BASIC I/O tab
5. Write DAT:SOU CH1 and press execute
6. Write CURV? and press execute
7. Went to Read and press execute (it correctly reads 1024 bytes)
8. Could not find "VISA Close" command in the drop downs (is there one?), so I exited the VISA session using the close button ("X")
9. Tektronix freezes.

????
😞 jen
0 Kudos
Message 10 of 14
(4,091 Views)