11-25-2020 08:26 AM - edited 11-25-2020 08:42 AM
Hi,
I have two vi. main.vi has a button which I press. Information is send to LL(subVI).vi and cause change of the value of the button in sub vi. Everything is working fine. But then I have added event structure and code stopped working. No change is detected. Will appreciate if somebody can look at the code and tell me what is the issue:(.
Thank you for your help,
Daniel
Solved! Go to Solution.
11-25-2020 08:34 AM
You forgot to post the code.
Only guessing but maybe you need to set the timeout event to run???
11-25-2020 08:44 AM
Thank you for response. I have added the code. I will try to set out timeout event.
11-25-2020 09:20 AM - edited 11-25-2020 09:26 AM
Still no attached code. Make sure you don't edit your post after attaching a file. Sometimes it will disappear before you hit the post button.
EDIT: Ahh sorry, you added it to the original post.
11-25-2020 09:36 AM
Well I'm not sure where you are going with this code but if you just want to light the Value boolean in your subVI from main you can just add a timeout to the event loop like I mentioned earlier. Right-click the hourglass at the top-left of the event structure and create a small time constant (10ms is good).
Your event structure in the subVI will block the subVI from running until one of its events is triggered. As you will see you can add a timeout to let the subVI execute but normally you would have your event structure in the main VI where you intend the user interactions to occur and pass data by reference to a subVI to do work.
11-25-2020 09:47 AM
Your design is wrong.
1) Move the LL(Sub vi) out of the loop
2) add timeout to the event structure
optional:
3) add shift register to LL sub-vi to show that your sub-vi button is actually working
11-25-2020 10:19 AM
Great. Thank you for your help.