07-12-2013 06:40 AM - edited 07-12-2013 06:44 AM
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
Solved! Go to Solution.
07-12-2013 07:44 AM
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;))
07-12-2013 08:50 AM
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
07-12-2013 08:56 AM
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.
07-12-2013 08:58 AM
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.
07-12-2013 09:30 AM
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
07-15-2013 04:50 AM
@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
07-15-2013 08:47 AM
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.
07-15-2013 09:16 AM
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.
07-15-2013 11:20 AM
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.