01-26-2009 05:13 AM
Hi:
I just met a strange problem when I using the event structure and dynamic VI calling.There are four button in the program which represent four different VI calling (dynamic VI calling)
Each VI is working well separately.
When they are calling by a"host VI", three of them are working properly(When the value of the three buttons changed, the front pannel of the according VI would be appeared and the VI would be running until the user stop it )
But there is a VI can not work properly when they are called by the "host vi" (It is also working well separately)
In normal condition, the VI which is called by the host would appear in the front of the host VI and running until the user stop it artificially.
In abnormal condition, the VI which is called by the host would appear in the back of the host VI and since then ,neither the host VI nor the called VI can response the user action, the only way to stop the VI is using ctrl+alt+Del and cancel the labview task .
what can lead the difference? All of the VI are in the same priority and execution system.
Thanks for your replying
01-26-2009 06:21 AM
That behaviour might be caused by improper settings for the modality of the dialog.
So please check and compare the VI settings of your subVIs.
hope this helps,
Norbert
01-26-2009 06:40 AM
01-26-2009 07:07 AM
Thanks Wiebe. and Norbert:
All the VI I used is in its default setting. But some worked properly while some not.
where can I modify the VI is modal or not ? I look through the VI property and find nothing about it .
Thanks again.
aaa1982
01-26-2009 07:27 AM
I think it is easier for us if you zip the files (the four subVIs and your calling VI) and attach it in this post.
Norbert
01-26-2009 07:40 AM
01-26-2009 09:02 AM
Thanks for your repling.
All the windows behavior property about the VI are default.The check of the modal is not selected.
I once wanted to simulated the question with two VI , one is the host VI(simulated ) and the other is the "problematic sub_VI(actual )" which is called by the host VI.
In my opinion If the problem still exist in the simulated condition, I can post the zip of the two VI on this forum.
But the dynamic calling is always working well in the simulated situation.
It is likely that the strange problem is only exist in my real application program which I can not post it here.
What is more interesting?
I turn on the "high light execution" and debug the host VI step by step. when the "problematic sub-vi" is calling, it is working properly.
Then I turn off the "high light execution" , but the "problematic sub-vi" still working properly. The ugly problem which confused me for about two days disappeared in an unexpected way.
I try to run the host VI agian and agian, the problem did not appear any more.
now I was so puzzled . what cause the problem and what solved it?
Thanks for your repling.
aaa1982
01-26-2009 09:09 AM - edited 01-26-2009 09:10 AM
Does your subVI which is causing the problem contain calls to other dialogs? Are there DLLs included?
I can imagine that you have a task/thread-switching issue. So you could modify the problematic subVI to execute in the UI thread (vi settings >> execution >> preferred execution system, set to "user interface" ).
hope this helps,
Norbert
01-26-2009 09:16 AM
aaa1982 wrote:...
What is more interesting?
I turn on the "high light execution" and debug the host VI step by step. when the "problematic sub-vi" is calling, it is working properly.
Then I turn off the "high light execution" , but the "problematic sub-vi" still working properly. The ugly problem which confused me for about two days disappeared in an unexpected way.
I try to run the host VI agian and agian, the problem did not appear any more.
now I was so puzzled . what cause the problem and what solved it?
Thanks for your repling.
aaa1982
This sounds like a race condition. Make sure you are enforcing the correct order of execution.
Ben
01-26-2009 11:40 AM