Set Fixed Array Size

Hello. I am trying to develop a VI for an FPGA target and I'm trying to make it so whoever is using the VI can specify the size of an input array when they instantiate it (such as by having an input to the VI that says "max array size" or something). So far it seems like the only way to do something like this is to go into the VI itself and manually set the array size for each input array for the VI (i.e. open the VI, right click on each input array, select "Set Dimension SIze", choose "fixed", set number of elements). I'd like to have one point where I can set the size of all the arrays at once (since in my case they are all the same size), and let the person using the VI set it to the proper size for whatever application they are using it for (to be clear, let's say I have two uses for this VI, and in one case I have an input array of size 100 and in anohter use of size 1000, I'd like to be able to set these somehow instead of doing it through the dialog). Thanks.
Solved!
Go to Solution.

Unfortunately, per-call configuration of array size is not something that is supported today. This is a great idea, I would suggest that you post it on the FPGA Idea Exchange so we can get a feel for how many other people need this same feature.

Similar Messages

  • Does Reinit To Default set an Array size to zero?

    Does the function Reinit To Default set a 2D Array size to zero? The Help is not explicit on this.
    If not, what is the best way to set a 2D Array size to zero?
    Solved!
    Go to Solution.

    Yes, it sets the size of an array to zero elements, unless the default value is defined otherwise (right click, make current value default.).
    There are several ways to empty an array indicator/control.Normally I write it's value to the terminal or to a local variable. I have never used 'Reinit values to default'
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • How to set the array size

    Hi,
    below is my sample code
    class test
    int sample[][]=new int[10][10];
    int rows=0,k=0;
    int columns=0;
    public void meth()
    rows=9;
    columns=9;
    }//end of meth()
    public meth_2()
    for (int i=0;i<rows;i++)
    for(int j=0;j<columns;j++)
    sample[i][j]=k;
    k++;
    for (int i=0;i<rows;i++)
    for(int j=0;j<columns;j++)
    System.out.println(sample[i][j]);
    }//end of meth_2()
    public int[][] getList()
    return sample;
    }//end of classNow that my question is, i need to set the size of array sample[][] to sample[rows+1][columns+1].. but to do so, 'rows' and 'columns' values will only be generated upon the execution of method meth() . I need sample[][] array to be declared right after the class begins. The values that are returned from sample[][] array through that getList() method is been used in another class.. So how do i set the size of sample[][] array to
    int sample[][] = new int[rows+1][columns+1];Any response is highly appreciable.
    Thanks in advance
    Edited by: netbeans2eclipse on Sep 14, 2008 1:20 PM

    It seems you answered your question yourself ;-)
    Just split this:
    int sample[][] = new int[rows+1][columns+1];in two parts.
    Declaration:
    int sample[][];and instantiation in meth() or meth_2():
    sample = new int[rows+1][columns+1];

  • Fixed array-size only: isnt that damn stupid???

    hi all.
    i'm just wondering why java can't or doesnt handle arrays with unfixed sizes?! isnt that very stupid? what do you do, when you don't know how many items your array will have? it could be 10 or 10'000!
    i know php, so i can't understand why java does not support this. any reason?
    thx& gr33tz
    j0sh

    @ harmmeijer:
    ok, thats true, didnt remark that. anyway, an "epilogue-spam" doesnt make much sense, too. ;)
    @ paulcw:
    let me quote joey: "It's really unfare to bleem any thing without you really study and get know to it..."!
    i know php quite well, and i love it. but i have to learn java on my working place. it's just quite hard to learn autodidactic at the beginning untill you know the basic concepts of it...

  • How do I set a fixed page size in Muse so that the window always stays the same size

    how do I set a fixed page size in Muse so that the window always stays the same size

    Hi Aish & thanks for responding;
    I would like the window size to stay the same for the entire site and not be
    able to scale to drag & scale it. ie 950 pixels x 500 pixels.
    Thanks,
    JB
    On 12/4/14 3:30 PM, "Aishvarya Raj Rastogi" <[email protected]>

  • Setting array size, effect on memory

    Does setiing the array size to a huge no has any affect on the memory, performance and is it considered good programming. If not what are the other options?
    String [] arrayString = new String [2354];

    Your question is rather ambiguously worded.
    In Java arrays cannot be resized, so you should set the array to the exact size you need. If you need a huge array, create one. If you need a small array, create one. If you don't know how large it should be, or need it to be dynamically sized, use any of these great classes - ArrayList, HashMap, HashSet, etc... Try reading the Java API documentation on these classes...
    And yes, when you create a huge array, it actually allocates the space for each element in the array right then, and in fact initializes each with the default values of null, zero, or false depending on the type of the array.

  • Array size mismatch error (1047) from matlab to labview

    Hello all,
    I have a very strange situation here and I am hoping someone can come up with some ideas for me...
    I am running labview vi's through a web page, and one of my vi's contains a matlab script with two array inputs, one 2d with a varying length, and the second a 1d array with a fixed set of parameters.
    If I call this report on my local system, web server labview and matlab all running on my laptop. Everything works fine. I receive no errors and the matlab script runs and returns data as expected.
    The problem is I have an Identical setup (as near as I can tell) setup on a server, and I receive a 1047 error, reporting an array size mismatch.
    All the input arrays data sets are identical in the vi at the input into the matlab script. And as best as I can tell all sub VI's and M files are identical. The only difference I can come up with is that one setup is running on a server and the other is not, however other vi's using matlab script (although a simpler configuration (no direct inputs or outputs form matlab, all data transferred in and out via txt files )) run fine in both configurations.
    On both systems I running matlab ver 7 (R14) with a single user license and Labview 7.1.
    any ideas or suggestions would be greatly appreciated. Please let me know if any additional details are needed.
    Thank you in advance,
    Chris

    Hello Matt,
    Yes you were correct upgraded LV to 7.1.1 and everything is running fine now.
    thanks
    NPI_Chris wrote:
    Hello all,
    I have a very strange situation here and I am hoping someone can come up with some ideas for me...
    I am running labview vi's through a web page, and one of my vi's contains a matlab script with two array inputs, one 2d with a varying length, and the second a 1d array with a fixed set of parameters.
    If I call this report on my local system, web server labview and matlab all running on my laptop. Everything works fine. I receive no errors and the matlab script runs and returns data as expected.
    The problem is I have an Identical setup (as near as I can tell) setup on a server, and I receive a 1047 error, reporting an array size mismatch.
    All the input arrays data sets are identical in the vi at the input into the matlab script. And as best as I can tell all sub VI's and M files are identical. The only difference I can come up with is that one setup is running on a server and the other is not, however other vi's using matlab script (although a simpler configuration (no direct inputs or outputs form matlab, all data transferred in and out via txt files )) run fine in both configurations.
    On both systems I running matlab ver 7 (R14) with a single user license and Labview 7.1.
    any ideas or suggestions would be greatly appreciated. Please let me know if any additional details are needed.
    Thank you in advance,
    Chris

  • Motion Assistant Contour Array Points - Optimal Array Size?

    I am working with the NI Motion Assistant API and plyaing around with the Contour Move generation where I feed a set of X, Y target points to the Set Contour Move Properties.
    One of the inputs is Profile Calculation Constraint - Array Size, Constraint Value (which would be the array size to use).
    I am wondering if there is a way to calculate the "optimal" array size for any particular move?  I know I can have too few - can I have too many points in an array (being reasonable here and not planning to use the whole 2^32 size allowed).
    Thanks.
    Ryan Vallieu
    Automation System Architect

    Hi Ryan,
    Unfortunately, I'm not so sure I have a good answer for you. I'll evaluate some of the pros and cons below and then ultimately make a recommendation:
    Constraint Type: Array Size
    Pros
    You always have a fixed sized array of setpoints. If you are using a 73xx card, this simplifies setting up your contour buffer. It also avoids using a lot of memory.
    Cons
    For long moves, you could have a long time and large distance between position setpoints. The motion card will do a spline interpolation to smooth the move, but the splining algorithm is only so good.
    If you are sending the contour setpoints to a motion card, you don't know the interval between setpoints (although this isn't difficult to obtain).
    Constraint Type: Sampling Time
    Pros
    Regardless of the move, you always have a fixed time between setpoints. As long as your sampling time isn't too large, even fast moves should execute accurately.
    Cons
    For a long move, you could generate a lot of setpoints that consume a lot of memory.
    Setting up contouring buffers can be trickier.
    Conclusion
    It depends on what you expect the end customer to be doing. I prefer using the sampling time constraint since it is more robust for fast, long moves (and still good for slow, short moves). It will make creating contour buffers more difficult, but there is an example (Two-Axis Smart Contouring.vi) that shows how to dynamically update the buffer. Ultimately, I think it is better to focus on accurate moves than minimizing memory consumption.
    If you decide to go with the sampling time method, I would start with a constraint value of .01, since 10msec is the shortest interval when configuring a contour buffer. Try and generate some position profiles to see how big the arrays are. For optimizing, it is just a tradeoff between array size and the accuracy of the generated motion profile.
    Thanks,
    Paul B.
    Motion Control R&D

  • How do I set the screen size of my site?

    Hey guys making a site for a friend and I'm not sure on how I go about setting a screen size that can be viewed on varying screen sizes like 1280x800 and up. At the moment on my 1920x1080 display it looks fine but when I open it on her MacBook Pro (1280x800) it is cut of by half and my website has some fixed anchors which I do not allow scrolling so you are kind of stuck.
    Thanks to anyone that can help, can't find a tutorial anywhere

    In the normal state the screen on an iPad will rotate depending on which side is up. Any of the four sides can be up or on top and the display will look correct. But if you want to lock the display in one orientation you can. Swipe up from the bottom of the screen to reveal the Control Center. Then tap on the Orientation Lock icon. That's the icon of the small padlock surrounded by a circular arrow. That icon will appear at the top right of the display and the screen will no longer rotate. Repeat the same procedure to unlock orientation.

  • How do I set the default size of a new folder?

    I have finder sized the way I want for existing folders and if I do Finder > New Finder Window. These preferrences, however, do not seem to apply to new folders. Everytime I create a new folder on my desktop, and open that folder for the first time, the window size is really small and the sidebar is narrow. This is incredibally annoying. How do I set the default size for all new folders? Is there a plist file I can edit to fix this? Or an AppleScript I can run automatically in the background that fixes this? I am running Mavericks 10.9.1.

    If you use the Finder's New Finder Window command (command N) to create a new window, resize it, place it where you want, and set it for icon view or however you want it. Then close it. Closing it is what sets these as the default. That should become the default for every new Finder window you create using the new window command. But if you have lots of windows open at once and then close them, the last window you close will set a new default.
    There are lots of utilities that control Windows - their size and placement. I use one called Moom but there are many more.

  • Different fix lot size depending on the production version

    Hi all,
    I have the next scenario:
    2 production versions. 2 different fix lot size por each. So:
    Prod Version 1 - Fix lot size 200
    Prod Version 2 - Fix lot size 300
    I created the Quota Arrangement just to make SAP to take my favourite version. And trought the quota, I can define the lot size for each version. BUT.
    If I change the version in the order or in the planned order, the quantity don't change.
    So: How can I manage 2 different fix lot size for 2 different product versions? If I change the version once the order is created, how can I do the system change de quantity to the right one?
    Thanks in advante
    << Please do not offer points >>
    Edited by: Rob Burbank on Oct 1, 2010 2:53 PM

    I have n't  tried this scenario,
    This is my Idea
    Create a two production version
    for ex: lot size 100 to 1000, set the rounding profile qty as 1000
    for lot size 1001 to 99999, set the lot rounding profile value to 5000
    BY this way u can get the two lot based on the rounding profie
    Expert; please correct if i am wrong
    Edited by: Sundaresan . E. V on Oct 1, 2010 4:12 PM

  • Change array size and delete duplicate row

    Hello,
    I am running a program that does a for loop 3 times.  In each loop, data is collected for x and y points (10 in the example provided).  How can I output the array with the 30 points in a simple 2D array (size 2x30)?
    Also, from the array, how do I delete duplicate rows that contain the same x-value? 
    Thanks,
    hiNi.
    Solved!
    Go to Solution.
    Attachments:
    array size.vi ‏10 KB

    Hello,
    THANK YOU for solving my first issue!  Attached is the data set that contains the duplicate entries for the x-axis values.  The y-axis value may be different, but not the x.  I would like to delete the 2nd row that contains the same x-value.
    Here is simple example of my input and desired output:
    IN: 
    28.512000 -115.310532
    28.812000 -86.937660
    29.112000 -116.877052
    29.412000 -87.223625
    29.412000 -111.349045
    30.012000 -86.510780
    30.312000 -112.048187
    OUT:
    28.512000 -115.310532
    28.812000 -86.937660
    29.112000 -116.877052
    29.412000 -87.223625
    30.012000 -86.510780
    30.312000 -112.048187
    I am thinking of comparig the last x-axis value to the current one, and if it is the same, then not parse that row.  The attached VI is as far as I got.
    Any help will be greatly appreciated.
    Thanks,
    hiNi
    Attachments:
    delete duplicate row.vi ‏8 KB
    data.txt ‏1 KB

  • How to set a minimum size of a JFrame

    hi freinds,
    i have written a swing application which starts like this ,
    public class workerclass extends JFrame implements ActionListener {
    blah blah blah ..
    now can you please tell me how to set a minimum size for this application once it starts so that user cant minimize it more than that minimum size.....
    when i tried
    setDefaultLookAndFeelDecorated(true);
    it did my job by setting it to a particular size which wasnt minimizable, but this default look and feel looked ugly.
    so i used system look and feel
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    but with this how do i set the minimum size..
    please do help
    and one thing more , like
    in my main Method when i say
    new workerclass().setSize(500,500); or say(100,100) or say(300,300)
    new workerclass().setVisible(true);
    the size (***,***) , doesnt reflect when my application starts, it always starts with some damn fixed size , what can be the issue .
    waiting.........
    Thanks

    how do i set my Jrame to a minimum size so that
    minimizing beyond that can be restrictedThis is what the code is all about
    don't know your code but ..
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class workerclass extends JFrame implements
    ActionListener,ComponentListener {
    public void initcomponenet()
    setJMenuBar();
    pack();
    addComponentListener(this);
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new myclass.setSize(500,500);
    new myclass().setVisible(true);
    public void componentShown(ComponentEvent e)
         public void componentResized(ComponentEvent e)
              if(getWidth()<200)//restrict width to minimum 200
                   setSize(200,getHeight());
    if(getHeight()<100)//restrict Height to minimum
    um 100
                   setSize(getWidth(),100);
         public void componentMoved(ComponentEvent e)
         public void componentHidden(ComponentEvent e)
    Thanks kanad , your code is working ... you desere lot more than a duke dollar but for now i can only give that :-( , please accept it :-)

  • Problem Array size in Windows 7

    Hello All,
    I have a VI that by opening in a new Laptop, it show some Arrays controls misfits (with a diferent array size), however i can´t put it right.
    But when i make a EXE of this VI and if i run the EXE in another Computer, the front panel appears aligned and Ok.
    I´m using the labview 2009 Sp1 with Windows 7, this vi have been created in another laptop in a older version and always with the Windows Xp, and whenever i was updated the version of labview it always appeared correct on those Laptop, until now when i changed the laptop and the Operating System to Win7.
    Any help/advice is much apreciated
    Thanks,
    Solved!
    Go to Solution.

    Make sure you use the same font settings for all the controls that you want to be aligned. You might have some controls set to a specific font name and others left to the default Application font. LabVIEW substitutes the Application font for whatever the system default font is on a particular computer.
    Different fonts are default and available on different Windows versions so you can certainly get into trouble here if you mix font families and names in the same UI.
    If you request a specific font name and it is not available on a certain machine Windows will substitute it with a different font that it thinks looks similar but the heuristics of that substitution can sometimes  go really way south of the equator and simply give crazy results.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to adjust a "control array" size

    I have a program that creates a digital PWM signal with variable duty cycle. The duty cycle changes every 50 ms, but the overall wave frequency stays at a frequency determined by the user. I have the VI attatched.
    My problem is this...I need to be able to control the overall cycle time. This means the size of my array of duty cycles needs to adjust based on the cycle time (i.e. a cycle time of 1 second would require 20 of the 50 ms slots, while a 1.3 second cycle would need 26).
    I currently have only 4 slots in my array, meaning the total cycle time is .2 s. I understand how to manually add and remove elements to the array, but I can't figure out how to add a control to it so that the array size changes automatically, allowing much quicker entry of data. As of now I can make it work, it just takes super long to add or delete array elements. The ideal situaton would have a constant control for cycle time divided by 50 that would change the array size.
    I can't find any info on this, and I think I even saw a post asking that this kind of feature be added. I'm relatively new to this program.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    var_duty_cycle.vi ‏25 KB

    Currently, your VI is a one-shot deal. What you need is a state machine that updates the pct duty cycle array control as a function of the frequency while the current I/O code is idle.
    I would use an array of clusters, where each cluster contains e.g. a sequence number, a duty cycle, and a string as element label. Show the scrollbar and set the size whenever the relevant inputs change. Do you want to reset the current setting when the number changes or do you want to retain the current settings as much as possible? You could just use the existing values, reshape to the larger or smaller size, and write it back to the control via a local variable. Set all elements  except the percent to disabled so they act as indicators and cannot be changed by the user.
    (You also need to program around it if the operator tries to manually add more elements. A better solution would be this idea, so vote for it .)
    Some more general comments bout your code:
    Why do you use extended precision floating point. All your waits are internally just integers. EXT makes no sense
    There is a primitive for 1/x. However, you could just do a 1000/x and eliminate the multiplication afterwards. SInce you are dealing with integers, you can even do the division using quotient&remainder. Depending on the allowed frequency range there are possibly no orange data needed at all.
    Make the diagram constant representation match the rest of the code.
    The pulses/50ms indicator belongs before the loop. No need to recalculate and refresh it over and over from the same input values.
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • Can you family share between apple id's from two different countries?

    Hey, Can you link an Apple ID from one country, create it as the organiser for that family, and then add a family member to that family who has an apple id from another country. For example, make the Australian account the organiser then add an ameri

  • Show previous requisition requests link is missing in MSS.

    Hi All, In Manager Self-Service ->Recruiting->New Requisition Request->Request to fill postion. Here link show previous requisition requests missing. How to enable the link? This link is missed after portal is upgraded. Regards, Srinivasu.Y

  • Alerts for conc managers

    Hi, We installed apps pack for our R12 env. Now it's sending alerts for ICM only. How to setup for other managers like Standarad manager? Please help Regards

  • Window placement at run time

    Hi all, I'm a recent convert to the Mac and really love it, but something I miss is the ability to set the position of an application window when started; they always start in the top left; but I would like to be able to control where they start/open

  • Iphoto will not open. how can i fix it?

    iphoto will not open when i click on it. my photos are still on my computer but i cant see them in iphoto. i tried to repair disk permissions but nothing happened. i really don't want to loose my pics. what should i do?