Array Of Clusters Not Initializing or Possible Race Conditions

Hi all,
I've been working on a fairly complex project for work, and I haven't worked with Labview before. Unfortunately nobody in my office really has experience with it so I'm on my own. I've mostly got the project working, and it might be a little cumbersome, but if it works that's fine.
Essentially it's a temperature control device and I made it so it's expandable, thus the clusters and arrays everywhere.
My question is this. I've got an array of clusters indicating the status of all the plates in the system. When I start up the VI for the first time they do not initialize. They just stay grey, but when I stop it and start it once, it will work every time. I think this is kind of strange behavior. I've heard of race conditions and while I've tried to make sure t hat's not happening, it might be without me noticing.
I've tried putting an initialize array block in the first call while loop and that doesn't do anything, and if I remove the initializer from the shift register in the top while loop that stops them being initalized altogether.
I guess I was hoping someone might have an idea what's causing it, or could possible give my code the once over. The main bulk of it is in the very top of the code, but there are a lot of smaller events taking care of GUI type stuff.
I've included all source code. It might be a little much but I didn't want to start pulling it apart if I don't know what's happening.
Thanks in advance.
Chris.
Solved!
Go to Solution.
Attachments:
Error During Cycle Controls.zip ‏3107 KB
Stop Cycle Controls.zip ‏2115 KB
Stop Cycle Controls.zip ‏4975 KB

Chris Johnson wrote:
So just to confirm, I can have one event structure with say 10 events happening? In this case could an event happen simultaneously with another? I thought I read something about each event having it's own event structure and while loop to make sure this works out.
Each event case must complete before it can handle the next event, but many events will complete so quickly that this is not an issue (such as your "pause chart" button).  In general you should have only one event loop.  If you expect an event to take a long time to process, use a queue to hand that task off to another dedicated-purpose loop, so that the event structure can go back to waiting.  This is one example of the producer-consumer structure often mentioned on this forum: the producer is the loop containing the event structure, and it queues (produces) items to process.  A separate loop dequeues (consumes) those items and handles them appropriately.
As GerdW mentioned, you have race conditions all over the place.  You'll never know whether the Plate Info Cluster Array is properly updated because it's being written and read simultaneously in so many places.  I'm assuming that is also where you're seeing the issue that inspired the post, and, in fact, one of those race conditions could explain what you're seeing.
Chris Johnson wrote:
Also, again, to confirm what I think I already know. When the event completes it outputs whatever data you output from the structure and then you can place it in a shift register. Where does this go until the next event takes place?
I don't understand what you're asking.  Where does what go until the next event?  If by this you mean the data in the shift register - it stays in the shift register, accessible at the corresponding terminal on the left side of the loop.

Similar Messages

  • FacesContext not initialized in certain error conditions?

    I ran into an interesting problem today (I am using RI 1.1.01).
    I have a servlet which acts as a global exception handler. All exceptions which are caught by the container are forwarded to this servlet (as configured in web.xml using error-page). This exception servlet does some processing and then forwards the request again to a JSF view.
    If the exception happens inside a getter/setter or inside an action listener, everything works fine. However, if the exception is thrown from the constructor of a managed bean, I get this weird exception (here I also include the JSF log right before the exception):
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, execute(com.sun.faces.context.FacesContextImpl@69cdb12)
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@69cdb12)
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RestoreViewPhase, Entering RestoreViewPhase
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, set character encoding on request to ISO-8859-1
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, URL pattern of the FacesServlet executing the current request .faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, viewId after appending the context suffix /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.StateManagerImpl, Begin restoring view in session for viewId /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.StateManagerImpl, Restoring view from session for viewId /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.StateManagerImpl, End restoring view in session for viewId /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RestoreViewPhase, New request: creating a view for /ibx/web/globalErrorPage.faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, Created new view for /ibx/web/globalErrorPage.faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, Locale for this view as determined by calculateLocale en
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, RenderKitId for this view as determined by calculateRenderKitId HTML_BASIC
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RestoreViewPhase, Exiting RestoreViewPhase
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, Skipping rest of execute() because of a reload
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, render(com.sun.faces.context.FacesContextImpl@69cdb12)
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, phase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@69cdb12)
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RenderResponsePhase, Entering RenderResponsePhase
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RenderResponsePhase, About to render view /ibx/web/globalErrorPage.faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, About to render view /ibx/web/globalErrorPage.faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, URL pattern of the FacesServlet executing the current request .faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, Found URL pattern mapping to FacesServlet .faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, viewId after appending the context suffix /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, Before dispacthMessage to newViewId /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 WebGroup I SRVE0180I: [XA-IBX-PF] [] [Servlet.LOG]: /ibx/web/globalErrorPage.jsp: init
    [10/19/05 15:27:46:832 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,832], DEBUG, com.sun.faces.taglib.jsf_core.ViewTag, Can't leverage base class
    javax.faces.FacesException: Assertion Failed
         at com.sun.faces.util.Util.doAssert(Util.java(Compiled Code))
         at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType(ViewTag.java:241)
         at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1013)
         at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1036)
         at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:749)
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:429)
         at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
         at org.apache.jsp._globalErrorPage._jspService(_globalErrorPage.java:
    Strange huh? Looking at the source code, it seems like getComponent() isn't ever supposed to be called. Is the FacesContext somehow not getting initialized? Any thoughts? Help!

    Thanks for your suggestion.
    I'm not sure what, from my problem description, motivated you to think that faces-config might be the problem because the rest of my JSF application works just fine. The problem is limited to exceptions which are thrown at certain points in managed beans (like the constructor) or in custom components/renderers, when the default error-page is forwarded to, it seems that the JSF framework is in a state of error and thus the error page itself throws an exception. A copy of this exception in included in the original post.
    At any rate, everything looks to be just fine with my faces-config. It validates just fine and the other parts of my application work.
    Thanks for trying though!

  • Waveform Chart NOT allowed inside array of clusters; Dynamic plot stacking?

    The NI Developer Zone has a VI that does something I want - dynamically
    stack plots in a useful way. Unfortunately, I would like those plots
    to actually be Waveform Charts and NOT Waveform Graphs (as the
    documentation specifies but LIES!)
    A little further experimentation shows you that it is seemingly not
    possible to make an array of clusters that contain Waveform Charts!
    Why?
    Alternatively, are there any other ways to smartly show many signals at
    once? I have found multiplots to be frustrating as it is difficult to
    assign the number of plots once you start the VI (hence the existence
    of Dynamic Stack Plots).
    DynamicStackPlots here:
    http://sine.ni.com/apps/utf8/niepd_web_display.display_epd4?p_guid=B123AE0CB938111EE034080020E74861

    If you have LabVIEW 8.0, have a look at the new "Mixed Signal Graph"
    (see e.g.: http://zone.ni.com/devzone/conceptd.nsf/webmain/C6B79FA61959D9D68625706E006F7462 )
    LabVIEW Champion . Do more with less code and in less time .

  • Array of clusters does not updates properly

    Hello...
    I builded a VI to split a series of 10000 values in many segments, each one overlapped by 50 %. The product of all the values of each segment is calculated and by means of visual inspection and Led selection (green means that the segment will be used, red means that the segment will not be used), I can select which segment will be used for the final sum. For example: if I have 20 segments, but only segments 4, 8, 15 are green, only the products of the segments 4, 8 and 15 will be summed to generate the final result. The final result should be refreshed if the Lenght of the Segment is changed or if any Led is switched to green or red, but the update does not occur properly. Sometimes all the segments are showed properly but if I change one Led or the Lenght of Segment control, the given result is wrong. When the Lenght of Segments control is changed, all the Leds need to be adjusted to green state.
    I don't know where is the problem in my code, but I think that is something related to the cluster constant that is wired to the first Unbundle by name, since that this constant was created from the cluster before it was inserted into array, and not from the array. If I create the constant from the array, the code returns an error.
    To avoid race conditions I used flat sequence.
    Thanks in advance for attention and help.
    Dan07
    Message Edited by dan07 on 07-26-2008 08:31 AM
    Attachments:
    Array of clusters.vi ‏43 KB

    I spotted one problemous area:
    Where you have an uninitialized shift register, so for every event the value of the last iteration is used.
    What's the meaning of this piece of code?
    I think you devide the length of the array by half the length of the segment?
    Ton
    Message Edited by TonP on 07-26-2008 05:34 PM
    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!
    Attachments:
    Array of clusters_BD.png ‏2 KB
    Array of clusters_BD2.png ‏1 KB

  • Initializing an array of clusters in a CIN?

    I'm trying to write a CIN to connect to a mySQL database, retreive some information, and return it to labVIEW for display. The connection works perfectly using ODBC, but I'm having major trouble getting the information back to LabVIEW. I'm new to CINs and I'm still slightly confused as to how the different structures work. I want to return the data in an array of clusters (using struct names, a 'Set' of 'Records'). LV generated the structs, and I simply renamed some of the fields/names. The code I have so far works up to the point specified in the source below, when I try to initialize the array for data entry. I think what's throwing me off is the conplexity of my structures. Since it's an array of clusters, and not an array of say strings or integers, I'm getting confused. If anyone could help me out by telling me what's wrong with my code, and/or filling in the section of the while loop I'm rather clueless on.
    typedef struct {
    LStrHandle Number;
    LStrHandle SerialNumber;
    } Record;
    typedef struct {
    int32 dimSize;
    Record ptr[1];
    } Set;
    typedef Set **SetHdl;
    MgErr CINRun(COpt *ConnectionOptions, LStrHandle *Number, SetHdl *RecordSet);
    MgErr CINRun(COpt *ConnectionOptions, LStrHandle *Number, SetHdl *RecordSet)
    // LV error code
    MgErr err = noErr;
    // ODBC environment variables
    HENV env = NULL;
    HDBC dbc = NULL;
    HSTMT stmt = NULL;
    // Connection options data variables
    UCHAR* dsn = malloc(SQL_MAX_DSN_LENGTH * sizeof(UCHAR));
    UCHAR* user = malloc(32 * sizeof(UCHAR));
    UCHAR* pass = malloc(32 * sizeof(UCHAR));
    UCHAR* num = malloc(16 * sizeof(UCHAR));
    // Query variables
    INT qlen;
    INT nlen;
    UCHAR colNumber[5];
    SDWORD colNumberSize;
    UCHAR* query;
    INT numRows;
    // ODBC return code storage
    RETCODE retcode;
    /** Prepare data from LV for C++ manipulation **/
    strcpy(dsn, LStrBuf((LStrPtr)(*(ConnectionOptions->DSN))));
    dsn[(*(ConnectionOptions->DSN))->cnt] = '\0';
    strcpy(user, LStrBuf((LStrPtr)(*(ConnectionOptions->Username))));
    user[(*(ConnectionOptions->Username))->cnt] = '\0';
    strcpy(pass, LStrBuf((LStrPtr)(*(ConnectionOptions->Password))));
    pass[(*(ConnectionOptions->Password))->cnt] = '\0';
    strcpy(num, LStrBuf((LStrPtr)(*Number)));
    // Program crashes here too, but that's the least of my concerns right now. Keep reading down.
    //num[(**Number)->cnt] = '\0';
    qlen = (int)strlen(
    "SELECT m.Number FROM master AS m WHERE (m.Number LIKE '');"
    nlen = (int)strlen(num);
    query = malloc((qlen + nlen + 1) * sizeof(UCHAR));
    sprintf(query,
    "SELECT m.Number FROM master AS m WHERE (m.Number LIKE '%s'\0);",
    num);
    // Prepare and make connection to database
    SQLAllocEnv (&env);
    SQLAllocConnect(env, &dbc);
    retcode = SQLConnect(dbc, dsn, SQL_NTS, user, SQL_NTS, pass, SQL_NTS);
    // Test success of connection
    if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
    retcode = SQLAllocStmt(dbc, stmt);
    retcode = SQLPrepare(stmt, query, sizeof(query));
    retcode = SQLExecute(stmt);
    SQLBindCol(stmt, 1, SQL_C_CHAR, colNumber, sizeof(colNumber), &colNumberSize);
    SQLRowCount(stmt, &numRows);
    //Program crashes on the following line. I get an error in LV saying something about an error in memory.cpp
    DSSetHandleSize((*RecordSet), sizeof(int32) + (numRows * sizeof(Record)));
    (**RecordSet)->dimSize = numRows;
    retcode = SQLFetch(stmt);
    numRows = 0;
    while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
    /* Need code here to retreive/create Records and put them in the array */
    retcode = SQLFetch(stmt);
    numRows++;
    SQLDisconnect(dbc);
    else
    // Free ODBC environment variables
    SQLFreeConnect(dbc);
    SQLFreeEnv(env);
    // Return LV error code
    return err;

    This looks incorrect:
    MgErr CINRun(COpt *ConnectionOptions, LStrHandle *Number, SetHdl *RecordSet)
    Did you let LabVIEW generate the C file??
    When you pass an array of clusters to a CIN, what is passed is a handle to the array. You are declaring a pointer to a handle. I just did a test passing an array of clusters to a CIN. The C file looks like this (comments are mine):
    typedef struct {
    int32 Num1;
    int32 Num2;
    } TD2; // the cluster
    typeDef struct {
    int32 dimSize;
    TD2 Cluster[1];
    } TD1; // the array
    typeDef TD1 **TD1Hdl; // handle to the array
    CIN MgErr CINRun(TD1Hdl Array);
    Notice that it passes you a HANDLE, not a pointer to a handle.
    On this line:
    DSSetHandleSize((*RecordSet), sizeof(int32) + (numRows * sizeof(Record)));
    If RecordSet is a HANDLE, then (*RecordSet) is a POINTER - you are passing a POINTER to a routine that expects a HANDLE.
    The line:
    (**RecordSet)->dimSize = numRows;
    Is also incorrect - if RecordSet is a HANDLE, then (*RecordSet) is a POINTER, and (**RecordSet) is an ARRAY, but you're asking it to be a pointer. (*RecordSet)->dimSize would be the size to fetch.
    Read the rules again on what is passed to CINs.
    I strongly suggest developing the interface first - the VI that calls the CIN. Put the CIN in place and let LabVIEW generate the initial C file.
    Then modify the code to do something simple with the input arguments, like fetch the array size, and put this number into an output argument. Something VERY basic, just to test the ins and outs. Debug this until all ins and outs are working.
    THEN AND ONLY THEN add code to do whatever work needs doing.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Control mouseover image does not display when contained in an array of clusters.

    I have been using system booleans (with some customization) for the ability to impement mouseover animations.  For example (default system booleans):
    The mouseover feedback works well with my UI, and for the most part everything is going great.
    However, the mouseover image does not load if the the boolean is contained within an array of clusters (a single cluster with the boolean inside or an array of booleans works as expected):
    The mouseover animation does work for a single array element in the above case (the one which was most recently clicked), but this behavior isn't desirable and it seems buggy if I were to leave this on my UI as it is.
    So I guess I'm just wondering if anybody has encountered this or has any suggested workarounds?  The few that I've thought of so far (maintain a separate array for any set of system boolean controls, check coordinates myself on mouse move event and try to update the proper element in the array, avoid using mouseover animations entirely for this set of controls) aren't all that desirable.  Even though this issue could be considered cosmetic, the UI is very important to me as this code is something shipped to customers.
    This is LV 2011 by the way, so if by some chance the behavior in 2012 is correct please let me know (this alone might be reason enough to convert the project up).  If there is a CAR ID for this behavior and an NI employee wishes to share it I would also appreciate that.
    Best Regards,  
    John Passiak
    Solved!
    Go to Solution.

    Hey Jason,
    A reproducing VI would be any VI that contains an array of clusters with a system control boolean inside.  Here's an example:
    Single Boolean, Single Cluster, and Array of Booleans all show the proper mouseover image.
    Array of Clusters always shows the mouseover effect on the last element which was clicked, but does not show the mouseover effect on other array elements (actually, it seems to be inconsistent--every now and then it does show the mouseover effect on other array elements but it is not at all reliable).
    Best Regards,
    John Passiak
    Attachments:
    MouseoverTester.vi ‏9 KB

  • Initializing data in an Array of Clusters

    First, thanks in advance for reading this request.
    Second, the situation:
    I am using an array of clusters for process control.
    The cluster contains a boolean, a typedef ring control, and two numeric controls (doubles).
    Depending upon the user-requested operation I need anywhere from four to 20 cluster elements in the array.
    Raw data for the two numeric controls are contained as elements in three different input clusters.
    Each numeric control in each array cluster can use from none to four elements from the input clusters with various additions and subtractions (no mults or divs).
    The boolean and ring can be set as constants for each element based on the user request.
    Third, the request:
    Is there a simple way to initialize the values in the cluster (and hence the array) without having to run wires everywhere?
    I have been writing embedded code and PC applications for many years and am only recently tackling LabView.
    In C, I would create a structure of the four elements and then create and array of structures.
    The initialization would require a few lines of code.
    I have tried using formula nodes (perhaps incorrectly).  All they do is remove the Numeric blocks (like + and -), but they don't create the cluster.
    I am sure that there is an easier way of accomplishing what I need to do, I am just too inexperienced to know what it is.
    Any help or suggestions is welcome.
    Thanks in advance.

    Create a cluster with the desired default values as diagram constant, wire it to "initialize array" and wire the desired array size.
    The output will be the desired construct that you could write to e.g. a local variable of the target.
    I hope I understood you correctly. If not, attach a small VI containing your array.
    LabVIEW Champion . Do more with less code and in less time .

  • Event Structure's value change, not detecting changes when tabbing thru array of clusters

    Hi!  I have an array of clusters (int, int, string, int) control, and want to detecting changes made to the it.  I used the Event Structure's value change case on the array, it works excellent except that it'll only detect the changes when you click out of the element or press the enter key (the one by the numbers, not carriage return).  I want it to detect the changes when I tab thru the cluster or array too, but I can't figure it out... Does anyone have any ideas?
    Thanks!

    mfitzsimons wrote:
    altenbach
    Tried Value Change with my example done in 7.1 and it doesn't trgger an event.  That is why I suggested Mouse Down.
    Curious. I did a few minor edits in 8.0 before saving as 7.1, but the simple value change event got triggered just fine when the value vas terminated with a tab in 7.1. Every time.  Strange....
    Are you on 7.1 or 7.1.1? Maybe there's a difference (I am using 7.1.1).
    LabVIEW Champion . Do more with less code and in less time .

  • Reference to Array of Clusters with an array element

    Hi,
    I have an array of clusters CONTROL (calling it as "top level cluster array") with one of the cluster elements being a cluster array (please see attached).
    I plan to pass "Reference" of this top level cluster to different VIs (like add element VI, insert element VI, delete element VI etc) and access (add/modify delete) the elements in this array.
    In my code, how do I typecast the Array Element (cluster) to the inner cluster (as shown in the figure) ?
    I am using LV RT on PXI.
    Solved!
    Go to Solution.

    You cannot use references in the same way that you use pointers around in C. LabVIEW does not manage memory in the same way that C does. This is actually a good thing, though C programmers find it "cumbersome" or "restrictive". I have also programmed in C, and frankly I prefer LabVIEW's memory management any day of the week.
    You had not initially mentioned that this was going to be done in multiple places at (potentially) the same time. Given that, my recommendation is to look into using Action Engines. They provide a means of basically providing a one-location acccess for your data. By using a single VI to access/modify your data you preclude the generation of race conditions. You may also want to join this with the concept of using variants to provide a means to quickly find your data rather than looping to find the element you're interested in. This technique has been around for a while and it has been discussed before. There are examples floating around. Will need to check to find one. 
    As for your question regarding using the reference method which you tried to employ in your initial approach, that's simply not going to gain you anything. You will still be creating buffers when you try to access the cluster elements. But you already have this information in the array inside the outer for loop, so you're just creating unnecessary extra programming for yourself. 

  • Change properties of a cluster element withing an array of clusters

    Hello all,
    I have an array of cluster that is shaped as a line with different display elements.
    A list or a tree wouldn't have made it, so I had to use a cluster and make a table.
    The problem is that I want to change not only the text but also the text color.
    Individually.
    I found this :
    http://www.ni.com/example/30904/en/
    But it change the property in all the clusters in the array, not just the one I need.
    Some people have the same problem :
    http://forums.ni.com/t5/LabVIEW/Reference-to-Array-of-Clusters-with-an-array-element/td-p/1006427
    http://forums.ni.com/t5/LabVIEW/Different-set-of-values-for-two-rings-in-an-array-of-clusters/m-p/10...
    http://forums.ni.com/t5/LabVIEW/array-of-clusters-get-references-to-all-the-clusters/td-p/1079456
    http://forums.ni.com/t5/LabVIEW/How-can-I-reference-the-properties-of-a-control-in-a-cluster-in/m-p/...
    http://forums.ni.com/t5/LabVIEW/Writing-only-to-certain-cluster-elements-in-an-array-by/m-p/2200728
    http://forums.ni.com/t5/LabVIEW/Update-Properties-Of-One-Control-In-An-Array/m-p/3015501
    http://forums.ni.com/t5/LabVIEW/Array-of-clusters-and-in-the-cluster-is-a-bar-meter-how-can-I/m-p/15...
    http://forums.ni.com/t5/LabVIEW/Property-node-of-a-control-inside-of-cluster-inside-an-array/m-p/946...
    Obviously, while in a list/table or tree you can change the property of an individual
    cell (font, color) you cannot do it within an array of cluster, by some sort of magic,
    the property of a cluster element (font, color) are all linked together, hence rendering
    the use of an array worthless.
    A possible hack is proprosed by using control masking, setting one visible and the
    other invisble, swapping their position, whatever. It's a hack you have to perform,
    hence add another code to maintain.
    Is that still the case or is there now a more official way to handle individual cluster
    properties, not just its data ? After all that's a common real-life example that should
    be handled by Labview. In my opinion.
    David Koch
    Solved!
    Go to Solution.

    altenbach wrote:
    One of the elements could be a 2D picture indicator of about the same size. You can write text in any color using picture functions.
    Here's what I had in mind. Seems to work just fine (I would fine-tune the font, picture border, etc. but this should get you started).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ColorText.png ‏13 KB
    ColorText.vi ‏9 KB

  • Setting Values in an Array of Clusters via COM

    Hello everybody,
    I need some help concerning LabView and COM (ActiveX).
    I'm working on NT 4.0 with LabView 5.1 and I've written a COM-Client in Visual
    C++ 6.0 which controls LabView.
    I can set the values of normal Controls, Arrays and Clusters.
    But I'm not able to set values for an array of clusters.
    Does anybody know how to do this ?
    Or is it impossible ?
    Many thanks in advance,
    Ralf Erdmann

    >> I need some help concerning LabView and COM (ActiveX).>> I'm working on
    NT 4.0 with LabView 5.1 and I've written a COM-Client in Visual>> C++ 6.0
    which controls LabView.>> I can set the values of normal Controls, Arrays
    and Clusters.>> But I'm not able to set values for an array of clusters.>>
    Does anybody know how to do this ?>> Or is it impossible ?>> >>With no more
    information, the my answer is, I'm not sure. It is generally>possible to
    set controls by constructing a matching Variant. Make the>array a safe-array,
    the cluster a safe-array, and the elements of the>cluster be variants of
    compatible types to what is in the array.>>If you can't get it to work from
    this, you may want to include the>LV datatype in an email and contact support.>>
    Please allow
    me to get more precise.
    For my testings I used a cluster with just one element (type double)
    in an one-dim array with just this cluster as only element.
    A LV-Cluster is represented as an array of variants in COM.
    So I have an array of arrays. With an array beeing no datatype
    I don't know how to put an array into an array to
    construct a variant to pass to LV.
    How can I solve this?
    Thanks for help.
    Ralf Erdmann

  • Different set of values for two rings in an array of clusters

    Hi, people.
    Is it possible to do what it's shown in the attached picture?
    I have an array of clusters. Two elements of the cluster are rings. Can I define a different set of values in the second ring (the one at the right) depending on the value selected in the first ring (the one in the middle)?
    If not, could you give me a good alternative?
    Thanks,
    FranciscoMensaje editado por Porras
    Attachments:
    Rings.jpg ‏270 KB

    I'm trying to do something very similar to your example but populate the comboboxes (or Rings) programmatically.    What you have is so, so close but it seems to require input from the mouse to get the correct control.    I don't really understand why you can change the String[] parameter in your program and it works fine but mine changes all the elements throughout the array.    The Refnum for the control does not change regardless of what cell is selected.   So, I'm a little puzzled how the correct cell or element is updated with the new combobox string.   
    Ultimately, I want to have an array of variables with an associated combobox (ring) of options.     So, for variable Temperature, the options are Cold, Cool, Warm, and Hot.   Then, variable 2 is Pressure, which might be Low, Medium and High.    Yes, this is for a fuzzy logic controller (not part of the NI Controls Toolkit).
    Any help is greatly appreciated!!!
    Attachments:
    TestRing.vi ‏19 KB

  • How can I modify the cluster values in an array of clusters?

    Hi all - I can't believe that I am having trouble with this but for some reason I am completely wrapped around the axel with it. I have an array of clusters, they are all strings but with different names. I am using key configuration VIs to setup a readable text file for the user. I also want the user to be able to load up the array of clusters with the values that are in the text file. So I am reading the keys and trying to populate the array of clusters to show what is in the text file and then run the test using those values. However I am not able to get the clusters populated correctly. Does any one have an example of what I am trying to do? Basically I am trying to populate an existing array of clusters with new values. That is what it comes down to. Thanks in advance for any help.

    Go to jki and dowload VIPM (VI Package Maager). From there you ca install OpenG. Lot's of useful stuff.
    Also if you cosider XML to be readable you can use flatten to/from XML.
    =====================
    LabVIEW 2012

  • How can i segregate an array of clusters with channels id in the cluster

    Hi All
    i am using a keithley 2010 DMM for power measurements,
    i am using the 2010 scan read VI which gives the reading output as an array of clusters, these clusters contain the measurement,units,channel.
    i have 6 channels for measuring voltage across and i want to make 5 readings per second on each channel which makes upto 30 readings per second.
    i want to segregate these clusters from the array according to the channel id and take the results,
    please tell me if we have function for this or you have any possible solution for the same.
    i would be very happy to hear from you and get this solved
    please help
    Thanks in advance
    Sandeep K Shyam

    yeah this looks great...thanks for your response,
    i have modified accordingly and attaching the VI, can you please look into this once
    also one more problem i have with this VI is whenever i am trying to run the VI, the  sub VI (Scan config.vi) gets popped up and waits for user response (next) cntrl+right arrow,  how can i get rid of this and run the VI in continues mode?
    i am attaching my VI along with the kei2010 lib,
    please check this
    Thanks again
    sandeep K shyam
    Attachments:
    sandeep-FinalKeithley20101.vi ‏822 KB
    kei2010.llb ‏901 KB

  • Array of Clusters Counters / Shift registers

    Hello All,
    In my Array of Clusters, I'm having trouble controlling my MISS PACKET indicator. Each time a packet is missed , the MISS PACKET indicator increments by 1. My problems is, that the same number of miss packets is showing up in the MISS PACKET indicator in each array index if a packet is missed. Ex. So if index[0] has missed 30 packets, whenever index[1] misses a packet it will display 31 and not 1. I'm using a shift register to keep  a count of the number of missed packets. I believe the shift register is the issue because the  previous value is store whenever a packet is missed.
     Any help would be appreciate !
    Thanks
    Attachments:
    Final-Demo - 3.vi ‏52 KB

    The first time i tried using  a shift register I had the initalization done outside of the while loop and still got the same results
    Attachments:
    Final-Demo - 3.vi ‏47 KB

Maybe you are looking for