Display a particular array element on the front panel

Hello,
I was wondering if it's possible to change which element of an array control is displayed on the front panel from within the program.
Here's why I want to do it: I have an array of clusters, each of which contains a set of controls.  The controls in each cluster specify a bunch of different parameters for a few different instruments that are being controlled by Labview.  The user changes all the values on the front panel before the program starts, then the program steps through the array elements one by one.  I'd like to be able to change the array's display so that the user can know which set of parameters is active (and thus what is currently in force) while the program is going -- otherwise the element that is displayed is just wherever the user left it last.
Thanks in advance for any help.

See also: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=317419#M317419
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Can I embed an aquired image in the front panel or does it have to be in its own window?

    I need to be repeatedly displaying processed images and I know that I can make the image window "float" so that it is always on top and never becomes hidden when I click in the vi's front panel, but it is inconvenient that if I move the vi window or scroll within it, the image window stays where it is. I would like the image display to be a part of the front panel if that is possible, so that both move together.
    Thanks

    This is fairly simple to do.
    I have attached Make IMAQ Child.vi, which is a slightly modified version of one I originally found on the NI website.
    One required input is the filename of the parent VI, which can easily be obtained by using the "Current VI's Path" constant and Strip Path to remove the filename from the path.
    The other required input is the IMAQ window number.
    This will make the IMAQ window a child panel within the specified parent window. It will move with the parent window.
    Bruce
    Bruce Ammons
    Ammons Engineering
    Attachments:
    Make_IMAQ_Child.vi ‏39 KB

  • 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.

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • Is there a way to rotate an array on the front panel?

    Is there a way to rotate an array on the front panel?  For example, I want element [0] to be at the bottom of an array that's expanded to show the elements vertically.
    Thanks in advance.

    I do not think that there is any way to make an array control or indicator display that way.
    You might be able to reverse the array, creating an upside down display. If you also need the user to index it, then it gets trickier.  Hide the array index display.  Create another numeric control to look like the index control.  When the value of the new control is changed, subtract the value from the last index of the array and use the difference to index the array.  You may need to adjust by +/-1, so try it to be sure.
    Lynn

  • How can I display a changing variable in a subvi on the front panel of the main vi as the subvi is excuting

    In the document attached the vi on the right is sub to the vi on the left. On the subvi on the right the variable "Field Reading" is continuously updated on the front panel of the subvi as the "for" loop is executed, but only the last value of the variable is updated on the main vi front panel which is what is expected. My question is how can I display the changing value of "Field Reading" on the main vi front panel as the "for" loop in the subvi is running?
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    Doc2.docx ‏554 KB

    Hopefully I can explain it well enough. It really is simple.
    1) Create an empty global variable and call it something like User Interface References.vi
    2) For each and every control and indicator on your front panel, right-click and select Create/Reference
    3) Place these references wherever you like (I use a series of Event cases to perform my initialisation and these all live in one of these event cases). They can be placed anywhere in the main vi.
    4) For each of the references, right-click and select Create/Indicator
    5) Moving to the front panel, Cut all the indicators and Paste them in the global variable (eg. User Interface References.vi)
    6) Moving back to the block diagram, wire the global variable to each of the references and select the same named global variable.
    All the hard work is now done (until you add another user interface terminal). You should now have something that look as shown below, [except the reference labels would be to the left (not sure why the snippet put them above)]. In my latest program I have 82 references!
    Done. You can now access all your front panel controls and indicators anywhere in your program as shown below.
    You can just select Value in most cases, but in this particular case I wanted to fire off an Event to do some things (log the alarm) as well as just update the value. So, this is another bonus with the method.
    Hopefully this all makes sense. If not, let me know.

  • Hi i am new to labview. i want to extract data from a text file and display it on the front panel. how do i proceed??

    Hi i am new to labview
    I want to extract data from a text file and display it on the front panel.
    How do i proceed??
    I have attached a file for your brief idea...
    Attachments:
    extract.jpg ‏3797 KB

    RoopeshV wrote:
    Hi,
    The below code shows how to read from txt file and display in the perticular fields.
    Why have you used waveform?
    Regards,
    Roopesh
    There are so many things wrong with this VI, I'm not even sure where to start.
    Hard-coding paths that point to your user folder on the block diagram. What if somebody else tries to run it? They'll get an error. What if somebody tries to run this on Windows 7? They'll get an error. What if somebody tries to run this on a Mac or Linux? They'll get an error.
    Not using Read From Spreadsheet File.
    Use of local variables to populate an array.
    Cannot insert values into an empty array.
    What if there's a line missing from the text file? Now your data will not line up. Your case structure does handle this.
    Also, how does this answer the poster's question?

  • How to Return the Index of a Mouse-Selected Array Element in the View Interface of Diadem

    Hello,
    Does anybody have an idea of how to obtain the index of a mouse-selected array element in the View interface of Diadem??
    Thanks!

    Hi Ovidius,
    Keep explaining.  The only way I know of to trap a selected cell value in VIEW is to embed into the desired VIEW area a second non-modal SUDialog that has a Table control or an XTable control displaying the values of certain data channels.  There are callbacks in both table controls for cell selection, and you can configure the table control to allow only single cell selection if that's what you want.  The regular table control will be easier to program, but the XTable control will perform much better for larger channels.
    But what happens with that value the user selected?  Is it used for a calculation?  Is it added to a report?  Why would the user select that cell in a table rather than selecting the corresponding feature in a graph with the crosshair cursor?
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How can I display the front panel of the dinamically loaded VI on the cliente computer, the VI dinamically loaded contains files, I want to see the files that the server machine has, in the client machine

    I can successfully view and control a VI remotly. However, the remote VI dinamically loads another VI, this VI loaded dinamically is a VI that allows open others VIs, I want to see the files that contains the server machine, in the client machine, but the front panel of the dinamic VI appears only on the server and not on the client, How can I display the fron panel with the files of the server machine of the dinamically loaded VI on the client computer?
    Attachments:
    micliente.llb ‏183 KB
    miservidor.llb ‏186 KB
    rdsubvis.llb ‏214 KB

    I down loaded your files but could use some instructions on what needs run.
    It seems that you are so close yet so far. You need to get the data on the server machine over to the client. I generally do this by doing a call by reference (on the client machine) of a VI that is served by the server. THe VI that executes on the server should pass the data you want to diplay via one of its output terminals. You can simply wire from this terminal (back on the client again) to an indicator of your choosing.
    Now theorectically, I do not think that there is anything that prevents use from getting the control refnum of the actual indicator (on the server) of the indicator that has the data, and read its "Value" using a property node. I have never tried this idea but it seems t
    hat all of the parts are there. You will need to know the name of the VI that holds the data as well as the indicator's name. You will also have to serve all VI's. This is not a good idea.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How can I display the name of my refnum on the front panel?

    I am writing data to a file. To do this, I am using "Open/Create/Replace File" to prompt the user for a filename, which is then output to my VI as a refnum. I then write strings to this file with "Write to Text File".
    How can I display this filename (with the path) on the front panel after the user has input it?
    Michael
    Solved!
    Go to Solution.
    Attachments:
    refnum.JPG ‏45 KB

    Use the Refnum to Path function, in File I/O -> Advanced File Functions palette. You can wire this to a path indicator.

  • How to display the status of a SubVI on the front panel?

    Hi,
    I am writing a program to control an instrument through a serial communication port. The control and communication functions are integrated in a SubVI and they work fine.
    In the front panel of the main VI, I want to add some indicators to display the status of those controls in real time, such as using some LEDs to show whether the program is running in some loops of the SubVI, or use some indicators to show some variables in the SubVI.
    I tried using global variables, but I can't make them work in real time (or maybe I didn't do it right). The values of the global variables are actually changing on the fly, but the indicators on the front panel wouldn't reflect those changes until the program return
    ed from the SubVI.
    Is there a way to do this in Labview 6.0.2?
    Your earlist help is very much appreciated.
    Best regards,
    Hua

    Hua,
    I have attached an example in which a front panel boolean indicator is toggled in the subvi. Also, a front panel stop button is used to stop the loop execution in the subvi. References are passed to the subvi instead of the actual control values.
    Without seeing your code I'm not sure what was going on with the globals, but you had to have a data dependency somewhere which was keeping the code from running until after the execution of the subvi. The code must be totally independent of the subvi in order to run. Also, in order for the update to work it would have to be operating in a loop.
    Attachments:
    Main.vi ‏13 KB
    subvi.vi ‏20 KB

  • How do reduce the space between the front panel and the display area

    I am trying to reduce the space between the front panel and display area but i am not able to reduce the space

    A picture would be very helpful in demonstrating what you are having trouble with.
    Lacking that, I will guess.
    VI Properties >>> Windows Size
    lets you define the minimum size of a FP window.
    Well that's my guess!
    Did I win?
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How do I programmatically display jpeg files on the front panel

    Hi,
    I would like to be able to programmatically display various jpeg images on the front panel of a VI. I would mostly like to be able to display one image at a time and have the ability to programmatically change the image to different ones under program control. I found a picture indicator but not sure how to use if or if this is the best way. Thanks for any help.
    Dave Adams

    Yes, you can use a picture indicator.
    The attached simple codelet shows how to display a jpeg image on it (Make sure the image indicator is big enough).
    Let us know if you need help with the rest of the coding.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    DrawJpeg.gif ‏2 KB

  • How to: display large error note in the front panel?

    hi guys,
    When "error out" has an error, I would like to display HUGE RED TEXT in the FRONT PANEL saying: "STOP, ERROR DETECTED!"  )
    How to do that?
    Thanks for your help.
    Solved!
    Go to Solution.

    Place an indicator on the panel. Set the text to HUGE and RED, and set its value to "STOP, ERROR DETECTED!". Make it not visible. When you get an error, use the "Visible" property node to display it.
    To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

  • I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadshee​t. Any ideas?

    I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadsheet. Any ideas? Right now my data will collect one reading instead of continuously reading my IMU which displays data in a continuous stream.
    Thanks
    Attachments:
    Read_IMU_Drew.vi ‏21 KB

    Hi
    Your vi is in 2009 version, which i am unable to open in 8.6
    However, if you want your data to be saved in excel sheet, here is the VI
    Somil Gautam
    Think Weird
    Attachments:
    save to excel.vi ‏12 KB

Maybe you are looking for