09-14-2022 06:36 AM
Hi, I'm working on a modification to one of my company's LV programs but I am new to it and trying to reverse engineer a lot of our software is proving difficult. I've picked up a lot of the basics but stuff like this is still throwing me off, so if anyone could help to explain in laymans terms how this process works and how I can tailor it to my needs it would be very helpful.
Basically I am trying to create an alert when a count in the main software reaches a certain point. When the count reaches this point, I need a new alert window to pop up, and I need it to be always on top so that it can't be ignored. The main program still needs to be able to operate in the background, but the alert must be clearly visible during operation. So I've used simple '<' operator to generate a boolean true/false depending on the count.
I've attached my current files. In main, it compares the input number, and sets an event trigger if it is less than 200. This event trigger causes the subvi to run. However when it runs I'm getting this error:
LabVIEW: (Hex 0x4AE) The VI is not in a state compatible with this operation. Change the execution mode of the referenced VI to reentrant for this operation.
I set the VI's reentrant property, and then it gives me this error:
LabVIEW: This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.
However it is writable with the other property nodes so what am I doing wrong with this one? The end goal is to have the subvi pop up, stay always on top, and then go away when I click a button. Might be important to note that these files are pulled from another post on this forum showing how to keep a vi on top, and I've modified it to trigger an event from boolean.
Solved! Go to Solution.
09-14-2022 09:14 AM
I don't understand why you use a reference to call your sub-vi.
The simple approach seems to work for me:
09-14-2022 09:52 AM - edited 09-14-2022 01:52 PM
Your entire scheme is completely flawed.
So instead of digging yourself into a deeper and deeper hole. Explain how the code should behave from a user perspective and lets go from there.
09-14-2022 10:21 AM - edited 09-14-2022 10:24 AM
See if this can give you some ideas.
Note that this is just a proof of concept.
You should define in detail where the subVI should popup by changing its properties. Currently, it is just set as floating dialog. Placement on the diagram will run it and keep it running. All we change is the panel visibility.
09-15-2022 08:56 AM
@altenbach wrote:
See if this can give you some ideas.
Note that this is just a proof of concept.
You should define in detail where the subVI should popup by changing its properties. Currently, it is just set as floating dialog. Placement on the diagram will run it and keep it running. All we change is the panel visibility.
thanks, this is what I was looking for. The problem I have now is that I can't use the main program while the popup is open. It needs to still be possible to run the main program (which is just a simple programming script that waits for a button press before executing). Do you know how I can do this?
09-15-2022 09:04 AM
The main program runs just fine while the popup is open and you can even change the value and the popup will disappear when the condition ends. Have you tried? (you can finetune the behavior if you e.g. want the popup to stay)
(It is important to set the popup to "floating", not "modal". If it is "modal", you cannot interact with other windows.)
Please attach your code, else we cannot tell what you are doing wrong.
09-15-2022 09:19 AM
@altenbach wrote:
The main program runs just fine while the popup is open and you can even change the value and the popup will disappear when the condition ends. Have you tried? (you can finetune the behavior if you e.g. want the popup to stay)
(It is important to set the popup to "floating", not "modal". If it is "modal", you cannot interact with other windows.)
Please attach your code, else we cannot tell what you are doing wrong.
Ah got it now, I created a different subvi and failed to change the settings for it. Thanks for your help 🙂