LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parent child vi - bugs

hello,

               please find this attachment. there you can find main. vi. run this main.vi then press the child vi button, one graph will be opened as a child window. you can move this vi on with in the main window.

 

my problem is when click on the child vi its little bit moving down direction. how to solve this...? this problem happend when i each click on the vi using mouse.

 

if the child vi not set as child window then this issue was not happend, only if i set as a child then its getting down with each mouse click on this vi.

Regards,
Balaji DP
0 Kudos
Message 1 of 17
(3,798 Views)

I cannot run your code since you did not include the "positionFPonMouseDown" VI. As for the code itself:

 

  • In the main VI you need to place the Boolean control "Child VI" inside the Value Change event so that the button is read and its state gets reset. When you do this you no longer need the case structure.
  • With the child VI running the main VI will no longer respond to events since it's stuck inside the "Value Change" event. If you want the main VI to continue to respond to events then you need to dynamically run the child VI.
  • Instead of using the "NewVal" parameter just read the Boolean controls directly.
  • In the subVI you have a case structure that does not seem to do anything.
0 Kudos
Message 2 of 17
(3,782 Views)

hello,

               sorry i forget to add one vi....this sub.vi set as a child window and main as a parent window using user32.dl

 

now try this, just check.... 

 

1. click on the child vi button

2. sub.vi will open

3. just click on the graph, now check when you do each click the sub.vi will move down below.

 

open the sub.vi, where you will find set parent and child.vi,  make disable that using disable structure

 

4. run the main.vi

5. click the child vi button

6. subvi will open and click on the graph using mouse, when you do each click on the graph the vi  will not move down below.

 

As per my task, I want to keep my main.vi as a parent and all subvi’s as a child.( Not as a subvi), also when I click on the graph the vi should not move down below.

 

On my project I am  calling vi as dynamically only….this is for example vi which I sent you.

 

Help me..!

Regards,
Balaji DP
0 Kudos
Message 3 of 17
(3,765 Views)

can you any one reply me...?

 

i am awaiting for your reply

Regards,
Balaji DP
0 Kudos
Message 4 of 17
(3,743 Views)

My guess is that there are some pixels that are being determined in the position related to the borders of the VI.  When the window has toolbars vs. when it doesn't.  And possible the difference between Window bounds and the mouse position relative to panel coordinates.

 

Actually, your subVI is NOT being called dynamically.  It is explicitly called by being an object on the block diagram.  You may want to call it dynamically, and start the VI running and set the bounds of the Window before you show the front panel.  Store the previous position in a shift register so you know where to set the bounds to.

 

You could possibly factor in the horizontal and vertical jump (I'm seeing 2 pixels to the right and 22 pixels down) in your new position calculations.  But even doing that, I see a jump up and to the left on the first call of the subVI.

 

I'm sorry I don't have an exact answer for you.  Searching the forums for terms like "windows bounds" "panel" "pane" and "origin" might turn up some threads with better explanations.  I just think there is a discrepancy between the window location and the WinBounds property that is partly determined by the presence or absence of borders and toolbars when the subVI first starts running.

 

0 Kudos
Message 5 of 17
(3,739 Views)

Hello Balaji,

 

Run and see this now once... Let me know if your issue is solved..

 

Regards,

 

Nitz

0 Kudos
Message 6 of 17
(3,726 Views)

Hello Nitzy,

                      is it possible to send me in labview 8.6...? i could not open your vi's

 

Regards,
Balaji DP
0 Kudos
Message 7 of 17
(3,723 Views)

this one is in 8.6.. 

0 Kudos
Message 8 of 17
(3,713 Views)

i am very sorry, still its is also labview 2010 only... i cant able to open it

Regards,
Balaji DP
0 Kudos
Message 9 of 17
(3,707 Views)

Hello Balaji,

 

In your positionFPonMouseDwon vi's block diagram, 'from mouse down event' you are using a comparison(=) to 1. Change that 1 to 0 or something else and see. I don't know whether this is the right solution or not but it worked when i tried it.

 

Regards,

 

Nitz

0 Kudos
Message 10 of 17
(3,687 Views)