LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why won't my charts continually update while running a case structure?

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

0 Kudos
Message 1 of 14
(4,113 Views)

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

Message 2 of 14
(4,105 Views)

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. 😄

 

Message Edited by altenbach on 12-15-2008 04:37 PM
Message 3 of 14
(4,096 Views)

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

0 Kudos
Message 4 of 14
(4,086 Views)

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

0 Kudos
Message 5 of 14
(4,059 Views)

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 

Message 6 of 14
(4,055 Views)

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

 

 

0 Kudos
Message 7 of 14
(4,048 Views)

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"

 

Message Edited by altenbach on 12-16-2008 08:53 AM
Message 8 of 14
(4,038 Views)

Some of the stuff I have downloaded requires drastic action!

 

Thanks for pointing out another way to skin the cat.

 

Lynn 

Message 9 of 14
(4,025 Views)

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). Smiley Surprised

 

     Rob

0 Kudos
Message 10 of 14
(4,015 Views)