08-17-2007 04:43 PM
08-17-2007 09:28 PM
08-17-2007 09:41 PM
One other tip for your program:
You should put the initialize VI before the loop and the close VI after the loop. Doing these operations on each iteration of the loop can be very costly in terms of performance, at best. At worst, depending on how the sub-VI's were written, could cause memory leaks that could crash the program.
08-17-2007 10:09 PM
Here are a few more tips to what has already been said above:
Your xy graph express vi is set to "clear on each call", meaning you show only one point at any given time. Pretty useless as a display.
Use a timed loop or place some wait inside your loop so it runs at a determined rate, independent of computer hardware. If you do that, your points will be equally spaced in time an all you need is a "waveform chart" display wired to your Y.
Once the loop rate is fixed, you can precalculate the number of loop iteration you need for your desired elapsed time and you could even use a FOR loop.
Your tick count use is wrong. The tick count is an increasing U32 number that starts at a random value and wraps at the 32 bit boundary. To get relative time starting at zero, take a tick count before the loop and another inside the loop while taking the difference to get the elapsed time in milliseconds.
For the option string, it seems silly to use a hidden control. Use a diagram constant instead.
08-21-2007 04:16 PM
08-22-2007 03:23 PM
08-22-2007 03:30 PM
You may want to go into the properties of the waveform chart and increase the history from 10 to something larger. 10 is not a lot of points.
Are you sure you are getting a voltage that is not 0? Is it a very small voltage close to 0? Your waveform chart has a property set for 0 digits of precision. So if your voltage is less than 0.5, it will show up as 0.
As for timing, your loop will run no faster than 10 times per second. But if the operation of the get data point VI takes longer than 100 ms, than the overall loop will run slower.
08-22-2007 03:36 PM
08-22-2007 03:39 PM
If you don't have automatic error handling turned on, why don't you wire up the error clusters and see if you are getting an error? Also, I'm curious why you are using the IVI driver instead of the LabVIEW driver.
The code for timing how long to run the loop is fine. I don't know if the 100 msec wait is long enough for the instrument.
Your wiring could be a bit neater as well. With so little code, it's easy to what goes where but if you keep up this style with more complicated programs, they will become much more difficult to understand.
08-22-2007 03:39 PM