Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

MDO3014 Command Synchronization

Post Reply
Posts: 93
Joined: September 23rd, 2014, 6:14 am
Country: United States

MDO3014 Command Synchronization

Post by jaime_g » December 1st, 2016, 6:03 pm

I am using LabVIEW 2016 to program the setup of an MDO3014 and a TDS3052C. The wait for the commands processing time to finish for either scope have been hard coded. This is not the best way to synchronize the scope operation with the execution of the next vi. I have enclosed a zip file containing the source code for Scope Setup.vi executable in a PDF file.

What is the preferred method to synchronize the completion of these scope commands with the program application?

Note: Use
for TDS 3052C and
for MDO3014

Thanks for your assistance.
Scope Setup.pdf
(179.09 KiB) Downloaded 1451 times
MDO_TDS Scope Setup.zip
(15.25 KiB) Downloaded 1431 times
Scope Setup.zip
(137.16 KiB) Downloaded 1432 times

Dave W
Tektronix Applications
Tektronix Applications
Posts: 322
Joined: April 26th, 2010, 12:01 pm
Country: United States

Re: MDO3014 Command Synchronization

Post by Dave W » December 2nd, 2016, 10:57 am

Hi jamie_g,

I can offer you a few tips on the best way to go about keeping in sync with your scopes. Here goes.

While putting all the commands you want to send into a single string constant and sending them all using one viWrite is the easiest way to get up and running, if an error were to occur from one of these commands, it would be really difficult to identify which command caused the error. For this reason it is better to send each command one by one and perform a *ESR? query after each command. If *ESR? returns anything except 0 then you know some sort of event/error occurred. This has the added benefit is helping to keep your code in sync as it forces your code to wait for the scope's response to the *ESR? query. You can find a VI that will make performing the *ESR? query easy if you check my forum post over at the following Link.

LabVIEW Tek Event Status Register Check

Now it would be a real pain to have to create a viWrite followed by the *ESR vi for each command. What you can do to make this easier is create a subVI that loops through the command string line-by-line only sending via viWrite one command line at a time and then after each command call the *ESR? query VI. This would look like the VI in the image below.
ViSA Send Line by Line.png
ViSA Send Line by Line.png (19.39 KiB) Viewed 14196 times
You can download a copy of this VI along with the *ESR? query vi below.
VISA Send Line by Line with ESR Check.zip
(19.86 KiB) Downloaded 1450 times

My other advice for synchronizing would be to use the *OPC? query where appropriate. Note that *OPC? only works with certain long running commands on the instrument and not all commands on the instrument so you shouldn't just try to use it everywhere to synchronize. Refer to the *OPC? command documentation in the Programmer's manual for a full list of commands the *OPC? command actually works with.

Note: If you want to use *OPC? to know when a waveform acquisition has completed, the scope will need to be running in the single sequence mode. (i.e. ACQuire:STOPAfter SEQuence) *OPC? does not tell you when an acquisition has completed if you are in the continuous acquisition mode. (i.e. ACQuire:STOPAfter RUNSTop)

Hope this helps!

Posts: 93
Joined: September 23rd, 2014, 6:14 am
Country: United States

Re: MDO3014 Command Synchronization

Post by jaime_g » December 2nd, 2016, 2:31 pm


Thanks for your response. I understand the limitations of using the *OPC command. I tried enabling the OPC bit using the DESE, *ESE 1 and *ESE 32 commands but without much success, (it works fine when using the *RST command). I also tried using LabVIEW VISA service request but always end up adding a delay between 300 ms and 500 ms. The adjustment of the delay is done when code 420, Query UNTERMINATED is no longer generated.

Rather than querying the SERS after each command, perhaps I could use a service request using the OPC bit then poll the event register for code 402, Operation complete to ensure the scope is done processing all commands.

I think I will try this idea to see if it works and report back.


Jaime Arevalo

Post Reply

Return to “Programming Support”

Who is online

Users browsing this forum: No registered users and 1 guest