LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

prompt user for input express VI

Solved!
Go to solution

All,

 

I'm running labview 2011

 

I have a while loop nested in another while loop.  In the outer while loop, there is an express VI called "Prompt User for Input."  I trap on the express VI but when it executes it doesn't call up the prompt, and returns a false.

 

If I move the express VI into the inner while loop, the express VI runs as I would expect it to.

 

Why is labview doing this?  How can I make it not do it?

--

Ro ma wa ichi ni chi ni shi te na ra zu
0 Kudos
Message 1 of 13
(3,868 Views)

Post your code or at least an example that shows what you are doing. Without it we would only be guessing what your problem is.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 13
(3,865 Views)

I can't reproduce it with a smaller VI, even though the core elements are in it.

 

I've included my  main VI and a scratchpad VI.  The scratchpad works, the main one doesn't.  Please help me figure out why.

--

Ro ma wa ichi ni chi ni shi te na ra zu
Download All
0 Kudos
Message 3 of 13
(3,860 Views)

Your main is rather large and to be blunt poorly written. If I were to guess at your problem I would say that you are never exiting your inner loop. Therefore you will not prompt the user again. You have a test for equal to 0 with a floating point number as an input. Since exact equality to any floating point number is a bad idea I suspect this is the cause of your problem. The large issue would be to clean upi the code. Use more subVIs to modularize your code. Try to keep the block diagram to be a single screen on your display. Try not to use sequence frames. Your first two serve no purpose since data flow will control the order of execution. Also, try not to use as many express VIs. While they are convenient to use they are often very inefficient. Try to learn how to use the primatives themselves.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 13
(3,852 Views)

Thanks for the constructive criticism.  As an electrical engineer who's had to teach himself labview, I suppose I should be glad I make anything compiles, let alone runs.  I'll optimize the code based on your notes when I have something functional.

 

But the problem you're describing isn't the problem I'm having.  The first prompt-user-for-input expressVI executes, but it doesn't put a prompt up on the screen and it dumps a zero to the data output and a false to the enable out.

 

If express VIs don''t work, then I won't use them.  But I'd rather use the resources that NI provides when possible.

--

Ro ma wa ichi ni chi ni shi te na ra zu
0 Kudos
Message 5 of 13
(3,846 Views)
Solution
Accepted by topic author gdecker

Did you look to see if you have an error on your error wire that is input to the express VI? If there is an error the dialog will pop up and exit giving you the default data.

 

Also, Express VIs for dialog box is not bad. However for data capture you are far better off using the primatives.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 13
(3,838 Views)

I'm certainly not a fan of express VI's... lots of overhead for what a few significantly smaller block diagram objects can do. Makes the code a lot more readable and self-documenting too, since you don't have strings hidden within express VIs.

 

Feedback nodes should be replaced with shift registers around the outer while loop.  My guess is there's a race condition with the feedback loops, or some backwards logic in there.

 

Also a lot of opportunity for SubVIs in that code... again, compacts the block diagram, and modularizes the code so its easier to test and troubleshoot.

 

Rather than using the [i] terminal to dictate what states are next, look into using a type-defined enum in a state machine architecture.

0 Kudos
Message 7 of 13
(3,825 Views)

You have a breakpoint set on your 2nd Express VI.

Message 8 of 13
(3,818 Views)

That was the problem.

 

I've been having a lot of trouble controlling instruments with the USB-HS GPIB converter.  When I use the PCI card adapter I never have troubles like this.

 

Thanks.

--

Ro ma wa ichi ni chi ni shi te na ra zu
0 Kudos
Message 9 of 13
(3,815 Views)

@Ravens Fan wrote:

You have a breakpoint set on your 2nd Express VI.


I didn't even mention this because I figured it was simply part of his debug process.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 10 of 13
(3,812 Views)