LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVI with while loop + event structure not working in multi tab VI

Solved!
Go to solution

Hello Everyone,

 

I am developing an interface for the control of a prober using Labview 2012, and I am stuck with some issue.

 

To start with I provide you with a simplified version of my control interface VI, and with the sub-VI used to build and manage the wafer maps.

The VI consists of several tabs: Prober Initialization, Wafer Handling, Wafer Map, Status, Error.

The sub-VI can:

1/ initialize the grid to display the map (sub VI Init Grid not provided here)

2/ import XY coordinates from a txt file (sub VI Wafer Map Import)

3/ display the coordinates and index of the die below the cursor

4/ and when a die position is double clicked, and the boolean "Edit Wafer Map" is true, then the user can change the state (color) of the die between On-wafer die and Selected Die

 

My issue:

If I use the sub-VI by itself, it works fine. However when I use it as a sub-VI in the tab "Wafer Map", the map does not build up and I can no further use the embedded functionalities in the sub-VI.

I suspect the while loop + event structure of the sub-VI to be the bottleneck here.

However I don't know which way to go, that's why I'd be glad to have some advice and help here.

 

Thank you.

Florian

 

 

 

0 Kudos
Message 1 of 11
(6,753 Views)

Hello,

 

I couldn't open your vi as it is 2012 but from your description I could understand that your subVI has an event structure and a while loop. So if you are going to call this vi as a sub VI, the event structure doesn't make much sense unless you are popping up the UI of this vi and controlling the Front panel directly. 

 

How are you passing the values accross the vis, through connector pane? If so, it wouldn't help. You must have an event structure in your main vi and try to implement the logic functionality as a simple vi with just the functionality and place it in your main VI and have the controllable controls on the front panel of your main outer vi. 

 

I know, this explanation is very generic but I couldn't explain any further as I haven't looked at your vi. May be you can downconvert it into LV10 and post it again. I may be able to help.

 

warm regards,
Nitz

(Give kudos to good Answers, Mark it as a solution if your problem is Solved;))

0 Kudos
Message 2 of 11
(6,736 Views)

Hi NitzZ,

 

Thank you for your reply.

 

I tried to save the VIs in LV10, please tell me if you can open them now.

 

Inside he event structure there is quite some code, and since I don't want to make the main vi too bulky, I would like to keep it as a sub-VI. 

As you can see from the sub-VI, the event structure is used for extracting cursor position and tracking the double click action. These events are linked, through a property node, to the image "Wafer Map" which is passed to the main vi through connector pane.

All values are passed this way as well (through connector pane). Is there another way?
Maybe "refnum", but I don't really understand how to use them...

 

If I use the event structure in the main vi, the wafer map is still not working. I tried it earlier.

To implement the multi tab front panel, I used a tab control, and a for loop + case structure. For each element of the case structure, there is a corresponding action.

For the case where I put the code (element=2) for Wafer Map, I also control the execution of the code with a case structure activated by the button "REFRESH". Otherwise I end up with a freezing of the panel right after the start.

 

I hope these comments help you understand better.

 

Regards,

Florian

 

 

 

 

 

 

0 Kudos
Message 3 of 11
(6,729 Views)

It appears that you have given control to the subVI but never take it back because the subVI is in an infinite loop with no way to exit.  You have wired a TRUE constant to the Continue if True terminal. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 11
(6,726 Views)

Data Flow!

 

Your Wafer Management subVI has an infinite while loop.  It never ends.

 

Your main VI calls the subVI.  The case structure that calls the subVI can't finish until the subVI finishes and returns all of its outputs.  The subVI can't finish because you have a True wired to the Continue While True terminal of the while loop.  So your main VI is now stuck and the only thing you can do is abort your VI.

 

Does the subVI need a while loop?  Does it need to run independently of the main VI?  If so, then you need to call that subVI asynchronously, and pass messages back and forth to it using queues.

Message 5 of 11
(6,725 Views)

Thanks aputman and RavensFan for your inputs.

 

Well, actually, I have to keep this while loop, as I need to monitor continuously the position of the cursor on the map as well as the double click event.
 At least I don't  see another way yet, but I am almost a beginner with labview, so...

 

The fact it should be run independently is for compacity purpose only... but if I can make a more compact code for these operations, I would consider writing it directly in the main VI.

 

Anyway, I will inquire about queues and their use. This seems to be what I seek.

 


Florian

0 Kudos
Message 6 of 11
(6,717 Views)

@Ravensman:

I would like to use the producer/consumer template, but is it possible to have an event structure in a sub-VI there?

In that case, does the event structure of the template needs to have other element than TimeOut?

 

Thanks for your help.

 

Florian

0 Kudos
Message 7 of 11
(6,661 Views)

You can have an event structure in a subVI.

 


@flongnos wrote:

In that case, does the event structure of the template needs to have other element than TimeOut?

 


I don't understand your question and what TimeOut you are talking about.

0 Kudos
Message 8 of 11
(6,632 Views)
Solution
Accepted by topic author flongnos

The issue arises because your main "for" loop cycles 33 times.  On the 32 loop, up pops your subVI and execution is passed to your subVI.  Meanwhile your main VI is waiting for subVI to finish, which it never does.  You could move your subVI out of the main program loop and have it run in a separate process, and pass data to it using queues but you would have to come up with a way to close the subVI (i.e. a message queue).  By moving the subVI out of the main process, it is independent and you can do whatever you want to do with events and such. 

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 9 of 11
(6,626 Views)

Ok thank you guys, it really helps. I'm now getting familiar with queues on my side.

 

@RavensFan:

Sorry my question was probably not worded very clearly. I meant to ask: what events should contain the event structure of the producer/consumer template?

I found that I could put there all the actions related to commands, and as a result, I was able to remove most of the case structures in the main loop.

 

 

0 Kudos
Message 10 of 11
(6,616 Views)