Output from an array

forgive me for this but i need some guidance.
Ive got an array of integers, how can i convert these to a string. I was sure there was a toString function but having checked the API for arrays im in trouble.
I tried to set a string variable like you output to the screen:
String arrayAsString = array[0] +" "+ array[1] +" "+ array[2] +" "+ array[3] +" "+ array[4];but it wouldnt work.
This is what i want:
Array:
| 1 | 9 | 17 | 23 | 40 | ------> String: "1 9 17 23 40"
Any help? is there a toString function??? im sure ive seen it before somewhere
Thanks

I tried to set a string variable like you output to
the screen:
String arrayAsString = array[0] +" "+ array[1]
+" "+ array[2] +" "+ array[3] +" "+ array[4];
That's what you'd do, or better yet concatenate together in a loop ranging from 0 to the length of the array.
but it wouldnt work.Yes it would, given an array containing at least 5 integers anyway.

Similar Messages

  • Array output from formula node

    How to get an array output from the formula node.I am trying to use a for loop inside the formula node and want an array output.

    You cannot place a For or While Loop inside the formula node.
    Here is what the Help Description says about the syntax inside the Formula Node:
    Formula Node
    Evaluates mathematical formulas and expressions similar to C on the block diagram. The following built-in functions are allowed in formulas: abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, cot, csc, exp, expm1, floor, getexp, getman, int, intrz, ln, lnp1, log, log2, max, min, mod, pow, rand, rem, sec, sign, sin, sinc, sinh, sizeOfDim, sqrt, tan, tanh. There are some differences between the parser in the Mathematics VIs and the Formula Node.
     Place on the block diagram
     Find on the Functions palette
    Refer to Creating Formula Nodes and Formula Node Syntax for more information about the Formula Node and the Formula Node syntax.
    Note  The Formula Node accepts only the period (.) as a decimal separator. The node does not recognize localized decimal separators.
    <SCRIPT type=text/javascript>if (typeof(writeVarRefs)=="function"){writeVarRefs("763");}</SCRIPT>
    <SCRIPT type=text/javascript> if(typeof(lvrthelp763) != "undefined"){document.writeln(lvrthelp763)}</SCRIPT>
    <SCRIPT type=text/javascript> if(typeof(lvfpga763) != "undefined"){document.writeln(lvfpga763)}</SCRIPT>
    <SCRIPT type=text/javascript> if(typeof(lvemb763) != "undefined"){document.writeln(lvemb763)}</SCRIPT>
    <SCRIPT type=text/javascript> if(typeof(lvpdahelp763) != "undefined"){document.writeln(lvpdahelp763)}</SCRIPT>
    <SCRIPT type=text/javascript> if(typeof(lvtpchelp763) != "undefined"){document.writeln(lvtpchelp763)}</SCRIPT>
    <SCRIPT type=text/javascript> if(typeof(lvblackfin763) != "undefined"){document.writeln(lvblackfin763)}</SCRIPT>
    <SCRIPT type=text/javascript> if(typeof(lvdsp763) != "undefined"){document.writeln(lvdsp763)}</SCRIPT>
    Example
    Refer to the Create Function with Formula Node VI in the labview\examples\general\structs.llb for an example of using the Formula Node.

  • How to output last 4 arrays from a For Loop?

    Hi People,
    I am almost at the end of my tether. I really hope someone could please help me.
    Any input would be welcome. VI attached.
    VI explanation:
    I initialize an array.
    The random number generator simulates my camera input.
    Depending on which iteration it is, the data is added into one of four output arrays.
    'x-y*floor(x/y)' gives a remainder value of 0, 1, 2 or 3.
    'Case Selector' just adds 1 to 'x-y*floor(x/y)' to get case 1, 2, 3 or 4.
    Shots 1, 5, 9 etc are added to Array 1 (Case 1).
    Shots 2, 6, 10 etc are added to Array 2 (Case 2).
    Shots 3, 7, 11 etc are added to Array 3 (Case 3).
    Shots 4, 8, 12 etc are added to Array 4 (Case 4).
    Averaged Output displays the averaged value i.e. the total value divided by the number of shots saved in that array ('Set (IQ+1)').
    My problems are:
    1) I would like to output only the last 4 sets of data from the Averaged Output 1, 2, 3 and 4 to 4 different files (i.e. save as .csv what is displayed onscreen in indicators 'Averaged Output 1', 2, 3 and 4 at the end of all iterations.
    Where should I place my file save diagram disable so that it does this?
    Putting it outside the main For Loop with auto-indexing on gives me one file with all previous data. (This is not feasible as my number of shots should number in the thousands)
    Putting it outside the main For Loop with auto-indexing off gives me only the last set of data. (I need the output for 4 Arrays, not just the last run)
    Putting it inside the main For Loop (as shown) gives me the same number of files as number of iterations. (Again not feasible due to large number of files that will be generated and slow camera capture)
    For the sake of fast camera capture, I would like these 4 files to only output once all the image captures are complete.
    2) Would preferably like to name the file once and for the programme to append '(1)', '(2)', '(3)' and '(4)' to filename of the appropriate 'Averaged Output' Arrays but file path controls are another big headache for me.
    3) P.s. is initializing one array enough to avoid using Memory Manager? Or should I initialize 4 arrays?
    I am using Labview 2010.
    Thanks so much,
    Jaslyn
    Solved!
    Go to Solution.
    Attachments:
    Help Understanding Arrays and file paths (10).vi ‏26 KB

    Thanks so much Lennard!!
    Hi JKSH,
    I've been busy trying to complete the dang code, but for completeness so that other users can learn too, I shall answer your queries. Thanks for looking in.
    First, what do you mean by "add"? Your code in your case strcuture sums your input values, so your array size doesn't change. However, you also said "Putting it outside the main For Loop with auto-indexing on gives me one file with all previous data. (This is not feasible as my number of shots should number in the thousands)" -- it sounds like you are expecting an array with thousands of elements. So, what should "Output Array N" look like?
    Ans: Output Array N should be a 4x4 array of the summation of all the numbers generated during every 4th iteration.
    i.e. if random number 1=1, random number 2=2, etc, And 'No of iterations' is 12,
    Output Array 1 should be 1+5+9:
    15 15 15 15
    15 15 15 15
    15 15 15 15
    15 15 15 15
    (Note: Most of your arrays are 4x4, but in Case #2 you created 128x128. I prersume this is a typo?)
    Ans: Kind of, I'm using a 4x4 array of randomly generated numbers as an example but my actual data will be the 128x128 pixel output of a camera. And during actual experimentation, 'No of Iterations' will number in the thousands.
    Second, why do you add your "simulated camera input" to the "Initialized Array"? You can add it direcly to the previous output inside your case structure.
    Ans: See answer to question 3
    Third, have a look at shift registers: http://www.ni.com/gettingstarted/labviewbasics/shiftregisters.htm. Use them instead of Feedback Nodes to make your code tidier.
    Ans: I did try.. But I can't seem to add shift registers to the case structure, only the for loops outside. Are you sure it can be done..?
    jaslyn wrote:
    1) I would like to output only the last 4 sets of data from the Averaged Output 1, 2, 3 and 4 to 4 different files (i.e. save as .csv what is displayed onscreen in indicators 'Averaged Output 1', 2, 3 and 4 at the end of all iterations.
    Where should I place my file save diagram disable so that it does this?
    For the sake of fast camera capture, I would like these 4 files to only output once all the image captures are complete.
    You will need to call "Write to Text File.vi" 4 times to write 4 files. So, you should finish your loop, then call this VI 4 times.
    Ans: How do I get it to extract the data from each of the 4 cases in my case structure?
    jaslyn wrote:
    2) Would preferably like to name the file once and for the programme to append '(1)', '(2)', '(3)' and '(4)' to filename of the appropriate 'Averaged Output' Arrays but file path controls are another big headache for me.
    You can create strings first, then convert them into paths: http://zone.ni.com/reference/en-XX/help/371361G-01/glang/string_to_path/
    Thanks
    jaslyn wrote:
    3) P.s. is initializing one array enough to avoid using Memory Manager? Or should I initialize 4 arrays?
    I'm not sure what you're asking; can you please clarify what you mean by "avoid using Memory Manager"? But anyway, you've actually initialized FIVE arrays: 1 outside the loop, and 1 inside each case.
    I've read that to avoid fluctuations in memory usage, it is a good idea to initialize arrays to their expected size before the start of data collection. That was just what I was trying to do.

  • Output signal from an array of excel to servotube

    Hi All,
    I'm doing a test that the input of the test should be an excel files of 2D array (for example, we can have 1000 point sinusoid here). I want to get analog output from this 2D array and send it to a servotube. The problem is how I can send this sinusoid analog output to the servotube. Two files are attached here, the post-filter and sensor test with servotube. The array analog output comes from the post-filter. What I wanna do is to send this analog output to the servotube which shows in the case of Another VI.
    I appreciate everyone's help.
    Thank you very much.
    Best
    Yu
    Attachments:
    Post-Filter Multiple Columns.vi ‏24 KB
    Sensor Test with Servotube_64 bit.vi ‏63 KB

    First, Thanks for your answering. Here is the file I used as a sample. It's the angle and the sine value of angles. 
    Attachments:
    test.txt ‏25 KB

  • Without loops how can i read data from associative Array??

    Hi all,
    I am facing scenario like...
    i need to read data from associative array  without using loops is it possible,
    CREATE OR REPLACE PACKAGE BODY test_pkg IS
        TYPE t1 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
       -- in array we can expect more than one row or sometimes no data also.
      FUNCTION test1(vt1 T1 DEFAULT CAST(NULL AS t1)) RETURN NUMBER IS
      BEGIN
        -- basically in array we'll get data of column2
        -- this loop should satisfies table1.colum2 = nvl(NULL, table2.colum2 )if array is null.
        -- if array is not null then only compare with array values
        FOR i IN (SELECT t1.colum1,t1.column2
                         FROM table1 t1, table1 t2
                              WHERE t1.colum1 = t2.column1
                                AND t1.colum2 = nvl(vt1, t2.colum2)
          LOOP
            generateTEXT(i.colum1, i.colum2);
         END LOOP;
      END test1;
    END test_pkg;
    in table1 we have date like...
    colum1          column2
    Jan                  1
    Feb                  2
    Mar                  3
    if i call select test_pkg.test1(1) from dual then output should
    be Jan..
    and
    select test_pkg.test1(null) from dual then it should display all elements from table1.
    Jan                  1
    Feb                  2
    Mar                  3,
    Thanks for your quick replay..

    i need to read data from associative array  without using loops is it possible,
    No - you would need to create a SQL type and then use the TABLE operator to unnest the collection.
    create or replace TYPE my_nums IS TABLE OF INTEGER;
    DECLARE
    --  TYPE my_nums IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
      v_nums my_nums := my_nums(1, 2, 3);
      v_total number;
    BEGIN
      select sum(column_value) into v_total from table(v_nums);
      DBMS_OUTPUT.PUT_LINE
        ('Sum of the numbers is ' || TO_CHAR(v_total));
    END;
    Sum of the numbers is 6

  • How to delete rows from 2D array in this case...

    Hello. I'm just begging adventure with labview so please for patient. I created a program whitch suppose work in following way:
    2D Input array is array created by FOLDER BROWSING subVI. It works in this way,that browse folder and looking for txt files whose contanins measurment data. In my case subVI founds 4 files,and from theirs headers read information about what kind of data are in file also their's path. In this way is created 2D Input Array. subVI named PLOTS FROM PATHS ARRAY make picture with polar/XY plot. It's create only those plots and legends on one picture as many files(their paths) is setted to the program by output array. I made this subVI in that way and I would not like to change it. 
    My problem is that in even loop (witch check for any change by user) program suppose to relay anly those rows(files) for which checkbox are marked, e.g. marking anly 1 and 4 box, program should chose from input array row 1 and 4 only and pass them to output array,then  PLOTS FROM PATHS ARRAY subVI makes a picture only with 1 and 4 plot and legend only for plot 1 and 4. The best solution would be some relay witch is avtivated by logical signal. It lost to me ideas how to solve it, I'm just in blaind corner...
    I tried to use delete from array but I don't know how to do use it properly in this program,becease it can be only before or afeter for loop. Below is scan of front panel and also main problem. Please set me up somehow to solve this problem. 
    Regards 
    Solved!
    Go to Solution.
    Attachments:
    plots selector.vi ‏17 KB
    problem.PNG ‏18 KB

    I have attached a vi. Is this the one that you need?
    Anand kumar SP
    Senior Project Engineer
    Soliton Technologies Pvt Ltd
    Attachments:
    plot selector modified.vi ‏14 KB

  • Is there a way to remove elements from an array 1 by 1?

    I have an two arrays, and they vary in size depending on a parameter set by the user (both arrays are the same size though, they both can vary in length). What I need to do, is remove elements one by one from the array, and use these as indices for another array. Basically, I built two arrays to store x-values on a graph. At the first value on the first array, I want y values on the graph to move from 0 to Y (any value). Then on the first value on the second array, I want the y values to move back from Y to 0 (creating a pulse, essentially, from the first value on the first array and the first value on the second array). By having each x value act as an indice for the y array, I belive I can acc
    omplish this (ie, y =0 up to indice 90, then y = 5, then at indice 100, y goes back to equaling 0). I know this is poorly phrased, but it's difficult to explain. If anyone could help me out, I'd really appreciate it.

    jdaltonnal,
    Note: to add an attachment based on your comment of 6/12/01 to my earlier reply, I had to go back to this 'answer' mode, which gives me the option of adding attachments.
    Per your comment, you have a sequence, so I've added a simple sequence structure and the 2nd array to provide a 250ms delay between each array output. Let me know...Doug
    Attachments:
    arrayindexplus1withseqdelays.vi ‏27 KB

  • Multiple MovieClips Loading SWF From Same Array (Posted Code)

    Hey there,
    I'm currently working on a project that has eight separate movieclips (for loading content) on separate layers.  I have placed code in these mc's to randomly draw from the same array of 61 different swf's.  Each mc randomizes the array just fine, but here's the problem.  The code works great for one instance, but as soon as I add the code (including renaming) to the other mc's, the swf won't load/play.  I am not getting an compiler errors, and am kinda stuck as to what the problem may be.  Here's an example of the code I'm using.  It is the same for each mc, except I'm renaming the variables as well as the instances for each mc.  Thanks for any suggestions.
    Mike
    //filename = new Array("screen1.swf","screen2.swf","screen3.swf","screen4.swf","screen5.swf","screen6.swf" ,"screen7.swf","screen8.swf","screen9.swf","screen10.swf","screen11.swf","screen12.swf","s creen13.swf","screen14.swf","screen15.swf","screen16.swf","screen17.swf","screen18.swf","s creen19.swf","screen20.swf","screen21.swf","screen22.swf","screen23.swf","screen24.swf","s creen25.swf","screen26.swf","screen27.swf","screen28.swf","screen29.swf","screen30.swf","s creen31.swf","screen32.swf","screen33.swf","screen34.swf","screen35.swf","screen36.swf","s creen37.swf","screen38.swf","screen39.swf","screen40.swf","screen41.swf","screen42.swf","s creen43.swf","screen44.swf","screen45.swf","screen46.swf","screen47.swf","screen48.swf","s creen49.swf","screen50.swf","screen51.swf","screen52.swf","screen53.swf","screen54.swf","s creen55.swf","screen56.swf","screen57.swf","screen58.swf","screen59.swf","screen60.swf","s creen61.swf");
    //i = filename.length;
    //k=random(i)
    //_root.movieTarget.loadMovie(filename[k]);
    //movieTarget._xscale=80;
    //movieTarget._yscale=80;
    var fileNames:Array = ["screen1.swf","screen2.swf","screen3.swf","screen4.swf","screen5.swf","screen6.swf","scr een7.swf","screen8.swf","screen9.swf","screen10.swf","screen11.swf","screen12.swf","screen 13.swf","screen14.swf","screen15.swf","screen16.swf","screen17.swf","screen18.swf","screen 19.swf","screen20.swf","screen21.swf","screen22.swf","screen23.swf","screen24.swf","screen 25.swf","screen26.swf","screen27.swf","screen28.swf","screen29.swf","screen30.swf","screen 31.swf","screen32.swf","screen33.swf","screen34.swf","screen35.swf","screen36.swf","screen 37.swf","screen38.swf","screen39.swf","screen40.swf","screen41.swf","screen42.swf","screen 43.swf","screen44.swf","screen45.swf","screen46.swf","screen47.swf","screen48.swf","screen 49.swf","screen50.swf","screen51.swf","screen52.swf","screen53.swf","screen54.swf","screen 55.swf","screen56.swf","screen57.swf","screen58.swf","screen59.swf","screen60.swf","screen 61.swf"]
    fileNames.sort(function () {
        return Math.round(Math.random());
    trace("Random array: " + fileNames);
    var currentMovieNum:Number = 0    ;
    this.createEmptyMovieClip("container", _root.getNextHighestDepth());
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclListener:Object = new Object();
    mcl.addListener(mclListener);
    mclListener.onLoadInit = function(movieTarget:MovieClip) {
        trace("Preparing to play: " + fileNames[currentMovieNum]);
    movieTarget.loadClip(fileNames[currentMovieNum], container);
    movieTarget._xscale=80;
    movieTarget._yscale=80;
    this.onEnterFrame = function() {
        if (currentMovieNum == fileNames.length) {
            currentMovieNum = 0;
        } else {
            if (movieTarget._currentframe == movieTarget._totalframes) {
                mcl.loadClip(fileNames[currentMovieNum], movieTarget);
                currentMovieNum++;

    Thanks for taking a look at this.  The randomizer seems to work just fine, as here is a sample output from the trace:
    Random array: screen47.swf,screen2.swf,screen57.swf,screen21.swf,screen9.swf,screen49.swf,screen36.swf, screen17.swf,screen6.swf,screen59.swf,screen15.swf,screen12.swf,screen33.swf,screen25.swf, screen42.swf,screen22.swf,screen24.swf,screen40.swf,screen11.swf,screen19.swf,screen32.swf ,screen35.swf,screen7.swf,screen39.swf,screen23.swf,screen4.swf,screen1.swf,screen48.swf,s creen31.swf,screen45.swf,screen29.swf,screen18.swf,screen51.swf,screen14.swf,screen34.swf, screen10.swf,screen38.swf,screen26.swf,screen16.swf,screen13.swf,screen55.swf,screen37.swf ,screen44.swf,screen61.swf,screen43.swf,screen20.swf,screen28.swf,screen30.swf,screen56.sw f,screen50.swf,screen54.swf,screen53.swf,screen46.swf,screen58.swf,screen41.swf,screen8.sw f,screen5.swf,screen52.swf,screen3.swf,screen60.swf,screen27.swf
    Might you be able to lead me down a better path?  I'm currently unable to get this to function for multiple symbols.  The previous is the code that I've placed on the first keyframe of a movieclip with an instance name of movieTarget.  Works swimmingly for one, but once the code is placed on the other symbols on different layers, it seems to only work on the lowest layer in the project.
    M

  • Creating a String from an array of characters.

    Hi,
    i'm trying to make a string from an array of characters, this i've managed:
    char data[] = new char[x];
    String str = new String(data);My problem is this: Let's say the array of characters has space for 10 chars, but i only input 5, when i convert it to a string, the 5 characters show up fine, but the last remaining characters show up as little boxes ( [] [] [] [] [] ) .
    It there a way to remove these?
    Thanks in advance
    Mike

    jverd wrote:
    georgemc wrote:
    String str = new String(data).trim();
    Does the null character count as whitespace?Seems to. Actually, I'm getting different results depending on the compiler used.
    public static void main(String[] args) {
              char[] c = new char[10];
              for(int i = 0; i < 5; i++) {
                   c[i] = (char) ('a' + i);
              String first = new String(c);
              System.err.println("[" + first  + "]");
              System.err.println(first.length());
              String second = new String(c).trim();
              System.err.println("[" + second  + "]");
              System.err.println(second.length());
         }ECJ-compiled output:
    >
    [abcde
    10
    [abcde]
    5
    >
    javac-compiled output:
    >
    [abcde]
    10
    [abcde]
    5
    >
    Odd

  • Output of an Array

    Hi everybody,
    I was just playing with the CFLIB metaheaders and everything works fine for a beginner (http://cflib.org/udf/GetMetaHeaders). Now I see all the results in the cfdump, but I want these results in a cfoutput. How can I work it out, that I can have an output of this array, because I want to save these results in a database?
    Any help is appreciated

    If it's a 1D array, it's a simple loop from 1 to the arraylen.
    For 2D arrays, I'd try something like this, and this will only work if there are no blank cells in the array.
    <cfset Columns = 1>
    <cfset FoundNumCols = false>
    <cfloop condition = "FoundNumCols is false">
    <cftry>
    <cfset x = TheArray[1][Columns]>
    <cfset Columns = Columns + 1>
    <cfcatch>
    <cfset FoundNumCols = true>
    closing tags.
    Same thing for rows.
    <cfoutput>
    <cfloop from = 1 to = Rows index = "row">
    <cfloop from = 1 to = Columns index = "column">
    #TheArray[row][column]
    closing tags

  • Splitting data from waveform output from niScope Multi Fetch Cluster

    I am trying to split the data of a 1-D array of clusters.  I am using a PXI-5421 function generator and a PXI-5122 digitizer.  The NiScope Multifetch Cluster.vi retruns output data of the waveform as a 1-D array of cluster of 3 elements.  This array contains information from channels 0 and 1.  I am trying to extract the waveform component information from each of the channels so I can operate on them an re-assemble two waveforms.  Can someone point me in the right direction?  I can't seem to come up with the right tool from the array or cluster tools.  Thanks.
    Jeff
    Solved!
    Go to Solution.

    You just use an Index Array and an Unbundle by Name or Unbundle.
    Message Edited by Dennis Knutson on 04-30-2009 10:41 PM
    Attachments:
    Index and Unbundle.PNG ‏4 KB

  • What is the best way to run two programs simulataneously using the output from one to run the other?

    I just kind of wanted to get an opinion from some people on here. I have two main VIs. The first is a DAQ system that reads 99 different sensors and feeds that data into an array. The second is a real-time processing system that is designed to take the array and do numerous calculations. Both VIs output data to the front panel that I want to see, so I don't want to just use one as a SubVI.
    Is there a simple way to run both VIs, using the output from the DAQ system to feed the processor so that you can easily see the front panels of both VIs? I had considered just copying the real-time processor code into the DAQ VI, but I'm worried the resultant VI will be very large and unsightly.
    On a side note, am I over thinking this? Excuse me if this is a rather dumb question, it's been a long week...aaaand it's Wednesday.
    Solved!
    Go to Solution.

    There are a number of ways that you can go about this, but having both front panels open isn't a problem (assuming there is screen space!). Both could be sub-vi's of another "calling" vi, with their front panels set to open when called. The data from the DAQ side can be sent to the other through a number of ways, "producer-consumer" (many threads about this topic, examples in the LabVIEW examples, etc.) is one of the more robust techniques. If created correctly it allows one to run at a different rate than the other, although if the producer is "producing" much faster than the consumer can "consume" it will end up with problems.
    I guess I type too slowly
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Reading from an array

    Hi everyone,
    i have read a .txt file (printed from matlab as table) into labview as array indicator.
    i used array index to send the values from the array to their outputs, like some values connected to DAQ as voltage output, some sent to indicators to just show the value on the GUI some are sent to xy graph to be ploted.
    however, the DAQ does not really read the value because the intensity of the LEDs dont really change with changing the value.
    the second problem for the xy graph i used the buddle to connect two array indices as x and y and when i connected the buddle to the xy graph it shows diconnected line
    any solutions or what is that happening?
    thanks in advance
    Solved!
    Go to Solution.

    You definitly currently use a waveform graph (even if you label the axes x and y ) First you need to replace with an xy graph, which is very different in datatype.
    Do you want to add one xy point whenever you look at a new spectrum or do you want to graph all points (one for each spectrum) at once? That would be easier. If you want to add one point at a time, the "build xy graph express VI" set to "not clear data between calls" is the easiest solution. Otherwise you need to append the new point to an existing array of points kept in a shift register.
    Also note that sliders have a digital display (right-click...show digital display) so you only need one terminal.
    Here's a quick rewrite that shows ...
    how to use index array more efficiently
    How to use an event structure to prevent constant spinning of the loop (Your false case definitely would need a small wait).
    how to display the digital display of sliders
    How to graph all xy data at once
    How to incrementally build the xy graph using a shift register
    How to incrementally build the xy graph using a express VI.
    I don't have DAQ, so I commented them out.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    finalizedGUIMOD.vi ‏189 KB

  • Finding the smallest value from an array

    Hi there :)
    I started learning Java a few days ago and have now run into my first problem :p
    I am using Netbeans on Mac OS X.
    I need to find the smallest value from an array. So far I've had no luck. Any suggestions would be fantastic.
    The code so far:
    * Math Problems
    * Created on May 4, 2007, 10:54 AM
    * PROJECT 1: - IN PROGRESS
    * Create a program that allows you to create an integer array of 18 elements with the following values
    * 3, 2, 4, 5, 6, 4, 5, 7, 3, 2, 3, 4, 7, 1, 2, 0, 0, 0
    *  - The program computes the sum of elements 0 to 14 and stores it in element 15                              // COMPLETED
    *  - The program computes the average and stores it in element 16                                              // COMPLETED
    *  - The program finds the smallest value from the array and stores it in element 17
    * PROJECT 2: - TO DO
    * Write a program that accepts from the command line and prints them out. Then use a for loop to print
    * the next 13 numbers in the sequence where each number is the sum of the previous two. FOR EXAMPLE:
    *  - input>java prob2 1 3
    *  - output>1 3 4 7 11 18 29 47 76 123 322 521 843 1364
    * PROJECT 3: - TO DO
    * Write a program that accepts from the command line two numbers in the range from 1 to 40. It then
    * compares these numbers against a single dimension array of five integer elements ranging in value
    * from 1 to 40. The program displays the message BINGO if the two inputted values are found in the array
    * element. FOR EXAMPLE:
    *  - input>java prob3 3 29
    *  - output>Your first number was 3
    *  -        Your second number was 29
    *  -        Its Bingo!  // This message if 3 and 29 are found in the array
    *  -        Bokya!      // This message if 3 and 29 are not found in the array
    *  -        The array was 7 5 25 5 19 30
    * PROJECT 3 EXTENSION: - OPTIONAL
    * Generate the array of 5 unique integers using random numbers
    package mathproblems;
    * @author Mohammad Ali
    public class Main {
        /** Creates a new instance of Main */
        public Main() {
         * @param args the command line arguments
        public static void main(String[] args) {
            int A[]={3,2,4,5,6,4,5,7,3,2,3,4,7,1,2,0,0,0};
            int O = A.length - 3;
            int B = A[0] + A[1] + A[2] + A[3] + A[4] + A[5] + A[6] + A[7] + A[8] + A[9] + A[10] + A[11] + A[12] + A[13] + A[14];
            A[15] = B;  // Stores the sum of the integers in A[15]
            int C = B / O;
            A[16] = C;  // Computes and stores the average in A[16]
            int D = 101;
                if (A[0] < A[1]) { D = A[0]; }
                else { D = A[1]; }
                if (A[1] < A[2]) { D = A[1]; }
                else { D = A[2]; }
            System.out.println("There are " + O + " numbers in the Array");
            System.out.println("Those numbers add up to " + B + ".");
            System.out.println("The average of those numbers is " + C + ".");
            System.out.println("The smallest value in the array is " + D + ".");
    }The code is incomplete, but it works so far. The problem is I know there must be an easier way. SAVE ME :)

    OK :)
    Just thought I should show you the output as to help anyone else with the same problem:
    * Math Problems
    * Created on May 4, 2007, 10:54 AM
    * PROJECT 1: - IN PROGRESS
    * Create a program that allows you to create an integer array of 18 elements with the following values
    * 3, 2, 4, 5, 6, 4, 5, 7, 3, 2, 3, 4, 7, 1, 2, 0, 0, 0
    *  - The program computes the sum of elements 0 to 14 and stores it in element 15                              // COMPLETED
    *  - The program computes the average and stores it in element 16                                              // COMPLETED
    *  - The program finds the smallest value from the array and stores it in element 17                           // COMPLETED
    * PROJECT 2: - TO DO
    * Write a program that accepts from the command line and prints them out. Then use a for loop to print
    * the next 13 numbers in the sequence where each number is the sum of the previous two. FOR EXAMPLE:
    *  - input>java prob2 1 3
    *  - output>1 3 4 7 11 18 29 47 76 123 322 521 843 1364
    * PROJECT 3: - TO DO
    * Write a program that accepts from the command line two numbers in the range from 1 to 40. It then
    * compares these numbers against a single dimension array of five integer elements ranging in value
    * from 1 to 40. The program displays the message BINGO if the two inputted values are found in the array
    * element. FOR EXAMPLE:
    *  - input>java prob3 3 29
    *  - output>Your first number was 3
    *  -        Your second number was 29
    *  -        Its Bingo!  // This message if 3 and 29 are found in the array
    *  -        Bokya!      // This message if 3 and 29 are not found in the array
    *  -        The array was 7 5 25 5 19 30
    * PROJECT 3 EXTENSION: - OPTIONAL
    * Generate the array of 5 unique integers using random numbers
    package mathproblems;
    * @author Mohammad Ali
    import java.util.Arrays;
    public class Main { 
        /** Creates a new instance of Main */
        public Main() {
         * @param args the command line arguments
         public static void main(String[] args) {
                  int A[]={3,2,4,5,6,4,5,7,3,2,3,4,7,1,2,0,0,0};
              Arrays.sort(A);
              System.out.println("The smallest value in the array is " + A[0] + ".");
              int num = A.length;
              System.out.println("There are " + num + " values in the Array.");
              int sum = 0;
              for (int i = 0; i < A.length; i++) {
                   sum+=A;
              System.out.println("Those numbers add up to " + sum + ".");
              double d = (double)sum/num;
              System.out.println("The average value of those numbers is " + d + ".");
    What Iearned:
    1) How to create for loops properly
    2) How to import java.util.Arrays ( =D )
    3) How to get a more accurate average using double instead of int
    4) This forum is the best and has very helpful people 24/7 ( =D)
    Thanks Again,
    Mo.

  • How to eliminate or remove zeros from 1D array

    How to eliminate or remove zeros from 1D array. Let say I have 1D array having foolowing elements
    "0 0 0 0 0 4 0 0 9 0 0 1 4 0 0 0 0 0 0 0 0 10 9 0 0"
    So after removing or eliminating zeros it will become as follow
    "4 9 1 4 10 9"
    So can any body guide me how can I do that? See attached Image for details.
    Thanks 
    JK

    altenbach a écrit :
    hchiam wrote:
    Here are 2 example .vi's I made based on altenbach's removeZeroes.png in this discussion thread: 
    It seems pretty pointless to post those because no new useful information is given.
    Currently, only the input is defined in the connector pane, making them useless as subVIs.
    unlike my example using integers, an "=0", like any "equal" comparison, is potentially dangerous with DBLs.
    Reshaping a 2D array to 1D before removing zeroes is pretty pointless because a 2D output cannot be recovered. A more interesting scenario would be to remove some columns or rows (e.g. that are all zeroes) from a 2D array.
    You should also clean up the front panel, e.g. properly zero the upper left corner, make the controls/indicators nicely labeled, sized and arranged, and maybe even add scrollbars to the arrays.
    Thank you for those comments.
    Now the input and output are defined (in the updated attachments) for use as example subVI's.  I also cleaned up a few visual details, but I leave the rest for others to cater to their specific uses if they don't want to use this as a subVI (or at least as-is), such as changing the icons or changing to integers instead of doubles.
    I'm not sure about what you mean exactly with "=0" being "potentially dangerous with DBLs".  I'm guessing you had a certain case scenario in mind.  Although the subVI's seem to work fine within my larger program and situation, my situation may not generalize with regards to this point.
    I reshaped from 2D to 1D, with a 1D output, because it could be helpful for things like when later processing just needs a 1D array.  For example, in my situation I had to remove a huge spike of unnecessary "0"'s from a previous subVI that were affecting the output display of a certain histogram.  So it turned out a 1D array output was helpful, and you never know what problems come up, so I included the 2nd example.
    Hopefully if someone is looking for this, they can just use or play with an example subVI (granted that they know how to plug things in for their context).  I was hoping to post a subVI people could put to direct use.

Maybe you are looking for

  • File works in Encore 1.0.1 but gives problems in Encore 2.0

    Try downloading this file http://www.ecs.homechoice.co.uk/Adobe_test.mpg It's a recording of a trailer off BBC1 and is typical of the problems I am experiencing with Adobe Enmcore 2.0 If you play back teh above file on Windows Media player it looks f

  • Date is not shown in messages list

    For many emails that I am receiving from different accounts, date is not shown in messages list, only time. It looks like these messages were received today, in fact they are old. Encountered this problem on 2 different PCs, 3 different mail accounts

  • )IC_C03 - Value of valuated  stock value ( 0VALSTCKVAL )

    Hi, Could somebody please give me the formula for the standard Non-cumulative Keyfig Value of valuated  stock value (0VALSTCKVAL)?  Somehow my calculations based on Issue value & Reciept value doesn't work.. Thanks a lot. Ritu

  • How do I get all Finder windows to open in spatial view?

    How do I get all Finder windows without special view options set to open in the 'spatial' mode (without the toobar or sidebar)? The ones I specifically change stay that way, but I want all new and old folders to be like that too.

  • Using Concat function - in Excel Source

    Hi, I am using an Excel file as a source and oracle table as a target. In the Excel file i need to concatenate two columns and map it to the target oracle column based on a condition. I used the concat function in Expression Editor, but its throwing