LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using VISA Write and Read to communicate with Tektronix Oscilloscope DPO 3012

Hello,

 

The purpose of the program attached to is to read a number of points from an oscilloscope. Using the SCPI programming commands associated with the Tektronix Oscilloscope, the commands are written to the Oscilloscope using the Visa Write and Read. Do I need an individual VISA Write for every programming command and a VISA read after every Write used, or can I write all the commands in one Write block and receive all the data with one Read block. The program attached is giving an error when the program reached the Write block. Therefore, I am thinking the block of commands inputted into the Write is giving an error.

Any help is appreciated!

0 Kudos
Message 1 of 6
(894 Views)

It depends on the instrument. You can send commands to setup the measurement then send the command to trigger the measurement. Check the instrument documentation to learn how the scope would respond. 

 

0 Kudos
Message 2 of 6
(888 Views)

Check out this link:

 

https://rfmw.em.keysight.com/spdhelpfiles/truevolt/webhelp/US/Content/__I_SCPI/Scpi_introduction.htm

 

Look at the "Command separators" section.

 

Short version:

You can combine things using a semicolon (";"), but unless you're doing it in the same "hierarchy", follow-up commands then need to start with a colon (":") to reset the hierarchy.

 

If you have multiple queries (anything with a "?" at the end) then you need to read the response and separate the replies yourself.

Message 3 of 6
(861 Views)

This looks like the same question you asked before here: https://forums.ni.com/t5/LabVIEW/Attempting-to-read-data-from-an-Tektronic-oscillscope-DPO-3012/m-p/...

 

It's best not to create multiple threads (or usernames) for a single issue. Even if you don't want to use the drivers that Tektronix published (as recommended previously), you can still open up their VIs and it will answer some of your questions about the communication protocol.

0 Kudos
Message 4 of 6
(856 Views)

Yes, it was a similar question, but it was not my intention to duplicate nor create multiple aliases. The program drivers provided are too complex for the task I am currently working on. I want to work on creating my own program. I asked about the relationship with the VISA write and read which differs slightly from the previous question. But it might prove helpful to look through the VI's to learn and compare structures.

Thank you

0 Kudos
Message 5 of 6
(819 Views)

The problem is even though it looks like separate commands you are actually sending the scope this one long string "DATA:SOURCE CH1DATA:START 1DATA:STOP 1000WFMOutpre:ENCdg BINARYDATa:WIDth 1HEADER 1WFMOutpre?CURVe?"

 

If you are going to send multiple SCPI commands in sequence I suggest putting each command in an array and a use For Loop with a little delay between commands. 

 

Here's an example from a sub-vi I made for configuring an AC power source

 

scpistrng.PNG 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 6
(776 Views)