Colorbox control in an array of clusters

hi, im working on labview 6. i have an array of clusters. the cluster has eight elements. one of them is a colorbox control. I want this colorbox control to have only 4 colors i.e, the user has a choice of only 4 colors if he clicks on the colorbox control. can ihave such a control?

Hi Pavitra,
Use labview Help to guide you.
Or else,
A new picture ring control or text and picture  ring control has one item with an empty picture display. You must copy a picture to the clipboard before you can import the picture  into a ring control. LabVIEW can import all graphic files your graphics software supports.
Complete the following steps to import pics  into ring controls.
Copy a picture to the clipboard.
Right-click the ring control or text and picture ring control and select Import picture from the shortcut menu.
Copy another Pictureto the clipboard.
Right-click the ring control or text and picture ring control and select Import picture Before or Import picture After from the shortcut menu.
Use the Operating tool to click the picture box to view all imported pictures
regards
Dev

Similar Messages

  • Change properties of controls in an array of clusters

    Hello,
    my latest problem:
    i display larga amount of data using arrays of clusters.
    the user has to be able to inserst clusters in between, therefore the array solution seems perfect.
    However, for each cluster, once a sub-control is defined, i would like some other sub-controls to either become invisible, visible, change ring values...etc.
    i could not find any way to do it whatsoever. anybody has an idea?
    ... And here's where I keep assorted lengths of wires...

    Hey good work!
    I sounds like you are on the right track, so here are a couple more things to throw into the mix. First, remember that given a reference to a "top-level" cluster you can extract references to all the controls inside it on the fly. For example, you take a cluster reference, it has a property called "Controls" this is an array of of references to all the controls inside that cluster. If each of those references is itself a cluster, you can in turn get references to all the controls inside them. Hence you don't really need references to each individual control on the front panel. In fact, all you have to do is figure out how to update one of the inner clusters and then put that code inside a loop so it executes once for each reference in the top-level cluster's Controls property array.
    Second, think about how you can generalize the operation such that the you can turn them into subVIs that you can use no matter what the structure of the clusters might be... The information is all there in the control properties.
    Finaly, yes I can post an example. I'll put one together this evening and try to get it up online.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Generating events from a control inside an array of clusters

    Hi, I have a question regarding UI events. I would like to capture a mouse down event generated in a string control inside of an array. Each element of the array is a cluster that has a Boolean control, a numeric control and a string control. When I try to add an event to handle the mouse down the only option available in the event structure is the one available for the entire array. If this is not possible to map event from the individual controls inside of the each cluster that are part of the array, could you provide with an alternate way of "knowing" when the string control is selected. The application has a touch screen without a keyboard and mouse. I need to display the touch screen graphic keyboard when the textbox is selected.
    Thanks,
    Diego F.

    I'm not sure, but I think your only option may be to do some calculations. The mouse down on the array will give the coordinates of the click in VI coords. You can get the coords and size of the cluster and the coords and size of the string using their property nodes. Then, you have to calculate whether the click was on one of the visible strings using addition, subtraction and quotients. Once you make a subVI out of this, it should be easy to use.
    You should watch out for the index display and the label, as they change the values of the coords. I'm sorry, I can't think of any easier way to do this.
    Correction - I just thought of one. If you use the KeyFocus property on the string inside the mouse down event, it seems to work. I'm not sure whether this will work when bringing the keyboard to the front, which is why I left the other suggestion in place. Here's my test (7.0)
    Try to take over the world!
    Attachments:
    key1.vi ‏29 KB

  • 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

  • Keyboard "tab" control in Array of Clusters

    I'm trying to polish some of my LabVIEW user interfaces so that my users can work faster in them and so that they follow more "Windows UI Standards" (or whatever).
    I have an array of clusters.  The cluster has 3 numerics.
    When a user "focusses" on the first numeric within a cluster and hits the tab key, it moves the focus to the second numeric.  Hit tab again, and it jumps to the 3rd numeric.  Hit the tab key a 3rd time and it jumps back to the first numeric in the cluster.  What I want to happen is for the focus to move to the first numeric in the next element of the array.
    I've started to play around with the "Key Down" event case that has a conditional looking for "TAB" and then checks the "FindCtrlWithKeyFocus" with the last numeric.  My probes within this event show that the "TAB" key detection is working, but the "FindCtrlWithKeyFocus" never has a TRUE output from the "CtrlFound?" output of the Invoke Node.
    Even if I did know if tab was pressed in the last element, I'm not real sure how to move focus to the first numeric within the next cluster element of the array.
    A numeric array behaves in the correct way.  I could get the program working the way I want with a 2d array of numerics.  However, each numeric has different data entry parameters and there is also a lost of "self documentation".  I would like to find a solution because this has come up with other, more complex, array of clusters that would not be solveable with a 2d array of a base type.
    Seems overly complicated to me.
    Bonus Question: The default value of my numerics is 0.  When my user clicks a numeric the cursor is on either side of the 0 and the user has to delete the 0 prior to their data input.  When a numeric is entered via the Tab key, the whole field is selected.  When the whole field is selected, whatever the user inputs will replace the original "0" that was in the field.  Anyway to have the whole field selected when the user uses the mouse?
    Sorry for the wall-of-text post (and the preposition hell).  Thanks for your input.
    Solved!
    Go to Solution.

    Well I've gone and gotten the tabbing behavior you're looking for.
    -the key is to set "skip when tabbing" on the controls inside the clusters to true, and leave it false for the array elements.  Now when keyfocus is on one of the cluster controls and Tab is pressed, LV will put the keyfocus on the next visible array element.
    -then use a "key down?" filtering event to check and see if any of those controls have keyfocus when Tab is pressed.  If so, and it's not the last control in the cluster, discard the keypress and programmatically advance keyfocus to the next item.  
    -Finally if the Tab press was not discarded, use a normal "key down" UI event to check if one of the array elements now has keyfocus and if so, set KF to the first control in its array.
    So in short, this setup turns off tabbing along a row so that every tab will move to the next row.  Then it filters out Tab if it's not yet at the end of the row.  Finally, it automatically puts the cursor in the first column when the row has advanced.
    One significant drawback is that it only tabs between visible array elements.  You can probably make it auto scroll.
    I'll leave it as an exercise for the reader to handle the shift+Tab (reverse tabbing) key presses.
    To me, this runs up against three holes in LV UI programming:
    1) Array Element events should be available.     The Array:Key Down event only handles key presses when the array has keyfocus, not when things inside it do.  Any kind of key filtering has to be done at the VI level (!!!).
        The data source for these events should include the element index (eg what cell was clicked on?)
    2) There aren't effective ways in VI server to deal with individual array elements.  I recognize that some of it is the basis that array elements have the same properties, but there are display and selection properties that do differ between cells.  I ought to be able to specify that a particular cell index has keyfocus.  Arrays, why can't you be more like Tables?
    3)Tab order should be flat, not hierarchical.
    edit: in case the snippet messes things up, file is attached.
    -Barrett
    CLD
    Attachments:
    Tab through cluster array elements.vi ‏28 KB

  • Control labels in an array of clusters

    Here is something that keeps coming up and now I have time to see if I can find a solution.  I often have an Array of Clusters of some sort in my LabVIEW programs.  They are super convenient, but one annoyance I have is that the labels have to be in each element of the array or have no labels at all.  Is there a way to have the labels only appear in the first element and then hidden for all other elements in the Array?  This would save a lot on front panel real estate.
    The best I have been able to come up with is turning off the labels all together and adding labels above the Array control.

    Ravens Fan wrote:
    I don't think you can change free labels.  But you could add the labels as being other elements of your cluster, using classic string controls and color them transparent.  Arrange the new strings so that they look like labels for your other cluster elements.
    How does it help solve the problem? I'm not sure if I've got the problem right. So please correct me if I'm wrong. So, the problem here is that labels come in all the elements of the array of clusters, like here:
    What I'm I think you're suggesting Raven, is to add some more labels into the cluster, like in the next pic, I have unchecked the label of numeric control "test 01" and added a free label instead.
    What I understood from the OP is that the cluster labels should be visible only in the first element and not in the rest. I think that would look kind of unbalanced. However a work around would be add free labels outside the cluster, by customizing the array. Or just adding free labels on the front panel and grouping it along with the array like this:
    So, am I barking up the wrong tree?
    Message Edited by NitinD on 30-08-2009 10:07 AM

  • Using Event Structures with Array of Clusters

    Using LabVIEW 8.5
    Hi all,
    I'm trying to convert an existing application to one that can be used
    through a touch screen. I updated the UI and added an event structure
    to listen for mouse ups on controls that require a HMI keyboard or
    numpad to show up. Although I've been programming for a while, I'm new
    to LabVIEW and am struggling with a problem:
    Is there any way to have an event case listen to an event within
    arrays? I've seen a few examples on the forums, but they all start with
    breaking up the arrays into individual variables. Using the variables,
    they build arrays. This seems pretty tedious, and I'm pretty sure I
    can't apply it to one of my arrays. Essentially, I just want to know
    which cluster in which array the user has clicked on, so I can open the
    HMI keyboard or numpad and send the text to that cluster. In my watered down app (Array of Clusters.vi), I've put 3 arrays of clusters and a few stand-alone controls to give you guys an idea of what I'm taking about.
    BTW, I'm using the HMI Keyboard and Numpad built by the Beta Community (http://decibel.ni.com/content/docs/DOC-1062) and modified it to add a "Clear" button to the keyboard and numpad. Please let me know if I implemented this in the best way.
    Thanks for the help,
    Kunal
    Message Edited by bhatiak on 08-04-2008 03:55 PM
    Attachments:
    Array of Clusters4.llb ‏274 KB

    My old tic tac toe example shows how to determine which square of a 2D array has been clicked.
    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=247044#M247044
    You probably can adapt some of it for the arrays on the right. If the array can be scrolled, you also need to account for the "indexvals" offset.
    The Layers controls is easiest, because you only show one element. Just read the "index vals" property to get the array element and parse the coordinates to get the cluster element.
    btw: the small while loop on the right serves no purpose at all and acts just as a CPU burner. You can delete it without any change in functionality. Is there anything else to it?
    LabVIEW Champion . Do more with less code and in less time .

  • 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

  • Array of clusters TAB next element

    I have an array of clusters and I want with the TAB key, when I am at the last element of the cluster i, move to the first element of the cluster i+1.
    Jean-Marc
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp
    Attachments:
    Array of clusters.jpg ‏132 KB

    Thanks for they answers.
    My problem is the triple TAB (TAB -TAB -TAB) to change the array line  i to i+1.  
    Click on an element in the array and move with the TAB key.  When you  are at the element "VOC":
    - the first TAB (event "<VOC>:Key Down?" ) generate CTRL +UP (return to tabbing among front panel controls -return to CLUSTER at line i);
    - the second TAB (event "<Cluster>:Key Down?" - sequence through the array- move to the array line i to line i+1)
    - the third TAB (event "<Cluster>:Key Down?" )generate CTRL + DOWN ( move the key focus inside the array or cluster -move inside the cluster at the line 1+1);
    I try to reduce the number of TAB.
    Jean-Marc
    "Complete the following steps to
    use the <Tab> key to move through elements within a single array
    or cluster when you run a VI.
    Display the front panel. While the VI is running, press the <Tab> key until the array or cluster is highlighted.
    Press the <Ctrl> key and the down arrow key to move the key focus inside the array or cluster. (Mac OS) Press the <Command> key. (Linux) Press the <Alt> key.
    Press the <Tab> key to sequence through the array or cluster elements and the array indexes.
    To return to tabbing among front panel controls, press the <Ctrl> key and the up arrow key. (Mac OS) Press the <Command> key. (Linux) Press the <Alt> key."
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp
    Attachments:
    Tab Array Clusters LV8_0.vi ‏94 KB

  • How can I get a ref to a ring in a cluster that are in a array of clusters?

    I have a cluster (typdef'd) with controls. Two of the controls is rings. I place that cluster in a array. I then fill the array of clusters up with data. Can I get the ref to the rings in each cluster? I must load them, individually, with strings[].
    Solved!
    Go to Solution.

    Mike,
    I have here a example....please look at it. It's an array that the user can look into each post (that is loaded from a XML-file).
     I cant get the ref. to the individually ring beacuse I don't know where in the array I am. 
    Attachments:
    example.vi ‏54 KB
    LiggInmatCluster.ctl ‏22 KB

  • Call library function node with array of clusters using array data pointer

    Hello all.
    I am writing a LabVIEW wrapper for an existing DLL function.
    The function has, as one of its parameters, an array of structs.  The struct is very simple, containing two integers.  I am using the call library function node to access it.
    In Labview I created an array of clusters, where the cluster has two 32-bit integers as its members.  So far, so good.
    Now I have to pass this in to the Call Library Function Node.  Here I am running into trouble.
    I have used The topic in LAVA and The topic in the knowledge base as my primary sources of information, though I have read a bunch of forum topics on the subject too.
    I do understand that I could write a new function which takes as a parameter a struct with the size as the first member and an array as the second, and I might just do this and have it call the regular function, but I was hoping to do it more simply.
    According to the C file which LabVIEW generates for me from the CLFN when I choose "Adapt to Type" and "Array Data Pointer", the prototype it is expecting is:
    int32_t myFunc(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    And the prototype of the function in my DLL is
    int borland_dll myFunc(DWORD handle, usint channel,
    int FIFOnumber, struct mStruct *data, int numWords, int *actualLoaded, int *actualStartIndex);
    This looks like a match to me, but it doesn't work (I get garbage in data).  From the topic in LAVA referenced above, I understood that it would work.  It does not.
    If I cast data to the pointer-to-pointer I get when I generate c code by wiring my struct to a CIN and generating, then I seem to get what I expect. But this seems to work when I choose "pointers to handles" too, and I would expect array data pointer to give a different result.
    Is there any way to get this to work directly, or will I have to create a wrapper?  (I am currently using LabVIEW 2011, but we have customers using 2009 and 2012, if not other versions as well).
    Thank you.
    Batya
    Solved!
    Go to Solution.

    OK, here is more detailed information.
    I have attached the VI.
    This is the code from the  "C" file created by right-clicking the CLN and creating a "C" file. 
    When the parameter in the CLN is set to "array data pointer":
    /* Call Library source file */
    #include "extcode.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
     When the parameter is "pointers to handles":
    /* Call Library source file */
    #include "extcode.h"
    /* lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. */
    #include "lv_prolog.h"
    /* Typedefs */
    typedef struct {
    int32_t control;
    int32_t data;
    } TD2;
    typedef struct {
    int32_t dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    #include "lv_epilog.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
     When the parameter is set to "handles by value":
    /* Call Library source file */
    #include "extcode.h"
    /* lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. */
    #include "lv_prolog.h"
    /* Typedefs */
    typedef struct {
    int32_t control;
    int32_t data;
    } TD2;
    typedef struct {
    int32_t dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    #include "lv_epilog.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
    As to the DLL function, it is a bit more complicated than I explained above, in the current case.  My VI calls the function by this name in one DLL, and that DLL loads a DLL and calls a function (with the same name) in the second DLL, which does the work. (Thanks Rolfk, for helping me with that one some time back!)
    Here is the code in the first ("dispatcher") DLL:
    int borland_dll Load_Transmit_FIFO_RTx(DWORD handle, usint channel, int FIFOnumber, struct FIFO_DATA_CONTROL *data, int numWords, int *actualLoaded, int *actualStartIndex)
    t_DispatchTable *pDispatchTable = (t_DispatchTable *) handle;
    int retStat = 0;
    retStat = mCheckDispatchTable(pDispatchTable);
    if (retStat < 0)
    return retStat;
    if (pDispatchTable->pLoad_Transmit_FIFO_RTx == NULL)
    return edispatchercantfindfunction;
    return pDispatchTable->pLoad_Transmit_FIFO_RTx(pDispatchT​able->handlertx, channel, FIFOnumber, data, numWords, actualLoaded, actualStartIndex);
    borland_dll is just "__declspec(dllexport)"
    The current code in the DLL that does the work is:
    // TEMP
    typedef struct {
    int control;
    int data;
    } TD2;
    typedef struct {
    int dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    // END TEMP
    int borland_dll Load_Transmit_FIFO_RTx(int handlertx, usint channel, int FIFOnumber, struct FIFO_DATA_CONTROL *data, int numWords, int *actualLoaded, int *actualStartIndex){
    struct TRANSMIT_FIFO *ptxFIFO; //pointer to transmit FIFO structure
    usint *pFIFOlist; //pointer to array of FIFO pointers to FIFO structures
    int FIFOentry, numLoaded;
    usint *lclData;
    usint nextEntryToTransmit;
    // TEMP
    FILE *pFile;
    int i;
    TD1** ppTD = (TD1**) data;
    TD1 *pTD = *ppTD;
    pFile = fopen("LoadFIFOLog.txt", "w");
    fprintf(pFile, "Starting Load FIFO with %d data words, data pointer 0x%x, with the following data&colon; \n", numWords, data);
    for (i = 0; i < numWords; i++) {
    fprintf(pFile, "%d: control--0x%x, data--0x%x \n", i, data[i].control, data[i].data);
    fflush(pFile);
    fprintf(pFile, "OK, using CIN generated structures: dimSize %d, with the following data&colon; \n", pTD->dimSize);
    for (i = 0; i < numWords; i++) {
    fprintf(pFile, "%d: control--0x%x, data--0x%x \n", i, pTD->data[i].control, pTD->data[i].data);
    fflush(pFile);
    // END TEMP
    if ((handlertx) <0 || (handlertx >= NUMCARDS)) return ebadhandle;
    if (cardrtx[handlertx].allocated != 1) return ebadhandle;
    pFIFOlist = (usint *) (cardrtx[handlertx].segaddr + cardrtx[handlertx].glob->dpchn[channel].tr_stk_ptr​);
    pFIFOlist += FIFOnumber;
    ptxFIFO = (struct TRANSMIT_FIFO *)(cardrtx[handlertx].segaddr + *pFIFOlist);
    //use local copy of ptxFIFO->nextEntryToTransmit to simplify algorithm
    nextEntryToTransmit = ptxFIFO->nextEntryToTransmit;
    //on entering this routine nextEntryToLoad is set to the entry following the last entry loaded
    //this is what we need to load now unless it's at the end of the FIFO in which case we need to wrap around
    if ( ptxFIFO->nextEntryToLoad >= ptxFIFO->numEntries)
    *actualStartIndex = 0;
    else
    *actualStartIndex = ptxFIFO->nextEntryToLoad;
    //if nextEntryToLoad points to the last entry in the FIFO and nextEntryToTransmit points to the first, the FIFO is full
    //also if nextEntryToLoad == nextEntryToTransmit the FIFO is full and we exit without loading anything
    if (( (( ptxFIFO->nextEntryToLoad >= ptxFIFO->numEntries) && (nextEntryToTransmit == 0)) ||
    ( ptxFIFO->nextEntryToLoad == nextEntryToTransmit)) && (ptxFIFO->nextEntryToLoad != INITIAL_ENTRY)){
    *actualLoaded = 0; //FIFO is full already, we can't add anything
    return 0; //this is not a failure, we just have nothing to do, this is indicated in actualLoaded
    numLoaded = 0;
    lclData = (usint *)data; //must use 16 bit writes to the module
    //conditions are dealt with inside the for loop rather than in the for statement itself
    for (FIFOentry = *actualStartIndex; ; FIFOentry++) {
    //if we reached the end of the FIFO
    //if the module is about to transmit the first element of the FIFO, the FIFO is full and we're done
    //OR if the module is about to transmit the element we're about to fill in, we're done - the
    //exception is if this is the first element we're filling in which means the FIFO is empty
    if ((( FIFOentry >= ptxFIFO->numEntries) && (nextEntryToTransmit == 0)) ||
    ((FIFOentry == nextEntryToTransmit) && (FIFOentry != *actualStartIndex) )){
    *actualLoaded = numLoaded;
    //set nextEntryToLoad to the end of the FIFO, we'll set it to the beginning next time
    //this allows us to distinguish between full and empty: nextEntryToLoad == nextEntryToTransmit means empty
    ptxFIFO->nextEntryToLoad = FIFOentry;
    return 0;
    //we reached the end but can continue loading from the top of the FIFO
    if ( FIFOentry >= ptxFIFO->numEntries)
    FIFOentry = 0;
    //load the control word
    ptxFIFO->FifoData[FIFOentry * 3] = *lclData++;
    //skip the high of the control word, the module only has a 16 bit field for control
    lclData++;
    //now put in the data
    ptxFIFO->FifoData[(FIFOentry * 3) + 2] = *lclData++;
    ptxFIFO->FifoData[(FIFOentry * 3) + 1] = *lclData++;
    numLoaded++;
    //we're done because we loaded everything the user asked for
    if (numLoaded >= numWords) {
    *actualLoaded = numLoaded;
    ptxFIFO->nextEntryToLoad = FIFOentry+1;
    return 0;
    //if we reached here, we're done because the FIFO is full
    *actualLoaded = numLoaded;
    ptxFIFO->nextEntryToLoad = FIFOentry;
    fclose (pFile);
    return 0;
     As you can see, I added a temporary diagnostic with the structures that were created in the "Handles by value" case, and print out the data.  I see what is expected, whichever of the options I pick in the CLN!  
    I understood (from the information in the two links I mentioned in my original post, and from the name of the option itself) that "array data pointer" should pass the array of data itself, without the dimSize field.  But that does not seem to be what is happening.
    Batya
    Attachments:
    ExcM4k Load Transmit FIFO.vi ‏15 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 .

  • 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.

  • 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

Maybe you are looking for

  • Sync Send step after transformation step in BPM

    Hi Gurus, I have an interface where I am loading the data into an Oracle database and getting the response back (insertcount) from the database. Based on the response, I have to execute a stored procedure in another sync send step. I am doing perfect

  • Question about BI7/ 3.x DS

    Hello guys, I have few confusions about migration of DS to BI7 version,As i was going through some documents and some postings here . My questions are: 1) whats the best way to tell that that DS thats showing in RSD1 is BI7 or 3.x  version? I noticed

  • Running Logic in 64-bit but what about Snow Loepard?

    Hi all, I am wondering what the benefit is of running Logic in 64-bit if you only run Snow Leopard in 32-bit. Is there better performance when you run both Logic and the OS in 64-bit?

  • Ipod  syncs apps but dose not show them??

    hi guys i have just updated from the old 2.2.1 version on my ipod touch 2g to the new 3.1.2 it has download the new version and has installed it on the ipod well. The problem is when i want to move the apps on it will sync all the apps and they show

  • ITunes, Skype, Dashbard crashing after software update...???

    Did an OS (OS X 10.6.8) , iTunes (10.3.1.355) and firmware etc last week. Now iTunes, Skype, Dashboard and Office My Day crash when operating. Cannot sync anything to iTunes without crashing, can listen to music but try to connect to the store it cra