LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to display message without stopping the VI

I am working with a school project. I want to alert the user if the temperature is over 49 or under 19. The problem is that the VI stops each time the message is displayed.

This is actually a SubVI. Can somebody look at the attachement and give me some advise.
0 Kudos
Message 1 of 12
(10,220 Views)
Without seeing how you are using this sub-vi it is hard to tell how to change the program. It will stop in this vi until you respond to the dialog box, the only way around that is to put the sub-vi in another loop,(I'm assuming that the data acquisition is being performed in a loop now) external of the one that is doing the measuring and pass it the temperature parameters, or to have the dialog box, in its case statement in the other loop, with all the range checking in the main acquisition loop. Then you would pass the "out-of-limit" boolean state to the dialog box loop using a local (the simplest, not necessarily the best). You will want to remember to put a wait(mS) in the loop, with a constant wired to the milliseconds to wait input, otherwise the loop will take most of the processor time. You will also need to have some way to stop the loop when the first loop is exited.


Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 12
(10,213 Views)
The problem is maybe linked to the fact that your code is running in the UI (User interface) thread, which is blocked if a dialog is opened. If you want your program to run in the background (out of the UI thread) things get more complicated.

If you can launch a queue-based producer-consumer system, it is possible to decouple the essentials of a program from the UI thread.

This is hard work though.

An easier way is to make your own small VI to pop up (without blocking the UI thread) which can be closed by pressing "OK", or after a certain time. If you use the message box options in LV, they will automatically block the UI thread.

Try making a sub-VI messsage box which isn't set to "modal" appearance (VI properties -> Window properties)

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 3 of 12
(10,194 Views)
I have somehow a similar problem: "showing multiple messages in several windows without causing the main VI to stop"

I did tested your suggestion. I made a message SubVI and it solved some parts of my problem. but the remaining barrier is when there is a message on the panel and another message comes, I'll face an error, because the message VI is already open and is already running! is there any way to launch several instances of one VI at the same time in LabVIEW 7.0? I mean several instances with independent panels.

Thanks.
0 Kudos
Message 4 of 12
(10,133 Views)
Hi,

You might wanna look into using VI Server.

Please find attached example VIs for your reference.

You have to modify the subVI to become your message-prompter VI and probably with self timer to close itself. It's your call!

Best regards,
ian.f
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 5 of 12
(10,130 Views)
Hi Ian

I, before finding this topic, created a new one with the similar subject "How to Open Several windows ,containing messages, while the application is running at the background?". I have explained the main problem there. would you mind take a look at that topic. there are more explanations there.

I saw your proposed code, but I think what you suggested will guide me to build e.g. 50 message VIs and I shall tell the user of application that he may only see 50 messages if he doesn't acknowledge them (suppose that the user may be far from the PC for a while and meanwhile it is very useful to open a message box for every event,warning, alarm, etc. so when the user is back at his/her PC he can conveniently acknowledge events one by one.) In your proposed Style it possible to have several messages on the screen, but they are different VIs.

I think the Ideal solution is having a message VI that can be called with different event codes and can be run in several instances with independent panels. but I don't know how much it is implementable.

I'm eagerly waiting for your answer and Ideas.
Thank You!
Soroush.
0 Kudos
Message 6 of 12
(10,124 Views)
Hi,

As you maybe calling and displaying more than one message, I am afraid that you might just have to create as many sub-VI as your intended message-boxes.

However, you may consider create One subvi with a String Control (Input), of which, (string) message could be passed over through VI Server (Passing Control Value Through VI Server). Once the subVI is created, simply make copies of it for other messages; You may name it such as MsgBox1, MsgBox2... MsgBox(N).

Once this is done, calling a message-box will be simply calling the MsgBox(N)and passes a (string) message to its String Control. Please find attached an example (of similar application) for your reference.

Hope you will understand 😛

PS: Please kindly rate my answer(s)/ question(s) as of how useful/ helpful they are 🙂 Thanks!

Best regards,
ian.f
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 7 of 12
(10,108 Views)
Hi Ian,

Thank you for your kind answers, but the last one was somehow disappointing. suppose that I have to build several copies of the same vi. I am sure that it is not a standard solution, because I must track the number of on screen messages and each time try to run the next message vi. this adds a lot of complexity that I think is unnecessary. this is far from today's programming style.

Anyway, thank you for your answer and this is surely the best answer if there is not a better solution!!!

Regards,
Soroush.
0 Kudos
Message 8 of 12
(10,093 Views)
Hi,

I believe someone else did mention about using VI template on your other posting.
Be calm and there should be a better solution or, at least, a good way of tracking the message VIs. I will help do little more thinking. Meanwhile, hope other enthusiasts here will have some better idea for you.

Best regards
ian
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 9 of 12
(10,075 Views)
Please also look into this link

regards
ian
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 10 of 12
(10,074 Views)