Textcolor change of a single element in an array of clusters

hi, right now I rewrite some code for a more flexible approach in the future.
One special VI causes me some serious headache right now, I need to display a flexible number of versions which will be determined on the fly with the hardware avaible. Till now it were only some controls and a fixed amount of versions to expect.
To adress this issue I created an array of cluster in which each cluster stands for all data of the version. No problem works just fine.
The main problem is, that previously new versions (different from the last value) would be bright red while the others remain black.
Something an array of cluster doesnt support
I could overlay the text with a picture control and "paint" the text in the different colours as a workaround, but I would prefer not to.
Do you know any other more elegant way to deal with this issue?

Create two transparent string indicators on top of each other, one with a different font color. Make one an empty string and the other the desired value. Swap the values to get the "other" display.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • How do you assign multiple values to a single element in an array?

    I'm probably not wording the question right.
    I have an array, let's call it M[], and for each element in the array (we'll say M[1]), I need assign three integers: row, col and value.
    I need to set it up so I can do something like this:
    A.row = M[i].col;
    A[i].col = M[i].row;
    A[i].value = M[i].value;
    The algorithm isn't what I need help with, it's assigning .col, .row and .value to an index of an array.
    Please help if you can.

    You are right. You did not word your question perfectly, but I still think I get what you want.
    First of all: A single element in an array always has exactly one value. No more, no less.
    But that's not a problem. The element in an array is either of a primitive type (boolean, byte, char, short, int, long, float, double) or it's a reference (to a Object, String, MyClass, ...).
    You can simply write a class that holds your three values and create an array of that type:
    public class SomeData {
      public int row;
      public int col;
      public int value;
    // somewhere else:
    SomeData[] a = new SomeData[10];
    a[0] = new SomeData();
    a[0].row = 10;
    a[0].col = 5;
    a[0].value = 42;Note how you only assign a single value to the element (a[0]) itself. All other assignment actually go to fields of the object refered to by that element in the array.
    Also note that in Java types (such as classes, interfaces, ...) should start with a upper-case letter, while variables (local variables, members, parameters) and method names should start with a lower-case letter.
    Edit: I'm getting old ...

  • 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

  • How to pass a single element in an array to XSL from BPEL

    In a bpel (2.0) process I have a for-each loop iterating through a list in the original input document.  Within that loop I need to construct an  input document  for a call to a web service based on data in the current node of the list objects I am looping through.
    Constructing the input document via BPEL assign activity copies within the for-each loop is an option but due to the complexity of that document I would prefer to use XSL.  But I don't know how to pass the index information (ie. the for-each counter) into XSL and use it there (and I would prefer not to have to do so, since that will prevent use of the XSL GUI in jdev), so I would prefer to send  the current node of the list as input to XSL instead.
    Is it possible to pass a sub-section of an XML document (e.g. one node in the array) as input into XSL rather than the whole document?  In other words, I would like to send the current array element from the original input document rather than the entire original input document because I will be using the data within that array element to create the web service input document.
    Example:
    <forEach parallel="no" counterName="i"
                         name="ForEachEntry">
                  <startCounterValue>1</startCounterValue>
                  <finalCounterValue>$numTimeEntries</finalCounterValue>
    If I used the BPEL assign activity to populate the input document I would need lots of copies similar to this:
                  <copy>
                      <from>$inputVariable.OteStgTimecardCollection/ns3:OteStgTimecard[1]/ns3:oteStgTimecardDetailCollection/ns3:OteStgTimecardDetail[$i]/ns3:origtransactionreference</from>
                      <to>$InvokeOteDetailAbsenceErrorStatusService_OteAbsenceDetailFailureService_InputVariable.OteAbsenceDetailFailureServiceInput_msg/ns19:OrigTransactionReference</to>
                  </copy>
    I would prefer to send the current list object as an input variable into an XSL transform: 
         $inputVariable.OteStgTimecardCollection/ns3:OteStgTimecard[1]/ns3:oteStgTimecardDetailCollection/ns3:OteStgTimecardDetail[$i]
    Is there syntax in bpel that would do that?
    Thanks

    You need use While Element and use Array like Element[number]
    With While element you iterate <employee> node
    and with Element[number] you can extract information from that node.
    I wrote a BPEL that scan a XML file, the input is:
    <cliente>
            <codigo>01</codigo>
            <nombre>Deiby Mauricio Gomez</nombre>
                    <productos>
                            <producto>
                                    <nombre>Camisa Polo</nombre>
                                    <precio>50</precio>
                            </producto>
                            <producto>
                                    <nombre>Pantalon Lona</nombre>
                                    <precio>100</precio>
                            </producto>
                    </productos>
            </cliente>
            <cliente>
            <codigo>02</codigo>
            <nombre>Julio Cesar Ayapan</nombre>
                    <productos>
                            <producto>
                                    <nombre>Camisa Polo</nombre>
                                    <precio>50</precio>
                            </producto>
                    </productos>
            </cliente>
    In my BPEL I added up all article prices and after that I write to txt file the client and the Total.
    Example:
    Deiby Gomez, 150
    Cesar Ayapan, 50
    My while element is this (Please pay attention in bold words):
      <while name="While1"
               condition="bpws:getVariableData('variable1')&lt;=count(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente'))">
          <sequence>
            <assign name="Assign1">
              <copy>
                <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
                <to variable="Invoke1_process_InputVariable" part="payload"
                    query="/ns5:process/ns5:cantidad"/>
              </copy>
              <copy>
                <from variable="Receive1_input_files" part="body"
                      query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
                <to variable="Invoke1_process_InputVariable" part="payload"
                    query="/ns5:process/ns5:id"/>
              </copy>
            </assign>
            <invoke name="Invoke1" inputVariable="Invoke1_process_InputVariable"
                    outputVariable="Invoke1_process_OutputVariable"
                    partnerLink="ValidacionBancos2WS" portType="ns5:BPELProcess1"
                    operation="process" bpelx:invokeAsDetail="no"/>
            <switch name="Switch1">
              <case condition="bpws:getVariableData('Invoke1_process_OutputVariable','payload','/ns5:processResponse/ns5:resultado')='true'">
                <bpelx:annotation>
                  <bpelx:pattern>Si el cliente es aprobado</bpelx:pattern>
                  <bpelx:general>
                    <bpelx:property name="userLabel">Si Aprobado</bpelx:property>
                  </bpelx:general>
                </bpelx:annotation>
                <sequence>
                  <assign name="Assign4">
                    <copy>
                      <from variable="Receive1_input_files" part="body"
                            query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
                      <to variable="Approved_Write_input" part="body"
                          query="/ns7:clientes/ns7:cliente/ns7:id"/>
                    </copy>
                    <copy>
                      <from variable="Receive1_input_files" part="body"
                            query="/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:nombre"/>
                      <to variable="Approved_Write_input" part="body"
                          query="/ns7:clientes/ns7:cliente/ns7:nombre"/>
                    </copy>
                    <copy>
                      <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
                      <to variable="Approved_Write_input" part="body"
                          query="/ns7:clientes/ns7:cliente/ns7:total"/>
                    </copy>
                  </assign>
                  <invoke name="Invoke2" inputVariable="Approved_Write_input"
                          partnerLink="fileAdapterWriteApproved"
                          portType="ns6:Write_ptt" operation="Write"
                          bpelx:invokeAsDetail="no"/>
                </sequence>
              </case>
              <otherwise>
                <sequence name="Sequence1">
                  <assign name="Assign5">
                    <copy>
                      <from variable="Receive1_input_files" part="body"
                            query='/ns4:clientes/ns4:cliente[number(bpws:getVariableData("variable1"))]/ns4:codigo'/>
                      <to variable="Rechazados_Write_input" part="body"
                          query="/ns9:clientes/ns9:cliente/ns9:id"/>
                    </copy>
                    <copy>
                      <from variable="Receive1_input_files" part="body"
                            query="/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:nombre"/>
                      <to variable="Rechazados_Write_input" part="body"
                          query="/ns9:clientes/ns9:cliente/ns9:nombre"/>
                    </copy>
                    <copy>
                      <from expression="sum(bpws:getVariableData('Receive1_input_files','body','/ns4:clientes/ns4:cliente[number(bpws:getVariableData(&quot;variable1&quot;))]/ns4:productos/ns4:producto/ns4:precio'))"/>
                      <to variable="Rechazados_Write_input" part="body"
                          query="/ns9:clientes/ns9:cliente/ns9:total"/>
                    </copy>
                  </assign>
                  <invoke name="Invoke3"
                          inputVariable="Rechazados_Write_input"
                          partnerLink="fileAdapterWriteRechazados"
                          portType="ns8:Write_ptt" operation="Write"
                          bpelx:invokeAsDetail="no"/>
                </sequence>
              </otherwise>
            </switch>
            <assign name="Assign2">
              <copy>
                <from expression="''"/>
                <to variable="Invoke1_process_InputVariable" part="payload"
                    query="/ns5:process/ns5:id"/>
              </copy>
              <copy>
                <from expression="bpws:getVariableData('variable1')+1"/>
                <to variable="variable1"/>
              </copy>
              <copy>
                <from expression="''"/>
                <to variable="Invoke1_process_InputVariable" part="payload"
                    query="/ns5:process/ns5:cantidad"/>
              </copy>
            </assign>
          </sequence>
        </while>

  • How to blink a single element in an array of string

    Hi,
    I am working on array blinking option in an array of string. I wanted to blink each element of array in different instances.
    Ex: I have array as MyArray [5] = { "aaaa", "bbbb", "cccc", "dddd", "eeee"}. Question is i want to blink one by one, first 0th row, next 1st row and so on.
    Could any one please help on this.
    Many Thanks
    Hanee..

    Ian,
    i cannot tell you what's happening here. Fact is, that this is not the way to go. See attached example.
    If you run it and click into one of the string fields (mouse up event!) you will see, that "Cell" Value changes. If you look into the code, you see that i read the string form the String refnum, so it seems to handle the "Active Cell". But writing to it (Set Color) will reveal, that the whole array will change its background color. This matches my statement.
    I really fo not understand, why reading from the same string refnum yields different results ("Active Cell"???!), but regarding blinking: setting this for a single "Cell" will set it for all "Cells", but due to graphical updates (same as buttons&event structures), it is only visible in the "Active Cell". Rest asured, that the property value "blinking" is true for all "Cells" then (even thought not graphically visible).
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.
    Attachments:
    ArrayReference.vi ‏14 KB

  • How to set Keyfocus to a single Element in an Array-Control

    How do i set the keyfocus programmatically to a single numeric-control in an array-control.

    This is detailed handled here.
    Guenter

  • Array of clusters and in the cluster is a bar meter, how can I change the color individually?

    Array of clusters and in the cluster is a bar meter, how can I change the color of the bar meter individually for each element of the array?  I have just figured out that you can't change properties of one element of the array without all elements changing.  For the scaling I had to make numeric indicators for each tick of the scale so that each bar meter in the clustered array would have individual scales.  I also had to do some math to scale each barmeter to display correct proportions from 0 to 100%.  Now I'm stumped on the color of the bar meter.  Basically, if the value goes over a setpoint, the bar meter needs to turn red.  It has to be in an array to be infinitely scalable.
    Thanks
    Matt
    Solved!
    Go to Solution.

    You can't do that-
    without a little trick.
    You could consider laying a custom color box over the bar graph in the cluster you can set the color based on the value of the bar graph or even make a "Pseudo"- bar graph using a series of color boxes stacked to look lie a bar and changing values of the Color boxs from empty to full to red.
    Here is an example to demonstrate
    Jeff
    Attachments:
    Pseudo bar.vi ‏12 KB

  • Type defined array of clusters for holding configuration data - setting default values for each array element

    Hi,
    I was wondering if I could get some information and opinions about using a type defined array of clusters to hold configuration data.  I am creating a program to test multiple DUTs and wanted to have a type defined control for each DUT containing the information needed to create the DAQmx tasks for all of the signals for that DUT.  I am wanting to do this so that the data is hard-coded and not in a file that the user could mess up.
    The type def controls are then put in a subVI that chooses the appropriate one based on the DUT Type enumeration wired to a case structure.  
    I am having problems with the type defined control.  I am seeing issues when attempting to save a unique configuration to each array element in the array of clusters.  Somehow it worked to begin with, but now clicking "Data Operations --> Make Current value default" on individual elements of the cluster or the entire cluster (array element) is not saving the data when I re-open the type def control.  What am I doing wrong?  Am I trying to do something with arrays of clusters that I should not be doing?
    I have attached one of the type defined controls for reference.  I tried changing it to Strict to see if that helped, but no luck.
    To reproduce, change the resource string for array element 0 and make the new value the default value.  Then close the type def, and re-open it.  The old value is still present in that element.  The VI is saved in LabVIEW 2012.
    Solved!
    Go to Solution.
    Attachments:
    CM_AnalogInputs.ctl ‏11 KB

    Values of a typedef are not proprigated to instances of the control. THey will pick it up if created AFTER the data values have been changed. THey will not get updated with future changes. You should either create a VI specifically for hardcoding your values or implement a file based initialization. The file based would be much better and more flexible. If you don't want users to modify the data simply encrypt it. There is a noce blowfish library you can download.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Plotting elements from an array in waveform chart

    Hi all,
             I am trying to plot a real time data by extracting single element from an array.
    Problem is that, at some frequencies waveform chart plot perfect while at other frequencies it plots like a undersampled signals.
    Any suggestions?
    Attachments:
    wfm.png ‏136 KB
    wfm.vi ‏133 KB

    The timing information comes from the data acquisition process, not the display. You should be able to get equally good display of timing information on a chart or a graph.
    How many samples do you read at a time? How do you define "realtime"? Anything plotted on a graph or chart for the use of a human operator does not need to be updated more than about 10 times per second because the eye/mind system works at about that time scale. For humans a real time grahical update rate of 2 to 10 Hz is adequate. Then you will have 256 to ~51 new samples at each update.
    Another issue is that both your graph and your plot have plot areas which are less than 200 pixels wide. If you supply more than [plot width] pixels to a graph or chart, LabVIEW will reduce the data to determine which pixels to plot. So your graph with 1000 X-axis values has that reduced to the 184 pixels across the width of the graph. So, regardless of the precision of the data, the "precision" of the display is limited to the number of pixels.
    Lynn

  • Add 1 single element in Java Mapping

    I have quite a simple requirement for my Java Mapping, however as I have done just message mappings and XSLT mappings maybe you could help how to achieve the following:
    I have an input message with attachment, what I want to do now is to read a string out of the attachment (this is already what I have done) and append a single element to the input message. No other elements should be changed.
    What would be a simple way to do this?
    Thank you very much
    Edited by: Florian G. on Nov 12, 2009 9:02 PM
    Edited by: Florian G. on Nov 12, 2009 9:03 PM

    Hi,
    You can access your attachements in:
    1. UDFs (by using package com.sap.aii.mappingtool.tf7.rt interface GlobalContainer method getInputAttachments())
    2. Java mappings (by using package com.sap.aii.mapping.api class TransformationInput method getInputAttachments())
    3. Adapter Modules
    For each area, you can find how to acccess the payloads by referring to the javadocs:
    http://help.sap.com/javadocs/pi/SP3/xpi/index.html?index-all.html
    They will all give you your attachment as text or binary data, but you will need to parse the data yourself. If your attachment itself is an XML as well, you might use DOM, SAX, stAX or other parsers if the structure is complex. Otherwise, a simple Java regex or  any simple String parsing will do as well for simple cases.
    Regards,
    S. Gökhan TOPÇ

  • Graph & Chart: select and colour single element of data series

    Hi,
    my question is about formatting Keynote graph: i.e. bar graph 2d or 3d, is it possible select and colour differently a single element of series? In Powerpoint exists that possibility, but in Keynote I can't find the way to select only one element. If I change colour, all series elements change.
    Thanks in advance
    Antonella

    Hi Pasha ,
    yes, i am quite sure that bars are overlapping and checked with the 3 options you have mentioned.
    3. I have tried streching the graph horizontally but still the same display.
    2. I did moved to mouse to the edge points of bar .. it only mentioned one data series instead of two
    1. See if the db column contains NON-ZERO values ? ..
    I am not sure of it but when deploying the model in VC , i got a warning message saying " Zero fill is checked without Max length in field "Gross Turnover Actual " of entity " query name "
    Let me know, how this efffects the display and what do i need to do to resolve the issue .
    Appreciate your valuable inputs ...
    Thnks,
    NR

  • How to use single element as both control as well as indicator in labview

    Hi All,
    I need to use single element for both control and as an indicator.
    I need not want to use its value property os shift register.

    Hi pmg,
                I think this thread will be helpful to you.
               http://forums.ni.com/t5/LabVIEW/Using-a-control-as-both-an-indicator-and-control/td-p/1113158 
    Thanks as kudos only

  • How to disable one single element in a 2D array?

    Hello,
    I would like to disable one element in a 2D array. its size is constant at least.
    I can change its value by using a 1D array of cluster, but I can't use the property mode easily to disable an element.
    If you have any idea, it will be great.
    Thank you for your help.
    Lolopuf

    Right click on the particular control you want to disable and change the properties on that.  To do it programmatically, create a reference for that specific control and set the Disabled property for that.
    Attachments:
    Example_VI.png ‏15 KB

  • How can I change the properties of only one element in an array of booleans?

    I'm displaying an array of booleans to my operators, with each boolean in the array representing some system status check.  Some of these checks are critical and some are not, therefore I want some of these booleans to have a different color when in the TRUE state (Red for the critical ones and Yellow for the non-critical ones).  I can change the boolean colors with a property node, but that effects every element in the array.  Is there any way to change a property of an individual element in an array?  I know that I could take the incoming array and break it into two arrays - one for critical and one for non-critical, but this system is replacing an older system and the operators are accustomed to seeing their indicator lights a certain way and I'm trying to replicate what they had exactly.

    Here's what I had in mind
    Of course you can use as many colors as you want.
    Message Edited by altenbach on 12-21-2005 04:53 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    LEDarray.png ‏7 KB
    ColorArray3.vi ‏23 KB

  • Need changes in standard data element

    Hi gurus,
    I want to change in one of SAP standard data element for adding search help into it.
    for this fields there is no user exit or any enhancement is present.
    I have taken access key from our basis guy after putting access key i am unable to change the data element i mean access key is correct but i am unable to edit data element.
    so can anybody tell me how can i change in this data element.
    note : I have access key.
    Regards
    Ankit

    Hi,
    What data element you are about to change, you should take extra care before changing standard data elements as it may be used in many places.
    Do a Where-Used list to determine nothing else will be affected because of this change.
    Regards
    Karthik D

Maybe you are looking for

  • Foreign Server Redeployment

    After creating a foreign server (using the Admin Console) on server 'A', can I package the newly created foreign server and deploy to server 'B'?

  • Where to buy HD?

    Here is my situation. My MacPro HD died. It is being shipping from Apple, but I am in a dire situation. I need my machine running tonight to complete a project. I do not mind buying an extra drive, there is always a good use for one around my place.

  • Anybody got this Answer for BestFridayDeal Nov07 for MicrosoftOffice04?

    Odered the +"Best. Friday. Deal. Get Office 2004 for Mac on Friday, November 23rd and receive a $100 mail-in rebate."+ via AppleStore in November2007, did everything on the rebate form, not only that Microsoft Office 08 is backorder until I don't kno

  • Where am i gone wrong in this applescript

    tell application "Messages" set myFolder to "/Users/palmglow/Documents/googledrive/orders/IFTTT/test" set textMessage to ("-----") set targetService to id of 1st service whose service type = iMessage set myFolder to "/Users/palmglow/Documents/googled

  • APP CRASH WHEN OPENING MICROSOFT WORD 2010!!

    Hello all. I know this has been discussed over and over here but nothing seems to work yet for me.  I'm running Win 7 pro and word crashes on me every time I try to open an existing .doc or .docx file. this is the error message I get. Problem Event N