Get front panel position of the control strange behavior

Hi,
I have a code that returns the front panel coordinates of a control. I use the same code and front panel design (splitter/pane layout) in two separate VIs, but I get two different result in each VI and I cannot find the difference between them. VIs are attached. I have LV2013 f2.
Attachments:
1.vi ‏23 KB
2.vi ‏16 KB

Dear Andrej,
you are indeed correct. If you happen to have multiple panels with splitters, the you have to account for the splitter positions as well, assuming they are to the left, or on top of your control. Here's some very simple code written for your example:
Of course to make it more flexible for any setup, you will need to add some tuning to that (you can programmatically get the right pane instead indexing with Owning property, check splitter Vertical? property to decide which coordinate to add to, check whether to include splitter based on position and other things I've been too lazy to properly code ), but this is the basic idea.
Kind regards:
Andrew Valko
National Instruments Hungary

Similar Messages

  • Keeping Front Panel Position the same at runtime

    There has been some threads on here that say to set the Pane.Origin to 0,0 and that will set your front panel position to 0,0 every time you run.  I can't seem to get this to work.  I created a property node under GObject.Origin.  Then I tied a constant to the input and a constant to the reference.  I keep getting an error about the reference.  Any advise?  Maybe another way to do it?  I'm probably just doing something wrong.
    What I am trying to accomplish is when I am developing on the front panel and moving things around, I want the front panel to always run from the same position when I go to runtime.  I have tons of buttons that border the edge of the bottom of the screen and so they get covered up if I don't set the front panel back perfectly.  I am not using the scroll bars and the title menu is completely gone.  All that the user sees is the front panel that I have created.
    Thanks. 
    Solved!
    Go to Solution.

    I believe you need to obtain a reference to the pane starting from a "this VI" and working your way down the hierarchy, like this:
    This sets the origin on the first pane.  If you have more, you can put the last property node in an array and remove the index array node.
    (edit: note that the second property on the VI PN is a typo)
    This is a common thing to want to do at run time, but some of the other things you mention are a little suspect.  Why do you have "tons" of buttons off-edge?  There are a number of ways the user could accidentally see those despite your efforts to keep them hidden.  What function do they serve if they are GUI elements but excluded from the GUI? 
    Message Edited by blawson on 04-21-2010 02:02 PM
    -Barrett
    CLD

  • How to Save & reload front panel position

    I would like to save the front panel position into an ini file or registry, so that the next time the program is used, it comes up where the user left it.
    With the Invode Method: Front Panel.Run-Time postition.Get positon  
    I can get all the position data I want:
    left-top
    state
    monitor
    However...  How do I set the same information at startup?   
    There's no  Front Panel.Run-Time Position.Set position. as far as I can see...
    To set position, state and monitor values, it seems I need to first call  FP.Open for the state, then FP.Run-Time Position.Centered to select the monitor, and then FP.Run-Time Position.Custom to set the position....   
    That looks weird and complicated...    Am I missing something here?   Is there a more elegant approach?

    NI explains the difference between Property nodes and Invoke nodes as this.
    Property nodes access the properties of an object and allow you to read/write those properties.
    Invoke nodes perform actions on an application or VI allowing you to get and sometimes set attributes of those actions.
    Sometimes there is some overlap between Properties and Methods as you noticed with the "Get Position" method and the "Panel.Position" property. But most of the Methods do not have a similar Property. For instance, there is a Method you can use on a front panel item called "Get Image". This will return image data about the item that will let you save the items current visual appearance to a graphics file. (.bmp, .png, .jpg) There is no equivalent property to do this.
    So it really depends on what you are trying to do as to which one you end up using.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Front Panel Position Confusion

    In my program I have multiple wavefrom charts; I would like to call a reentrant subvi, ie small dialog window, that "pops up" over each chart, see attached picture.
    I would like to dynamically set the position of the dialog window to match that of the waveform chart. However, I am having great difficulty in making any sense of the position, front panel bounds, chart position property nodes. I thought if I set the front panel position in my dialog window to the plot position, the top left hand corners would align. However, that is not working for me.
    Any help would be appreciated.
    Cheers,
    Andrew
    Solved!
    Go to Solution.
    Attachments:
    Snap1.png ‏23 KB

    I'm attaching 2 VIs that I hope will help, if I've understood what you want.  It's extremely sloppy and incomplete but the idea is right.  You click on the chart and some text pops up at the top left corner of the chart, regardless of where the chart window is on the screen.
    The position of the chart within the panel will not change when the window moves, because the position of the chart is relative to the window that contains it.  So, you can use the chart position as an offset from the window position to find the position of the chart in real coordinates, which you then use as the position of your pop-up.
    Attachments:
    Text Pop-up.vi ‏10 KB
    Chart with Pop-up.vi ‏22 KB

  • Get front panel image

    I want to print the front panel image with a specific resolution independent
    of the actual size of the front panel.
    I had the following idea: I use a prperty node with "get front panel image"
    feed an intensity graph in a sub-VI with the information and print the panel
    of the sub-VI. The intesity graph of the sub-VI has always the resolution I
    need for the printer.
    This works fine. The peoblem I have is that I can not use the property node
    with 24 image depth. For the colour table (I need it for the graph) I always
    receive an array with the size of 256 as I receive it with 8 image depth.
    With 24 image depth I should receive a much longer colour table.
    Maybe somebody has another idea to print the front panel with always the
    exact res
    olution. Independent of the panel size - always the exact similar
    picture on the paper.
    Max
    -> [email protected] / [email protected] <-
    -> Max Weiß * Eulenweg 2 * 76356 Weingarten * Germany <-
    -> Fax/Voicebox: 01212 / 5 - 10570879 * Tel: +49 162 9114507 * DB 8 MWE <-

    I've played with this some myself. Apparently, LabVIEW can only use up to a 8 bit depth or 256 colors for this function. Most of the time, that is sufficient for printing images which are usually in grey scale anyway. You might also want to play around with some of the Print Methods using invoke nodes. You can print to an html doc and specify whether you want a JPG or PNG and the color depth for the image. You might be able to take advantage of this to work around odd printing problems.

  • How to get front panel sou

    how to get front panel sound for me headphones, i have audigy 2 ZS.

    Works Great. Thanks
    !!! Although .... the gain on the front mic is very low compared to the rear mic jack. Instead of using the x0 pin plug for the mic, I configured/spliced the front mic wires into a (rear) pass through /8" jack lead. Now, the front panel mic is at full output. I lose the?rear mic input, but I'll never use it now that I have front panel input.

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • I want to print the front panel without all the header stuff while the vi is running

    I want to print the vi front panel without all the header information that Labview puts at the top. I want to do all this while the vi is running by pushing a button.

    One option is to use the the 'Print VI to Printer' method. Beware that invoking this method repeatedly with complex front panels has caused me graphics problems in my VI's display that persist until the development environment or the built .exe app is exited and re-entered.
    See: http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000005F5A0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=spaz+print&USEARCHCONTEXT_QUESTION_S=0
    NI has confirmed this to be a bug in 6.0x and 6.1 and has indicated that it will be fixed in the next version.
    I was forced to fall back on the Append Front Panel Image to Report.vi in the report toolkit. Which does not produce printed graphs of as high as quality as the Print VI to
    printer method.

  • Are there any disadvantages to writing data to front panel indicators when the vi's panel is not shown during execution?

    Hi,
    In the case where a sub vi's panel is not shown during execution, does it matter if I include front panel indicators on the sub vi's panel? (these indicators were there for debugging purposes). Is there any performance penalty for this? Thanks!

    If the frontpanel is not loaded it has no time penalties. But a frontpanel is sometimes loaded because of property nodes!
    greetings from the Netherlands

  • Copy paste a front panel object to the very same xy location

    Hello,
    Just a practical question, but I would need this kind of feature very often:
    How can I copy-paste a front panel object to the very same location? Lets consider I have a TAB container, and on the first page, I have a Graph. I would like to make a same graph on the second page of the TAB, but at the very same XY location compared to the TAB container.
    Thanks very much!
    Solved!
    Go to Solution.

    hm, I have just realized, there is an option to "duplicate page" for the TAB containers And it does the magic for me, creates the exact copies of all the objects

  • Need your help, How to write a program such as drag the objects to the front panel like using the LabVIEW Front Platte

    Dear all:
    Sorry for so long title.
    I need your help with how to drag the objects and drop onto the front panel.
    Like the LabVIEW front platte, i can choose the objects i can drop onto every where of the front panel.
    Could drag and drop function can satify?
    Any idea?
    Thank you
    Attachments:
    Image00000.jpg ‏75 KB

    What you want to do is relatively complicated and it seems that your knowledge of LabVIEW is relatively basic. I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • How do you control LED lights on the front panel to identify the number of steps a stepper motor has taken?

    I am controlling a stepper motor that is coupled with a valve with four outlets (using an Arduino).  I've got a general understanding of how to control the motor, but I want LED lights on the front panel to light up that indicate which outlet the valve is currently at after the steps are taken.  The method I'm thinking about involves a lot of repetitive code.  I'm not that experienced with LabVIEW, I'm assuming I need some sort of loop structure but I don't know how to set it up in order to control the sequence of the LEDs.  I've attached my current block diagram for a visual aid if needed.
    Attachments:
    Capture.JPG ‏33 KB

    I was thinking about using the Stepper To Go and Stepper Write functions four separate times, using the same constants for the steps each time since the distance between each outlet is equivalent.  The only difference would be what's connected to the "steps remaining" node, which would be the function that activates one of the four LEDs (if that makes sense).  I was thinking that doing it this way would be a little counterintuitive since the only thing that needs to be changed is the LED indicator.

  • How can I access the member of a cluster on the front panel by selecting the label?

    I have a cluster of Controls. i would like to choose the element of the cluster by his label on the front panel and then show the value. Does anyone have an idea?

    I think I understand what you are trying to do. I've whipped up an example that uses property nodes, see if it helps...
    Brian
    Attachments:
    ClusterSelect.vi ‏35 KB

  • How do I input data to a table on the front panel and stop the program immediatel​y as button is pressed?

    What should I do if I want to display on the front panel in real time the values from Polarizer #, P1, P2 and the last calculated value (P2/P1 * 100) called T% in a table or some graphical representation like that?  What would I have to do?  It could just be Polarizer # and T% if that would be simpler.  I just want to let the user know the values in a list, spreadsheet or table as they go.  One last thing is that I would like to be able to stop the program at any point in time as soon as the stop button is pressed.  As of now, when the button is pressed it goes through the iteration currently in progress and then one afterwards.  I want the program to end as soon as the stop button is pressed no matter what sequence it is.  What can I do to achieve this?  Could you give me an example or modify my program to show me this.
    Thanks,
    Steve
    Stephen Coward
    Northrop Grumman
    [email protected]
    Attachments:
    EPM2000 almost done.vi ‏50 KB

    Put a single frame sequence structure around your stop button and then wire from the error cluster going into the error handler to the edge of the sequence structure. Now your code will stop at the end of the current iteration. To see why this works, watch you code execute with execution highlighting turned on and review the section of the manual talking about "Dataflow".
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Get Book's position in the hierarchy

    Hello,
    Is there a method in the API that lets me get a book's position in the hierarchy so I can output it in JSP? For example, how can I tell if the book is the 3rd nested book, or the 4th nested book?
    In the file singlelevelmenu.jsp (in the Classic skeleton), I see code that says:
    BookPresentationContext book = BookPresentationContext.getBookPresentationContext(request);
    // snip
    if (book.isDesktopBook())
    // do stuff
    I want something like book.getLevel(). I've gone through the API, but can find nothing of the sort. Does anyone have any hints? Thanks.

    Hello,
    Is there a method in the API that lets me get a book's position in the hierarchy so I can output it in JSP? For example, how can I tell if the book is the 3rd nested book, or the 4th nested book?
    In the file singlelevelmenu.jsp (in the Classic skeleton), I see code that says:
    BookPresentationContext book = BookPresentationContext.getBookPresentationContext(request);
    // snip
    if (book.isDesktopBook())
    // do stuff
    I want something like book.getLevel(). I've gone through the API, but can find nothing of the sort. Does anyone have any hints? Thanks.

Maybe you are looking for

  • Premiere Elements 7 Crashes on Startup

    The programme has been working fine for about 2 months but, as of last night, my copy of Premiere Elements 7 has started crashing on startup...it gets through the load screen and gives me the usual options to open an existing project or a new project

  • Zen Touch versus Zen Vision

    An ex-Ipod sinner here, coming back to the fold after having dumped his Muvo TX for the devil's instrument...! Hate the way Ipod ties you to Itunes and takes forever to update new albums, also takes massi've amounts of Windows resources, and have a l

  • Critical Error while upgrading workbook

    Dear All, I receive a critical error while I open a workbook in Bex 7.0 analyzer. After I see the dialog - "Workbook open for upgrade", I received this error. It says check the trace and I don't have a clue how to check the trace. Can somebody help m

  • Printing track listing library

    Hi! I would like to know if it's possible in any way to extract the info from the library into a printable format? Or into an excel, word or other file? I would like have a printed list of one of my playlists for instance.... I already searched the n

  • HT2614 how to open winmail attachments

    how can I open winmail.dat attachments on my Mac.  I can on the Ipad but not the Mac.