Unbundling an array of doubles

Hi Forum,
I need to measure current from 20 channels so I combined the values of the 20 shared variables (one from each channel) into an array form and then send to a network variable for transferring data from A.vi to B.vi. And then on B.vi, I use "unbundle by name" to unbundle the cluster back into the twenty individual values and indicate them one by one.
My question is, how can I figure out which value is which out of the twenty variables? I connected the 20 shared variables to the array in a particular sequence and when i use "unbundle by name" would the sequence be consistent?
I have attached a screenshot just to explain things better.
Any help is greatly appreciated!!
Batistuta002
Solved!
Go to Solution.
Attachments:
Labview problem 4.png ‏76 KB
Labview problem 5.png ‏89 KB

Thanks Ravens Fan!
So if I want to use Index array, then i would need to assign index numbers to each elements when I combined the 20 values from the variables to an array right? If I don't, does LV assign 0 to 19 for the 20 elements from top to bottom automatically? Sorry that I cannot verify this by myself as I can't test it out using actual measurement because of hardware issues.

Similar Messages

  • Reading arrays of double from S7 with OPC & Datasocket

    Hi friends:
    We are developing an application with a S7-315-2DP PLC and a PC with a PCI1500PFB. We use the OPC server from Applicom. We read the data very quickly with the datasocket (arrays of boolean, arrays of doubles ...and so on, and a very big amount of data over 100 ms) but when we try to write arrays datasocket faield and we have to write item on item and the speed decrease. For intance, if we try to write doubles ( 50 items) the refresh period is over 5 seconds ( some times more since we launch the data and we read the same data on the PC). Perhaps we failed configuring the OPC but there isn´t many things to configure, perhaps the problem is the board configuration .. I don´t know.
    We
    try to find some examples that write an array of doubles on one time but..
    Thank you for yours answers.
    Javi

    Hi Javi,
    I'm not aware of any known issues writing to the Applicom OPC server. In LabVIEW there isn't anything special you need to configure to be able to write arrays of doubles through DataSocket. You can test this by using the DataSocket Server Manager, make a new member that is an array of doubles, and try reading and writing to that member. You may also want to check to make sure the data member the OPC server is expecting is an arry of doubles and not an array of singles or integers.

  • Transfering elements to new array and doubling values.

    Hi my problem is that I need to ask a user to enter 5 integers that stores them in an array. Transfer them to a new array by doubling the values when trasferred.
    Please help I have 3 errors.
    class arrays
         public static void main (String[] args)
              int numbers[] = new int [5];
              byte array1Size = 0;
              int input = 0;
              char goon = 'y';
                   //create and initialise an array of 5 integers
                   int array1[] = new int [5];
                   // loop and fill each element
                   for (int x = 0; x < array1.length; x++)
                        System.out.println("Enter a number: ");
                        array1[x] = EasyIn.getInt();
                        // Filling array
                        if (array1Size >= array1.length)
                             //Make a new array doubling the values od the integers
                             int array2 [] = new int [2 * array1.length]; // 10 integers
                             //Copying integers
                             System.arrayCopy (array1, 0, array2, 0, array1.length);
                             //Make old reference point to new array
                             array1 = array2;
                        else
                             //normal
                             do
                                  System.out.print("Enter an integer: ");
                                  input = EasyIn.getInt();
                                  anotherArray[anotherArraySize] = input;
                                  anotherArraySize++;
                                  System.out.print ("Another number? Enter Y or N: ");
                                  goon = EasyIn.getChar();
                             }     while(goon = = 'y' | goon = = 'Y');
    the errros >>>
    G:\Java\Practical 7\Practical74.java:33: '.class' expected
                             int array2 [] = new int [2 * array1.length]; // 10 integers
    ^
    G:\Java\Practical 7\Practical74.java:33: not a statement
                             int array2 [] = new int [2 * array1.length]; // 10 integers
    ^
    G:\Java\Practical 7\Practical74.java:41: 'else' without 'if'
                        else
    ^
    3 errors
    Tool completed with exit code 1
    Thanks

    Hi,
    it seems you forgot the curly braces in the if-else statement:
    if (array1Size >= array1.length){
    //Make a new array doubling the values od the integers
    int array2 [] = new int [2 * array1.length]; // 10 integers
    //Copying integers
    System.arrayCopy (array1, 0, array2, 0, array1.length);
    //Make old reference point to new array
    array1 = array2;
    else{
    //normal
    do
    System.out.print("Enter an integer: ");
    input = EasyIn.getInt();
    anotherArray[anotherArraySize] = input;
    anotherArraySize++;
    System.out.print ("Another number? Enter Y or N: ");
    goon = EasyIn.getChar();
    } while(goon = = 'y' | goon = = 'Y');
    }

  • I need to display an array of doubles on a table and I am loosing my percision

    Hello,
    I need to display an array of doubles on a table but I am losing my decimal precision. I am converting the array to a string in order to display it on the table with a number to decimal function. This is where I lose my precision since that control converts the double into an integer and then into the string. What control do I need to use instead of that in order to preserve my decimal precision all the way to the table? I have attached my VI. Thanks in advance!
    Gregory Osenbach, CLA
    Fluke
    Attachments:
    canalyzer_prototype_1.vi ‏52 KB

    Thank you both for the quick response. Its just the info I needed!
    Gregory Osenbach, CLA
    Fluke

  • Converting 1d array of double

    I have a 1-D array of double inside of a while loop.  I would like to control the execution of the while loop based on one of the numeric values in that array (like I would stop the while loop if the numeric value in the array is less than or equal to 0).  How should I go about doing this? 
    I cant link the array directly to the "less than or equal to 0" icon because it requires a single double.  Any help would be much appreciated.  Thanks. 
    Jerry

    qiora wrote:
    I cant link the array directly to the "less than or equal to 0" icon because it requires a single double. 
    Of course you can connect an array to "less than or equal to 0". The output will be a boolean array that you can feed into a "OR array elements" or "AND array elements" to get a true if either (1) at least one array element matches or (2) all elements match, respectively.
    qiora wrote:
    I would like to control the execution of the while loop based on one of the numeric values in that array (like I would stop the while loop if the numeric value in the array is less than or equal to 0). 
    If it should be based on one specific element (e.g. element(0) or element(5)), you need to get that element using "index array" and do the comparison.
    The implementation will depend on your exact requirement. Your question is quite ambiguous.
    LabVIEW Champion . Do more with less code and in less time .

  • How to write a 2-D Array of Doubles to a binary file in LabView 8.5?

    Okay, this is driving me nuts. I got a program that worked fine in LabView 8.0 but refused to write any data after my institute upgraded to LabView 8.5. The data is stored in a 2-D array of doubles and is supposed to be written to a binary file, that has been correctly opened and got a header written to it containing some meta-data of the measurement. But when the doubles from the array should be written to the file, nothing happens. All I get is an (except for the header) empty file of 786 kB. I found out that writing works if I convert the data from the array to singles right before wiring them to the "write to binary file" VI, but for several reasons I need the data as doubles. Can anyone help me? I've tried everything anyone has written here about writing to binary files and more.
    Remember, it worked perfectly fine with an older version of LabView. Any ideas?

    It is possible that you run into a known memory optimization bug.
    Try to place an "always copy" primitive as discussed here.
    Message Edited by altenbach on 11-18-2008 09:11 AM
    LabVIEW Champion . Do more with less code and in less time .

  • I want to cast Array to double[]

    I make an windowsForm class for draw graph.
    It has an input param
    public FormGraph(string title, string name1, Array data1)
    I need data of double[] type for draw graph. But I think users are want to input double[] or int[] ect...
    So I try to get data as Array type and cast it to double[].
    double[] series1 = (double[])data1;
    But it throw exception about fail to cast.
    How can I cast variable type of array to double[]?

    Another option is to combine Generics with this.
    You can use generics to allow the users to pass different types of data to a method, but type specific in a different way.
    public FormGraph<T>(string title, string name1, IEnumerable<T> data1)
    var series1 = data1.Select(x => Convert.ToDouble(x)).ToArray();
    Muthukrishnan Ramasamy
    net4.rmkrishnan.net
    Use only what you need, Reduce global warming

  • Array of doubles filled by DLL contains weird values

    Hello everyone
    I am working on a DLL invocation which needs to resize and fill an array of doubles named 'values' (2nd to last parameter). I have defined the signature as follows:
    _declspec (dllexport) uint8_t readDoubleArray(uint8_t handle, LStrHandle lPath, int64_t startTime,
    int64_t endTime, DblArrHdl *values, LongArrHdl *timebase);
    Where DblArrHdl is
    typedef struct {
    int32_t dimSize;
    double doubles[1];
    } DblArr;
    typedef DblArr **DblArrHdl;
    In the invocation I read doubles from a database, and resize the double array as follows:
    int size = doubleArray.size();
    if (NumericArrayResize(0x0A, 1, (UHandle*)values, size) != noErr) {
    setLastError(MG_ERR_LABVIEW_ERROR, "Failed to allocate memory");
    return FALSE;
     I set the size, and copy the values:
    (**values)->dimSize = size;
    for (int i = 0; i < size; i++) {
    (**values)->doubles[i] = doubleArray[i];
    When I use the DbgPrintF to validate the values it gives me a value around 120000 which is correct. However, when returned by labview the array contains strange data, like 5.38564E-315. Here is print out of the 'values' array after it has been through the DLL:
    Here is how I wired it, ignore the clustering, it occurs in the array of values which exits the DLL call.
    I have no idea how this can be. I followed the examples on the site. I also tried the normal DSSetHandleSize, but it didn't change anything. Any idea what I did wrong?
    Thanks in advance,
    Vincent
    Message Edited by DaVince on 10-22-2008 10:10 AM
    Solved!
    Go to Solution.
    Attachments:
    doubleArrayWeird.png ‏7 KB
    wireUpDoubles.png ‏18 KB

    You're right, this not directly described...  
    First you should read how LabVIEW stores data in memory,
    then read about structure packing pragma,
    and finally take a look to C/C++ preprocessor reference,
    then you will get feeling how to solve this problem...
    Otherwise own DLLs used in LabVIEW code pretty rarely, and Double precision also not very often...
    The same trouble you may get with clusters, but here behaviour described:
    "...The memory layout of a cluster depends on the platform you are running. LabVIEW may add padding between cluster elements so that those elements are aligned to certain address boundaries. Address boundaries relate to the concept of natural alignment. A piece of data is aligned on its natural boundary if the address at which it begins is a multiple of the size of the data. For example, a 4-byte integer is aligned naturally if it begins at an address which is a multiple of four. Most compilers have an upper limit on this boundary at which the restriction is relaxed. For instance, an 8-byte integer may be aligned on a 4-byte boundary. For the platforms on which LabVIEW runs, the alignment constraints are as follows:
    (Windows) Data is aligned only to 1-byte boundaries.
    (Mac OS and Linux) Data is aligned naturally up to 4-byte boundaries.
    (VxWorks PowerPC) Data is aligned naturally up to 8-byte boundaries.
    On all platforms, clusters adopt the alignment of their most restrictively aligned element..."
    best regards and happy wiring...
    Andrey.
    Message Edited by Andrey Dmitriev on 10-23-2008 03:38 PM

  • Converting array of Double Precision values to U16 for MODBUS

    Hello,
    I am trying to send over pressure and temperature information via the Input Register array in MODBUS TCP.  My question is, how to I properly send over an array of double precision values without loosing my data?
    For example, my array of data looks like:
    12.0001
    32.001
    0.00051234
    0.0014838
    1.02
    12.0232
    31.920
    Thanks so much.

    Thank you Ravens Fan for replying.
    I missed one extra point of data.  Below is what I'd like to send:
    12.0001
    32.001
    0.00051234
    0.0014838
    1.02
    12.0232
    31.920
    2046
    The array above is an array of double precision values.  I will convert that array to an array of single precision floating data to reduce data size.
    Since I have eight pieces of single precision floating point data now, I will need to write to 16 registers correct?  What is the best method to split up each piece of data into two consecutive registers?
    Attached is a Slave Send Data.VI that I want to send this data through.  The end goal is to have a Master PC (not using labview, but a MODBUS utility) to read my MODBUS TCP message from the "Slave Send Data.vi" 
    Thanks
    Attachments:
    Slave Send Data.vi ‏15 KB

  • 2 D array of doubles

    I was wondering how to pass a 2D array of doubles through JNI?
    I am doing this so that I can change the 2D array to a Variant that contains a 2D array of SAFEARRAYS of doubles. Then I am going to invoke a method of a 3rd party software through COM.

    It's possible, but I believe that you'll be crazy using such an array in JNI (dereferencing lots of things etc.) and the performance will be very poor.
    You can do the following thing:
    - Convert the 2D array into a 1D array in Java code. It's faster in the Java side than doing it using JNI (basically you'll need to use a lot of System.arraycopy() calls and some multiplications and additions).
    - Transfer the 1D array to the JNI code
    - Convert it back to the Variant or SAFEARRAY(double) 2D array - I believe that if you've done the things right you'll need only to do a straight memcpy in the JNI code.

  • Creating polygons with an array of doubles instead of ints

    Hi,
    I want to create a polygon using:
    Polygon u = new Polygon(xPoints, yPoints, numTs);
    my problem is that my x & y points are stored in double arrays not ints. Is there a way to create a polygon using double arrays instead of ints?
    cheers,
    elmicko

    or cast them as int. imaginr posX, posY, width and height are doubles.
    Rectangle rect = new Rectangle( (int)posX, (int)posY, (int)width,(int)height );or, with an array of doubles:
    Rectangle rect = new Rectangle( (int)array[0], (int)array[1], (int)array[2],(int)array[3] );

  • Creating an array of doubles which represent an asymptotic curve.

    I want to populate an array with doubles with represent a value between 0.0 and 1.0 where array[0] = 0.0 and array[10000] = 1.0.
    I don't this array to follow a linear scale i.e. array[i+1] = array[i] + 0.0001.
    I want it to follow a distribution something like this:
    http://www.fao.org/docrep/x5685e/x5685e9k.gif
    How would I go about this?
    Thanks.

    Write a function that has the shape that you want.
    Evaluate that function at 10000 values, like say 0..9999, or .0001 up to .9999 if you prefer.
    Stick those values into an array.
    Is your question that you don't know how to write down a function that has some given shape? The picture that you sent us to is rather low on details. It has a single Label Linfinity. How rapidly does this function approach this value? Do you care? The picture appears to have an infinite slope at the origin. Do you need this? Do you just want some random function that goes through 0 and 1, is strictly increasing and basically smooth and concave to the right? You say it is an asymptotic curve, presumably approaching 1 and then you nail the 10000th value in your array to be exactly 1.0, so clearly you don't appear to care that your function actually reaches its asymptotic values.
    A function that has roughly the shape you want is the square root. Yes, that function does not have a horizontal asymptote but then again neither does your array. So just use f(x) = sqrt(x)/100.0 and evaluate between 0 and 10000.
    If you need something better than that, you will need to explain in more detail what exactly constitutes better.

  • Getting a datatype (specifically an array of doubles)

    I'm looking for a way to write a constructor that will simply check to see whether or not an array is an array of doubles, and if not, will throw an illegal datatype message.
    These are just the parameters for reference...:
    public Triangle (double[] array, boolean dataType) throws IllegalTriangleException {
    //checks if the array is an array of doubles
    throw new IllegalTriangleException  ("This is not an array of doubles");
    }//end Triangle constructor

    i think i just haven't got the question !
    If you've got an array of doubles then there are doubles only!
    If youve' got a mixed list, you can use
    Double.isNaN()
    in iterations. isNAN() will be true for each element that is not a number!

  • Source is double sink is 1D-array of double

    I am getting this message when I wire something.
    These cannot be wired together because the data types do not match. The type of the source is double. The type of the sink is 1D-array of double.
    What is source and sink?

    Anything that produces data is a source. Think of it like watering your
    yard. The sprinkler is the source of teh water, the grass is the sink.
    If you want all the data from the loop, then you DO
    want auto indexing enabled. This is what automatically builds the array
    on the edge of the loop. If you da as Altenbach suggested, you'll have
    the correct indicator for the array.
    The problem you may be having is that now that you have an array, you
    have to use the array functions to get at the individual values in the
    array. To get to a single element, wire the array into the "Index
    Array" function. The 'Index' input specifies which element wil be
    passed through the function. a '0' will give you the first element, a 1
    will give you the second element and so on.
    Does that take care of the problem?
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • How do i convert a spreadsheet string to an array of double with out using spreadsheetstringtoarray.vi?

    Hi
    When I use spreadsheet string to array on a spreadsheet string, I get zeroes in between the numbers. The original string has a number, a tab, and another number and I want it convert to double precision format retaining the spreadsheet string format.
    How can I do this?
    Thank you.

    adrianT wrote:
    Hi
    Thanks for that.
    But your method produces just one column of data. I need two.
    Thank you.
    When I use the vi on the data you provided, I get two columns. You can see that by yourself on the attached vi, where I have saved the calculated results as default values (there is an additionnal modification to read directly a file). Are you making tests on different sets of data ? Could you give me an example of what's returned by my vi. Or are you using a modified version of my vi ? In this last case, could you post it ?
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Clean text 3.vi ‏45 KB

Maybe you are looking for

  • New System Cause of Stress lol

    Hi Everyone I have read through these and many other forums, but have not found a fix for my issues as of yet. Here is my history with this pc.  About 2 months ago I bought everything listed in my sig and assembled.  From day one, this system had the

  • JSF Calendar Component Selection Issue

    Hi, I have design a JSF Page using two calendar components, ie Start Date End Date Both of these dates field allow user input but only one of them are on compulsory basis. Start Date is a compulsory , whereas End Date is not. What I notice was if the

  • MacPro wont back up to Time Machine or Carbon Copy Cloner?

    I am running 10.6.8 on my 2 x 3 Ghz Intel Mac Pro with 10 Gb of Ram. I have been backing up my two internal drives to an external 2 Tb WD for over a year using time machine and it would lose the drive every once in a while but I could get it back. No

  • How to asign some content filtering policies to a wan port ISA550

    Hi, I have a Cisco ISA550, and we are trying to make some url's rules for the network. I have established a policie, with some content and url's, but now I need to asign them to a configurable wan port. What I have do is: 1. Go to firewall and open c

  • List to Spool

    Hello Experts, I have written a report, in which a lot of internal tables are read out, the values are analyzed and some of them are displayed to the user using command "write". Is it possible to print these values additionally to spool memory? How c