05-30-2014 01:58 PM
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...
06-02-2014 04:12 PM
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?
06-02-2014 04:28 PM - edited 06-02-2014 04:41 PM
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...
06-03-2014 06:59 AM
@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.
06-03-2014 07:11 AM
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...
06-03-2014 08:42 AM
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.
06-03-2014 08:56 AM
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...
06-10-2014 01:45 PM - edited 06-10-2014 01:49 PM
@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.