LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior when using Labview to collect data from Tektronix tds8200 oscilloscope

Solved!
Go to solution

The key to your problem lies in your words:

 

"...the program works when I have the breakpoints enabled and doesn't when the breakpoints are disabled..."


It sound like the issue is that you have a race condition. Essentially what is happening is that two things are happening in parallel that should be happening sequentially. Inserting the breakpoint changes the order in which LV executes the code and prevents the problem from occurring.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 11 of 18
(1,250 Views)

It sound like the issue is that you have a race condition. Essentially what is happening is that two things are happening in parallel that should be happening sequentially. Inserting the breakpoint changes the order in which LV executes the code and prevents the problem from occurring.

 

Mike...



I think that sums up the problem well, Mike. Do you know of any clever ways to force the events to occur sequentially?

 

0 Kudos
Message 12 of 18
(1,225 Views)

I just had the chance to see your code (I was working on my phone before) and the structure looks ok (first time in a long time that I have seen a new poster actually connect up the error clusters!), but I don't have the library so can't look any deeper than your VI. The other thing is that there could be a timing issue inside the scope. In other words, you are sending it commands too fast. If you run it without breakpoints but with execution highlighting turned on, does the code work? How about if you put a big delay (say 1000msec to get started) after each of the VIs that had breakpoints on them?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 13 of 18
(1,218 Views)

@mikeporter wrote:

The other thing is that there could be a timing issue inside the scope. In other words, you are sending it commands too fast.


I ran into that with a TDS3000 series scope.  I ended up adding 500ms after almost all of my commands.  This was especially true when dealing with the math channel or anything that caused the scope to do some tedius work.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 18
(1,193 Views)

This is always a potential issue with old instruments. I used to have an HP dynamic signal analyzer that I could repeatably crash by sending it GPIB commands too fast -- and that was with LV2 running on a 2Mhz Mac II !

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 15 of 18
(1,190 Views)
Solution
Accepted by topic author nbckly

Sending commands too fast is definitely the problem. In my updated code, which I have attached again for easy reference, I added a timed while loop. The wait, the length of which varies with horizontal set size, is between 10 and 20 seconds. The while loop definitely gave the scope enough time to collect the data, and I may have been judicious when determining how long to wait.

 

I will certainly keep timing in mind when I move forward on my project.

0 Kudos
Message 16 of 18
(1,182 Views)

You might also want to check the commands for the instrument, sometimes they provide a way to ask it to see if its completed the last operation.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 17 of 18
(1,174 Views)

@mikeporter wrote:

You might also want to check the commands for the instrument, sometimes they provide a way to ask it to see if its completed the last operation.

 

Mike...


According to the Tektronix CSA8000 / TDS8000 Online Programmer Manual, it is definitely compatible with the *OPC? query.

 

I don't know why it wasn't mentioned before.  I don't know why I didn't mention it before.  It's one of my favorite SCPI commands.  😉

 

It could be because we saw he was using drivers and not using VISA calls.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 18 of 18
(1,139 Views)