LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I slow down labview execution

Hi,

I have a program (which I did not write) which is used to load a waveform into a signal generator;  the program works fine every time when I run it on the old, slow computer which used to be used for that purpose, but we have a newer, faster machine which we would like to use instead.  The problem is, when I run the same program (I've built a binary so it's the same LV version and everything) on the fast machine, it only works  sometimes.  It used to work pretty much never on the new machine, but I was able to get better results by putting a half second pause in one of the subvi's where the error was occuring (it's reported as a timeout error, but I think that's bogus).  My suspicion is that calling "visa write" consecutively too fast somehow causes badness with the signal generators (like maybe they don't recieve the second write?).  Unfortunately, there are many places in the program where this occurs, so it's not really feasable for me to try to insert pauses at all those places. 

So what I'm hoping is that there is some way to slow down the execution speed of the program.  Anyone know of a way to do that?

0 Kudos
Message 1 of 2
(3,021 Views)

A program where the timing depends on the CPU speed, is very sloppy. There are two possibilities for the program to fail: (1) race conditions and (2) missing specific delays to wait for the instrument hardware to be ready.

So far you are exclusively blaming cause (2) but I don't think you have fully explored all possible causes. It is very well possible that there are also race conditions.

Slowing everything down is not the correct solution, because it does not fix the fundamental problem. (Well, you could permanently run it in execution highlighting mode, but thankfully that is not supported in a built application 🐵

The bad news is that you you need to sit down and fix the program. Don't just throw a roll of duct tape and bailing wire at it! 🙂

0 Kudos
Message 2 of 2
(3,010 Views)