12-15-2008 04:44 PM
I'm making a VI to drive an actuator and read a force on a load cell. I have programmed the actuator to run through a flat sequence using millisecond timers to delay its drives outward and inward, which is necessary for its intended use. However, my goal is to have it display the motor position and the force on the load cell on the charts continuously throughout the test. However, when activating the case structure containing the test sequence, the graph fails to update live.
I'm not sure if I'm on the right track, but I have posed my file for whomever is interested. I hope you can lead me in the right direction, and thank you very much.
Keith Blume
12-15-2008 05:21 PM
One of the things that happens is that everything in a loop has to complete before it can move on to the next iteration. So, while the output sequence is running, the input portion of the loop runs once and then stops until the next iteration of the loop.
The most common way to fix this would be to put your input and output portions in separate loops (as per the modified VI that I've included).
Warning: Neither of the loops has a delay timer in it. This VI will use 100% of your CPU and you may see one of your loops pause while the other loop executes. I did not include delays in the loops as I do not know what timing you need. I would suggest that you put at least a 1ms delay into each loop.
Rob
12-15-2008 06:37 PM - edited 12-15-2008 06:37 PM
Robert basically answered the question already. 🙂
One quick comment. Do't go orange to calculate an U32 integer from an U32 integer. Instead of dividing by 0.02, multiply by 50 (U32 diagram constant) instead. 😄
12-15-2008 06:47 PM
Thank you both for the replies, much appreciated. Although, Rob, I don't have 8.5 updated on my computer for various reasons, so I'm unable to open your file. Can you render it for 8.2 by any chance?
Thanks, again.
Keith
12-16-2008 10:01 AM
Okay, sorry about that. I had 8.5.1 open for some work I was doing and it doesn't tell you what version the VIs that you open were in.
Here is the VI in 8.2.1. I took the liberty of adding Altenbach's suggestion and putting a short delay in the lower loop. Note that there is no way to stop the lower loop (at least not yet).
Rob
12-16-2008 10:06 AM
Rob,
You can find the version of a VI you have downloaded (as long as you have not saved it) by closing the window. The Save/Don't Save/Cancel dialog which pops up has a link to "List Unsaved Changes..." One of the items in that list is the previous version in which the VI was last saved if it is older than the version you are running.
Lynn
12-16-2008 10:26 AM
Thank you. I didn't know that. Other people in the office here are saying, "Oh yeah, I knew that." But this one somehow got past me.
Learn something new every day.
Rob
12-16-2008 10:53 AM - edited 12-16-2008 10:53 AM
johnsold wrote:You can find the version of a VI you have downloaded (as long as you have not saved it) by closing the window.
Well, closing the window is a bit drastic. 😮 😄
Simply go to VI-properties (e.g. by right-clicking the icon in the upper right) and do: "General...list unsaved changes"
12-16-2008 11:25 AM
Some of the stuff I have downloaded requires drastic action!
Thanks for pointing out another way to skin the cat.
Lynn
12-16-2008 11:59 AM
Altenbach, I'm shocked! When I look at mine it says that it was converted to 8.5.1f4. Have you not installed the LabVIEW bug fixes?
Amazing (if it's true).
Rob