How do I determine array size in a formula node

I am feeding an array into a formula node to perform an operation on. However the size of the array can be an arbitrary size. How can I determine its size to use for iterating through a for loop?
I suppose that I could add another input that is fed with the array size from the array palate but I would like to know if it can be done inside the formula node itself.

Your own advice is the only and best one.
greetings from the Netherlands

Similar Messages

  • How Can I Determine the Size of the 'My Documents' Folder for every user on a local machine using VBScript?

    Hello,
    I am at my wits end into this. Either I am doing it the wrong way or it is not possible.
    Let me explain. I need a vb script for the following scenario:
    1. The script is to run on multiple Windows 7 machines (32-Bit & 64-Bit alike).
    2. These are shared workstation i.e. different users login to these machines from time to time.
    3. The objective of this script is to traverse through each User Profile folder and get the size of the 'My Documents' folder within each User Profile folder. This information is to be written to a
    .CSV file located at C:\Temp directory on the machine.
    4. This script would be pushed to all workstations from SCCM. It would be configured to execute with
    System Rights
    I tried the script detailed at:
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/03/31/how-can-i-determine-the-size-of-the-my-documents-folder.aspx 
    Const MY_DOCUMENTS = &H5&
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(MY_DOCUMENTS)
    Set objFolderItem = objFolder.Self
    strPath = objFolderItem.Path
    Set objFolder = objFSO.GetFolder(strPath)
    Wscript.Echo objFolder.Size
    The Wscript.Echo objFolder.Size command in the script at the above mentioned link returned the value as
    '0' (zero) for the current logged on user. Although the actual size was like 30 MB or so.
    I then tried the script at:
    http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_27869829.html
    This script returns the correct value but only for the current logged-on user.
    Const blnShowErrors = False
    ' Set up filesystem object for usage
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("WScript.Shell")
    ' Display desired folder sizes
    Wscript.Echo "MyDocuments : " & FormatSize(FindFiles(objFSO.GetFolder(objShell.SpecialFolders("MyDocuments"))))
    ' Recursively tally the size of all files under a folder
    ' Protect against folders or files that are not accessible
    Function FindFiles(objFolder)
    On Error Resume Next
    ' List files
    For Each objFile In objFolder.Files
    On Error Resume Next
    If Err.Number <> 0 Then ShowError "FindFiles:01", objFolder.Path
    On Error Resume Next
    FindFiles = FindFiles + objFile.Size
    If Err.Number <> 0 Then ShowError "FindFiles:02", objFile.Path
    Next
    If Err.Number = 0 Then
    ' Recursively drill down into subfolder
    For Each objSubFolder In objFolder.SubFolders
    On Error Resume Next
    If Err.Number <> 0 Then ShowError "FindFiles:04", objFolder.Path
    FindFiles = FindFiles + FindFiles(objSubFolder)
    If Err.Number <> 0 Then ShowError "FindFiles:05", objSubFolder.Path
    Next
    Else
    ShowError "FindFiles:03", objFolder.Path
    End If
    End Function
    ' Function to format a number into typical size scales
    Function FormatSize(iSize)
    aLabel = Array("bytes", "KB", "MB", "GB", "TB")
    For i = 0 to 4
    If iSize > 1024 Then iSize = iSize / 1024 Else Exit For End If
    Next
    FormatSize = Round(iSize, 2) & " " & aLabel(i)
    End Function
    Sub ShowError(strLocation, strMessage)
    If blnShowErrors Then
    WScript.StdErr.WriteLine "==> ERROR at [" & strLocation & "]"
    WScript.StdErr.WriteLine " Number:[" & Err.Number & "], Source:[" & Err.Source & "], Desc:[" & Err.Description & "]"
    WScript.StdErr.WriteLine " " & strMessage
    Err.Clear
    End If
    End Sub
    The only part pending, is to achieve this for the 'My Documents' folder within each User Profile folder.
    Is this possible?
    Please help.

    Here are a bunch of scripts to get folder size under all circumstances.  Take your pick.
    https://gallery.technet.microsoft.com/scriptcenter/site/search?query=get%20folder%20size&f%5B0%5D.Value=get%20folder%20size&f%5B0%5D.Type=SearchText&ac=2
    ¯\_(ツ)_/¯

  • How do I determine the size of an event (cmd I does not show any size for events).

    How do I determine the size of an Event in iPhoto? (Cmd + I does not show size information at the event level).

    If you're running iPhoto 8 (09) select the event and look at the Info pane at the lower left hand corner of the window.  It will give you the number of photos and size:
    for iPhoto 9 (11) open the Event, select all of the photos in it and open the Info drawer at the right by typing Command+i.  The number of photos and size will be at the top of the Info drawer.
    OT

  • How do I determine the size of my iTunes library

    How do I determine the size of my iTunes library?

    In Music view, you will see the song count, size, and total playing time in the Status Bar at the bottom. 
    If the Status Bar is not present, enable it either via View > Show Status Bar, or by holding the CTRL key while you press the / key.

  • HELP: Run-time array dimension in LabVIEW formula node

    I need to dimension an array at run time within a formula node as follows:
    int32 i,N;
    N = sizeOfDim(inputArray,0);
    float64 outputArray[N];
    for (i = 0; i outputArray[i] = myfunction(inputArray[i]);
    However, LabVIEW complains "Formula Node: index list expected". On the
    other hand, if I say
    float64 outputArray[1000];
    LabVIEW is perfectly happy. But that's not what I need to do! Is there
    an alternative
    way of accomplishing my goal?
    BTW, I've tried calculating N outside the formula node and then
    presenting it as
    an input with the same results. I've got a bad feeling that run time
    array dimensioning
    just isn't allowed.
    TIA,
    Hugh

    Can't you just use the Initialize Array function outside the formula node and pass that instead?

  • Given array control reference, how do I obtain array size programatically

    If an array control reference is passed to a sub-vi, how do I obtain the current length of the array within the sub-vi?  I've tried two properties:  "NumRows", which as documented, contains the visible number of rows in the array control.  "IndexVals" contain the indices of the array element in the upper left corner of the array control.  There seem to be no methods for obtaining the current array length.  I tried changing the class of the array reference to cluster then using the "Controls[]" property... but this generated a runtime error.  What am I missing?  Thanks.
    Solved!
    Go to Solution.

    Taki1999 wrote:
    There's a lot of casting going on in your subvi.
    What is the actual use case?  There might be a way to do this which doesn't require the casting and you could work just with the reference that is passed in.
    For your method you need to wire in a strict class specifier into the To More Specific Class conversion.  I'm not sure how to make the strict class specifier.
    I can help with that but first...
    Working with arrays on unknown data types is no esy task and determining the size is a special challenge and I did just that in this Nugget that talks about using control references. This task is much easier when you know at development time what is in the array. That is where the strict type casting comes into play.
    What I would do...
    1) Make sure the contents of the array is a type def (to support data strcuture changes in the future).
    2) Go to the FP of the VI that has the array in question and drop a generic control ref control.
    3) Ctrl-copy and drag the array in question INTO the the generic ref (still working on the FP). You can tell when you find the "sweet spot" in the ref control because it will switch it appearence. See this mini-nugget for an image where the same thing can be done with que refs.
    4) Make the now strict ref a type def.
    5) Use the type-def'd ref from step #4 in the sub-VI as the proptype used by the "To More Specific...."
    After those changes you should be able to work with array in the sub-VI as if it were in the top level.
    BTW:
    Doing the above on the control in the sub-VI that brings in the ref would allow skipping the "To more Specific..."
    Have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How do I determine the size of an object?

    After an object is instantiated, is there anyway to determine its size (in bytes)?

    Why do you want to know? Java handles memory management for you.
    IIRC for Sun JVM 1.4:
    Objects: four bytes for each reference, boolean, byte, short, int, float or character field, eight bytes for each long or double field, plus sixteen bytes header information.
    Arrays: length * (four for reference, int or float; one for boolean or byte; two for short or character; eightfor long or double), plus sixteen bytes header information.
    Pete

  • How do I determine the size of an object on a particular layer?

    Whether it's a rectangle, circle, line, etc. how do I determine what the size of an object is on a particular layer?

    Right click on the rulers and set the scale to pixels in the dialog
    Go to View>new guide and select the position of the guide lines along horizontal and vertial axes
    Window>info brings up the Info Palette. The information in the right lower corner provides a readout of any selection that you make, e.g. with the marquee tool
    View>grid allows one to bring up a non-printable grid which is useful for orientation. The grid can be set up with subdivisions to suit via Edit>preferences>guides and grid
    You can open a duplicate layer at the top of the stack, then using the brush tool create a straight line for visual projection. The layer can be deleted at any time. To create a straight line, click on the begin point, hold down the shift key, and click on the end point
    Hope that one of these options is useful for your purpose. Please post your progress.

  • How do I determine the size of my iPhoto library?

    I am running out of disk space and I assume that it is due to my photos.
    #1 - how do I determine if this is the case?
    #2 - how can I figure out the size of my library so I buy the correct sized external HD?
    #3 - what is the best practice for moving iPhoto to an external HD? Do people move over only "older" photos or just run iPhoto off the external HD completely?
    Thank you so very much!
    Jen

    #2 - how can I figure out the size of my library so I buy the correct sized external HD?
    Go to your Pictures Folder and find the iPhoto Library there. Use the Finder's File -> Get Info command to get the size of the Library. When you purchase an extenral disk, make sure to format it Mac OS Extended (Journaled). Also, allow room to grow.
    #3 - what is the best practice for moving iPhoto to an external HD? Do people move over only "older" photos or just run iPhoto off the external HD completely?
    There isn't a "best practise" there's only what you need to do. IF the Library is on the external, then you can only view it with the external attached. Are you on a Laptop? Desktop? If you're on a desktop it probably doesn't matter. If you're on a Laptop it might.
    Regards
    TD

  • How do you determine what size tablet to get (storage wise)?

    I looking to get a table (either the IPad or the Asus Transformer Primer.  I'm thinking of using it mostly for travel and would like to use it for internet connections, email and downloading & watching movies & music.  How can I figure out how much storage (16gb, 32gb, or 64gb) I'm going to need?
    Thanks!

    I determined what size of tablet I got (storage wise) based on two things: 1) Price and 2) Whether or not I could easily expand the storage.
    For starters, you are going to get the most bang for your buck from the Prime. The 32GB Prime costs the same as a 16GB iPad. So right there you have twice the storage for the same price.
    If you happen to fill up the 32GB of internal storage (which is not that hard since you pan on loading the thing up with movies and music) you can simply get a 32GB micro sd card for 40$ and double your space (this is not even an option with the iPad). Also, you could add even more space via the SD card slot or the USB port on the keyboard dock.
    With the iPad, once you fill the thing up, you are done. From that point on you have to manually move music and movies off the device in order to add new stuff. I used to have to do this with my old iPod touch and it was quite a tedious and annoying thing to have to do. Of course I only had 8GB to work with back then.

  • 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];

  • Determining array size

    How can I tell the size of an array? Is there a function? Do arrays automatically contain a '\n' or anything as their last element? I have a for loop that needs to process each element in the array, but it needs to know when to stop.

    if you declare the following array:
    int array[] = {1, 2, 3, 4, 5,};
    the following would get the length:
    int length = array.length;
    length would then equal 5. remember not to end the array.length statement with () ( array.length() ) as this is how you get the length of a string. a little fyi, pick up the book, Java 2 Black Book by Steven Holzner, the best java book i've seen, good reference, hope this helps.

  • How do I get an array output on a Formula Node?

    My problem is simply that I cannot figure out how to get an output on a Formula Node to be an array. Documentation states that "you must declare local arrays and output arrays in the Formula Node" but doesn't say anything more than than. Attempts to put something like "float32 out[100];" for an array output called "out" fail.
    If anybody knows how you can do this or even knows if it is possible I would appriciate your help.
    Thanks,
    Naveen

    I found a typo in the formula node I was doing that was making the output not be an array. I don't think I was getting the error before but I was going to put together an example VI to attach here and I found it. So, thanks for your help even tho it was a stupid little mistake on my part.

  • Array index problem in formula node

    dear friend
    I'm trying to use formula node to solve a problem because I make this program using c at the begining.
    It runs perfectly in turbo c, but somehow it doesn't work in the formula node.
    I try to debug my source code, and I find that the formula node seems can't read the true value in
    the array.
    Here is the code in the formula node.
    int32 i,j,k;
    for ( i = 0 ; i < sopa; i++ )
     j = 1;
     ep[i][0] = pa[i];
     ep[i][1] = np[ep[i][0]][0];
     while ( ep[i][j-1] != exit )
      for ( k = 0 ; k < sonp ; k++ )
        if ( np[ep[i][j-1]][k] != -1 && (pc[ep[i][j-1]][ep[i][j]] + pc[ep[i][j]][exit] >= pc[ep[i][j-1]][np[ep[i][j-1]][k]] + pc[np[ep[i][j-1]][k]][exit] ) && (pc[ep[i][j-1]][np[ep[i][j-1]][k]] == org[ep[i][j-1]][np[ep[i][j-1]][k]] ))
          ep[i][j] = np[ep[i][j-1]][k];
      j++;
    This is the part that I think the problem might be.
    if ( np[ep[i][j-1]][k] != -1 && (pc[ep[i][j-1]][ep[i][j]] + pc[ep[i][j]][exit] >= pc[ep[i][j-1]][np[ep[i][j-1]][k]] + pc[np[ep[i][j-1]][k]][exit] ) && (pc[ep[i][j-1]][np[ep[i][j-1]][k]] == org[ep[i][j-1]][np[ep[i][j-1]][k]] ))
     ep[i][j] = np[ep[i][j-1]][k];
    I state that "np[ep[i][j-1]][k] != -1" but I do get the value -1 in the array "ep".
    Could someone tell me why I get -1 in the array?
    I hope I can finally do it all by labview not using formula node,but array like "pc[ep[i][j-1]][np[ep[i][j-1]][k]] "
    seems very hard to wire in labview. Could someone give me some good advices of doing this?
    Thanks for your help

    altenbach 已寫:
    normanshi wrote:
     ep[i][0] = pa[i];                                          (A)
     ep[i][1] = np[ep[i][0]][0];                            (B)
    ...    if ( np[ep[i][j-1]][k] != -1 && ... )          (C)
          ep[i][j] = np[ep[i][j-1]][k];                       (D)
    I state that "np[ep[i][j-1]][k] != -1" but I do get the value -1 in the array "ep".
    Could someone tell me why I get -1 in the array?
    I hope I can finally do it all by labview not using formula node,but array like "pc[ep[i][j-1]][np[ep[i][j-1]][k]] "
    seems very hard to wire in labview. Could someone give me some good advices of doing this?
    There are many possible scenarios to get a -1 in the ep output. For example if the -1 gets already written in step (A) or (B) at a certain index, and that index does not get overwritten in step (D). You are indexing all over the place! Is there some bounds checking on the array contents? What are typical inputs and array sizes?
    I'm sure about that the -1 doesn't get already written in step (A) or (B) because ep[i][0] and ep[i][1] is fine. What really makes me confuse is that sometimes ep array has the value like this.
    That means it does overwritten some value in step (D). The -1 should never be written into it because I have already state that np[ep[i][j-1]][k] != -1. Somehow I still get -1,and this is really strange! I'm indexing all over the place becuase I can't figure out a better way to achieve my requirement.
    I think I should briefly tell you what I'm trying to do. In this program,I input some values which means the distance from one point to another. Then I use floyd's all pairs shortest-path algorithm to find all the shortest distance. Finally I want to find out the "shortest path". I mean like from point 4 to point 0,the shortest path might be like 4 -> 2 -> 1 -> 0, and what the formula node part do is trying to find out this "shortest path". Maybe you can give me some better advice of doing this, I have been thinking a better way to do it for about two months. I think I'm really not good at this.
    I try to do it all by labview ,but again I get a strange problem. This time the ep[i][j-1] doesn't get the correct value. In the first time i=0 j-1=0 ep[i][j-1] = 1,but the second time i = 0 j-1 = 1 ep[i][j-1] = 0. This makes the "ep[i][j-1]!=exit" get the incorrect boolean value. The ep[i][j-1] should be 2,not 0. I try to use highlight to find if I make any mistake, but I can't one.This is the input and I put the labview program in attached file (temp4.vi).
    Could you help me find out why this happened?
    Thanks for your help altenbach!
    由 normanshi 在 08-19-2006 10:06 PM 上編輯的訊息
    Attachments:
    temp4.vi ‏191 KB
    ep.jpg ‏10 KB
    input.jpg ‏9 KB

  • How to program a C like pragraming in formula node?

    I need to write a simple C like progarm in the the formula. The below is the program.
    int x, i ;
    float large;
    large=a[0];
    for(i=1; i<202; i++)
    if(a[i]>=large)
    x=i;
    return x;
    But Labview thinks there is an error in it. But I can not find the error.So, anyone can help me?

    If you use a Formula Node, you need to do something like this.
    int x, i ;
    float large, large707;
    large=a[0];
    for(i=1; i<202; i++)
    if(a[i]>=large)
    large = a[i];
    x=i;
    large707 = large * 0.707;
    Then you need to add Formula Node outputs for large and large707.
    Note that I added the line large = a[i]; to save the new max to large.
    If you use Array Max & Min, use the Multiply function from the numeric palette to multiply the max value by 0.707. Look at the LabView help for Array Max & Min.
    Look at the attached example.
    Attachments:
    ArrayMax707.vi ‏26 KB

Maybe you are looking for

  • F110 Issue:there is diff between of 1000usd in F110 payment list & dme file

    H i experts F110 Issue: there is difference between of 1000 usd in F110 payment list and Dme file. please let me know reason regards sachin

  • BILLING DOCUMENT CANCELLATION PROBLEMS

    Hi, in my process from POS we have created IDOCS,than IDOCS we are creating several docuemtns like, 1.article document 2.billing documents, Now from billing documents, accounting documents has been created with different g/l account and also with pos

  • UMI 7764 second axis not working

    I have a strange problem with my NI motion control setup and I wondered if anyone could help me. I have the following setup: PCI-7330 connected to a UMI-7764 Connected to the UMI-7764 I have two P70530 stepper drives, themselves connected to two Nema

  • Question on Plan Table

    Hi, This is the Explain Plan for one of my SQL queries PLAN_TABLE_OUTPUT | Id  | Operation            |  Name       | Rows  | Bytes | Cost  | Inst   |IN- OUT| |   0 | SELECT STATEMENT     |             |   101 |  7676 |    60 |        | PLAN_TABLE_OU

  • URL getting concatenated when user logged in for first time

    Hi     I am sending the below url to the mail as a notification . http://<server>:<port>//irj/portal?NavigationTarget=%3ROLExyz when the user click on the link ,it should route to the particular page case 1 when user already logged in, then after cli