From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reviving an old VI - LabView not stepping through cases correctly

Solved!
Go to solution

Brand new user here (haven't finished Core 1 yet), but I'm trying to revive an old VI who's original author is no longer with the company.  For anyone willing to take a crack at it (after looking at the code) the VI functions fine up until it steps through to "Propel Reverse" which starts fine but then a couple seconds later "Propel Forward" is also switched "on" and that crashes an external component on the test stand (a DC iDrive).  The VI itself doesn't care and continues to run.

 

In short both "Propel Forward" and "Propel Reverse" should NEVER be on at the same time.  And in this case "Propel Forward" is turning on before "Propel Reverse" has completed its cycle.  All of this can be seen when running the VI and clicking on the "Background" tab.

 

Any suggestions??  

 

Thank you.

0 Kudos
Message 1 of 8
(2,096 Views)

Ouch.  I feel bad for you.  Way too many Value (Signaling) properties in there, some not bound by data flow.  So you can easily have some weird race conditions in there.  From what am seeing, there needs to be a much more defined loops, preferably broken up into subVIs.  I would even argue that most of those loops should not be separate, but including in the main state machine.  Sorry, but I don't see a simple fix to this; the architecture needs a massive overhaul.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(2,080 Views)

I was hoping for a simple "gee just change this value" but I totally get what your saying.  The entire program is 37 separate files in 12 different folders and it was based off of a program that was originally written about 12 years ago.  Not sure if I can post all of that. 

 

But do you have any idea of what I should look for that would be used to step through from case to case?

0 Kudos
Message 3 of 8
(2,077 Views)

Well in the bottom loop, there's a "Reverse" case that sends a "True" to the "Propel Forward Output" value signalling node, which seems wrong? 

 

Unless I am missing something...

Message 4 of 8
(2,035 Views)

Any chance that you could take a screen shot of that part of the code?  Just want to be sure that we are looking at the same code.

 

Thanks.

0 Kudos
Message 5 of 8
(2,031 Views)
Solution
Accepted by topic author Rich_Tennant_Tech

Forward in reverse area.png

Message 6 of 8
(2,007 Views)

Just got in this morning and tried your suggestion of removing that part of the code and "BAM", success!  That was it, I have no idea of how that line of code got in there but thank you for spotting it, kudos on the way!

 

 

0 Kudos
Message 7 of 8
(1,973 Views)

@Rich_Tennant_Tech wrote:

In short both "Propel Forward" and "Propel Reverse" should NEVER be on at the same time.  And in this case "Propel Forward" is turning on before "Propel Reverse" has completed its cycle.  All of this can be seen when running the VI and clicking on the "Background" tab.

 

Any suggestions??  

 

Thank you.


Just make sure that in the Propel forward event, you also turn off Propel reverse. And the opposite, ofcourse.

This was a lot better than i feared. The bottom loop can be cleaned up by moving functionality to sub-vis. You shouldn't need a flat sequence, that's a warning sign.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 8
(1,969 Views)