LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Popup VI won't close

Solved!
Go to solution

I have a VI that has a main while loop, and with that, the popup will close, but then if I add an event (value changed), the VI will not close.

 

I'm really green with this stuff, so I'm sure someone can tell me what I'm doing wrong within seconds.

 

 

0 Kudos
Message 1 of 13
(4,162 Views)

phuz a écrit :

I have a VI that has a main while loop, and with that, the popup will close, but then if I add an event (value changed), the VI will not close.

 

I'm really green with this stuff, so I'm sure someone can tell me what I'm doing wrong within seconds.

 

 


You really need to take the free tutorials.  Search the forum for "free tutorials" there are a few thread with links to these tutorials.

 

Ben64

0 Kudos
Message 2 of 13
(4,154 Views)
Solution
Accepted by topic author phuz

You need study data flow conception.
If you read data from button outside of loop, the value in wire will the same all time.
You need something like that:

event.png

Message 3 of 13
(4,144 Views)

@ben64 wrote:

phuz a écrit :

I have a VI that has a main while loop, and with that, the popup will close, but then if I add an event (value changed), the VI will not close.

 

I'm really green with this stuff, so I'm sure someone can tell me what I'm doing wrong within seconds.

 

 


You really need to take the free tutorials.  Search the forum for "free tutorials" there are a few thread with links to these tutorials.

 

Ben64



Thanks for your advice.

 

Unfortunately I was tasked with a job of creating an HMI where I am not being paid to learn, so while the idea of spending countless hours may sound enticing, it is not practical in this application.

I've created almost an entire HMI, thus far, by learning as I go, but seem to be stuck on this remaining point, so I was hoping for someone to point out my easy, I'm sure, mistake, not to coerce me to RTFM. 

 

If not, I'll use my alternate method, but I thought this would be prettier.  

Thanks,

 

0 Kudos
Message 4 of 13
(4,140 Views)

@Artem.SPb wrote:

You need study data flow conception.
If you read data from button outside of loop, the value in wire will the same all time.
You need something like that:

event.png


 

Thanks Artem, I had tried something similar but it left the main VI hanging, so I guess I didn't stop the loops simultaneously.  I re-tried it with this and it resolved it.  I knew it was something dumb. 😄

0 Kudos
Message 5 of 13
(4,133 Views)

@phuz wrote:

@ben64 wrote:

phuz a écrit :

I have a VI that has a main while loop, and with that, the popup will close, but then if I add an event (value changed), the VI will not close.

 

I'm really green with this stuff, so I'm sure someone can tell me what I'm doing wrong within seconds.

 

 


You really need to take the free tutorials.  Search the forum for "free tutorials" there are a few thread with links to these tutorials.

 

Ben64



Thanks for your advice.

 

Unfortunately I was tasked with a job of creating an HMI where I am not being paid to learn, so while the idea of spending countless hours may sound enticing, it is not practical in this application.

I've created almost an entire HMI, thus far, by learning as I go, but seem to be stuck on this remaining point, so I was hoping for someone to point out my easy, I'm sure, mistake, not to coerce me to RTFM. 

 

If not, I'll use my alternate method, but I thought this would be prettier.  

Thanks,

 


While you aren't being paid to learn, you are being paid to do it right.  Even if you don't do so this instance, if you are going to do regular programming in LabVIEW, at least take the tutorials - even if it has to be on your own time.  It's much easier to start out with something sound than to try to fix something broken.

 

"Winging it" with a programming language is going to get you into trouble sooner or later - with LabVIEW, it's no different - except that it's way easier to get into trouble in strange ways than with any text language.  This is because text based languages execute sequentially, while LabVIEW executes concurrently.  Enter two statements into a text based language.  It's easy to see which will execute first.  Place two nodes on a block diagram - who knows which will execute first?  You have to tell LabVIEW which should execute first.  In a text based language, it's hard to get things to execute in parallel.  In LabVIEW it's hard to get them to execute in order.

 

As always, it's where you want to spend the time.  Do you want to spend a few hours learning how to program effeciently or spend a few hours with each application trying to figure out why they just aren't working right?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 13
(4,104 Views)

Don't get me wrong, I always aim to do things right the first time, but labview just isn't a software package that is marketable in industrial automation so taking a class just isn't something that is going to happen for a single project.  We focus heavily on the top three HMI/SCADA packages that are used across industries.

 

That being said, I have looked briefly at some common practices as well as watched several youtube videos and tried to do things that were common amongst them.

 

I have my popup VI filled and it opens/closes fine, but randomly it appears to hang and I have to abort the VI rather than closing it.

0 Kudos
Message 7 of 13
(4,088 Views)

What you do before hanging?

And I think you need read help about Event structure.

Mistakes on diagram:
- event structure NEVER work if nothing happens. So you don't need use delay in loop.
- you have empty Timeout frame. Default value of terminal is -1=infinity. If you want get loop iteration, you can set timeout value.
And bottom loop content you can move to that frame.
But it depend of hardware. If it time-critical better don't use event structure.

timeout.png

0 Kudos
Message 8 of 13
(4,073 Views)

@phuz wrote:

Don't get me wrong, I always aim to do things right the first time, but labview just isn't a software package that is marketable in industrial automation so taking a class just isn't something that is going to happen for a single project.  We focus heavily on the top three HMI/SCADA packages that are used across industries.

 



I'm glad you haven't told anyone from National Instruments that.  Otherwise they be shocked that managed to build such a big business around something that you don't consider marketable.  Smiley Surprised

0 Kudos
Message 9 of 13
(4,067 Views)

@Artem.SPb wrote:

What you do before hanging?

And I think you need read help about Event structure.

Mistakes on diagram:
- event structure NEVER work if nothing happens. So you don't need use delay in loop.
- you have empty Timeout frame. Default value of terminal is -1=infinity. If you want get loop iteration, you can set timeout value.
And bottom loop content you can move to that frame.
But it depend of hardware. If it time-critical better don't use event structure.

timeout.png


 

That's the tricky part.  Not sure what I am doing when it hangs.  Sometimes if I press a button rapidly, it might hang.  Other times it won't.

None of this is time critical so the event structure is OK.

0 Kudos
Message 10 of 13
(4,063 Views)