LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure cause issues

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 7
(1,758 Views)

You forgot to post the code.

 

Only guessing but maybe you need to set the timeout event to run???

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 2 of 7
(1,754 Views)

Thank you for response. I have added the code. I will try to set out timeout event.

0 Kudos
Message 3 of 7
(1,744 Views)

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. 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 4 of 7
(1,727 Views)

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.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 5 of 7
(1,722 Views)
Solution
Accepted by dan_man

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

 

Frozen_0-1606319256253.png

 

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
Message 6 of 7
(1,716 Views)

Great. Thank you for your help.

0 Kudos
Message 7 of 7
(1,702 Views)