Graph Array Elements

Hello,
I would like to graph a row of pixels.
The code below can load an image and convert it into a 3D plot based on the X, Y and pixel value.
I want to look at all the pixels in a row along the x axis and graph them on a xy graph.
Can someone help.
Cheers

Attachments:
for ni forums.vi ‏118 KB
image.jpg ‏17 KB

Why do you have a while loop in your program?
Once the image is loaded, the while loop starts.  Nothing ever changes from inside the while loop.  And the while loop is running at full speed since you have no wait function in there.  So you are pegging your processor doing things over and over and over with the only possibility that you hit the stop button to end the program.
When I ran your program, I saw graphic anomalies because the CPU didn't have enough time to redraw the screen properly when I moved the scroll bar.  And when I hit the stop button, LabVIEW completely crashed without warning back to the desktop.
(Actually, LabVIEW crashed even after I removed the while loop.)
Message Edited by Ravens Fan on 03-10-2010 10:17 PM
 On later review, I do see a control inside your loop.  It was difficult to find because you hid the labels on your controls.  Always show labels on the terminals for controls and indicators in your block diagram!
So with a control, you should use an event structure so it only does the calculations when the control changes.  And there is no need to have the picture graph inside the loop because it never changes.
 I still don't know why your VI crashes my LabVIEW.  I suspect you've got a problem inside that picture control.
Message Edited by Ravens Fan on 03-10-2010 10:20 PM

Similar Messages

  • Deleting array elements

    Hi!
    I have a problem with my program. i have an array and in this array a several numbers. With the "In Range and Coerce" function i want to prove if the the array element is inside or outside of my limitations. If my array element is in the outside of my limitation, the code in the case structure should delete this element.
    I need this program, because the array is displayed on a graph and i want only display the date, which is in the limitations.
    I hope somebody could help me!
    Best regards,
    Peter
    Labview 7.1 on Windows 2000
    Attachments:
    array.jpg ‏54 KB

    Hallo Peter
    Das Problem tritt auf, weil du immer wieder das selbe Array liest.
    Die Knoten am Loop sollten Shift-Register sein, damit das Array, bei dem das Element gelöscht wurde, bei der nächsten Iteration gelesen wird. Allerdings musst du dann auf einen While-Loop umstellen, da du ansonsten Elemente lesen willst, die es im Array nicht mehr gibt.
    Anbei eine mögliche Lösung.
    Hoffe es hilft weiter.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    RemoveElements.vi ‏32 KB

  • Using a For Loop Index for Array Element Number?

    Hi.  Thanks in advance for the help.  I can't seem to find what I want to do here using the search function... probably because I don't know how to frame the question appropriately.  Ignore the title to this post cause it's probably wrong vocabulary for what I want to do.
    Here's the situation:
    I have a 2D array where the first column is the X data and each subsequent column is Y data (call it Y1...Yn).  The n-value varies from run to run (some runs have 4 columns of data, some have 20), but that is easily gathered when reading the data file.  I need to perform a number of operations on each set of data, the least of which is smoothing the data and graphing it, so I'm limiting my discussion to these 2 operations.
    What I want is a for loop structure where the indexing of the loop tracks the Y1...Yn columns, grabs each column for the iteration, performs the relevant analysis, and spits out the result, but in a stackable manner.  Thus the title; I want to use the for loop's index to mark the array element for building a new array.
    See the image attached.  A 2D array of 9 columns (X, Y1...Y8) is analyzed such that each data set, (X, Y1), (X, Y2)...(X, Y8) is bundled, graphed, run through a B-spline Fit, of which is also graphed.  I need to replace this with something that looks like the for loop structure shown.  
    I just don't know how to get those two data bundles [(X, Yi) and it's smoothed pair] out of the for loop in a stacked set from every iteration of the for loop.
    Again the title, I think I want to build a new array where i use the index of the for loop to control the entries of the new array.  But I can't see how to do that.
    Any help would be appreciated.
    Attachments:
    NeedForLoopForThis.PNG ‏30 KB

    Hello H.R. Dunham, and welcome to the forum!
    It seems that you may be looking for Auto-Indexing, a basic feature of loops in LabVIEW.  You'll need to transpose your array before wiring it into the for loop, as elements are auto-indexed by row before column, but at that point you should be able to operate on each column and output an array of n cluster elements corresponding to your input columns.  Auto-indexing tunnels look like brackets to indicate each element will be indexed automatically- this should be the default when wiring an array into a for loop or when wiring anything out of a for loop.
    As for how to build your pairs, I suggest removing the X column and creating a "starter" cluster containing your X data and placeholder Y data before entering your "Y" processing loop.  Use the bundle by name function in the for loop to insert your processed column data into the cluster and auto-index the cluster output. Flow would be something like this:
    1) Gather data
    2) Split X and Y using standard array operations
    3) Create "template" cluster with shared X data
    4) Pass template cluster and Y-column array into an auto-indexed for loop.
    5) Insert processed Y data into cluster inside loop.
    6) Auto-index cluster data out of loop.
    This tutorial is probably also a good place to get started:
    Getting Started with NI LabVIEW Module 3: Loops
    http://www.ni.com/white-paper/7528/en/
    Hope that helps!
    Regards,
    Tom L.

  • How to Return the Index of a Mouse-Selected Array Element in the View Interface of Diadem

    Hello,
    Does anybody have an idea of how to obtain the index of a mouse-selected array element in the View interface of Diadem??
    Thanks!

    Hi Ovidius,
    Keep explaining.  The only way I know of to trap a selected cell value in VIEW is to embed into the desired VIEW area a second non-modal SUDialog that has a Table control or an XTable control displaying the values of certain data channels.  There are callbacks in both table controls for cell selection, and you can configure the table control to allow only single cell selection if that's what you want.  The regular table control will be easier to program, but the XTable control will perform much better for larger channels.
    But what happens with that value the user selected?  Is it used for a calculation?  Is it added to a report?  Why would the user select that cell in a table rather than selecting the corresponding feature in a graph with the crosshair cursor?
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How do I programmat​ically modify array element sizes?

    Hi All,
    I have a quick question about modifying the size of array elements. Hopefully someone can help, because I am at a dead end!
    I am logging some intensities from a Fibre Array using a camera. For calibration of the system, I acquire an image from the camera, click points on the image to divide it into areas of interest. I overlay my image with a grid showing the regions of interst - for example a 4x6 array. I then have to select the fibres - or ROIs - I want to log from.
    I have a cluster type-def ( a number and a boolean) to specify the fibre number and to turn logging from that fibre on/off. I overlay an (transparent) array of this typedef over my image to correspond with the regions of interest. So here's my problem - I want to modify the dimensions of the array so each control matches my ROI. I can resize the elements by rightclicking on the elements on the frontpanel, but can't find a way to do it programmatically. The Array Property Node>>Array Element>>Bounds won't 'change to write'...thats the first thing I tried.
    Its really only important that the elements align with my ROIs - so programmatically adding in gaps/spacings would also work for me...but again I can't figure out how to do this! I've attached a screenshot of part of my image with array overlaid to show you all exactly what my problem is.
    Thanks in advance for you help,
    Dave
    PS I am running Labview 8.6 without the vision add on.
    Solved!
    Go to Solution.
    Attachments:
    Array_Overlay.png ‏419 KB

    Here's my cheat (and cheap?) way If you want to get fancy and center the numeric and boolean indicators, you could add spacers on the north and west sides, too.
    Attachments:
    ClusterSpacer.vi ‏13 KB

  • How can I display all results of a array element in a TS2.0 NumericArrayMeasurement in a single report line?

    TestStand2.0 generates for each result property ( data, limits, status...) of each array element in a NumericArrayTest an extra line in the test report.
    How can I change this to display all result properties of one array element in a single line?
    How can I reduce the spaces between the property name and its value in the report?
    How can I delete the message: "Measurement[x]" and display only the Measurement Alias (named in the Edit Limits menu)?
    This means I like to change my report from:
    Measurement[0] (ADC1):
    Data: 5000
    Status: Passed
    Measurement[1] (AD
    C2):
    To:
    ADC1: Data: 5000 Status: Passed
    ADC2: ...

    Hi,
    What you can do, is use the Override Callbacks for Modify the Report that is Generated.
    Also you can also change the report sequence 'reportgen_txt.seq' to achieve the desired affect. If you go for modifying the report sequence then copy this to the User folder and then make your changes.
    In the Resources Library you can find simple examples were the report has been modified by either using the Override Callbacks or by modifying the actual sequence.
    One other item in the Report Options you will have to set the 'Select a Report Generator for Producing the Report Body' control to use the Sequence instead of the DLL.
    Hope this helps
    Ray Farmer
    Regards
    Ray Farmer

  • How to use XSLT for mapping feild names one by one to array element

    I have a XSLT case to map all the attributes feild name(not value) which has no child to the target, which is array loop.
    I give an sample below.
    source:
    <Items xmlns="http://www.example.org/sample">
    <SourceSystem>SourceSystem2573</SourceSystem>
    <TimeStamp>2010-01-17T20:54:08.234</TimeStamp>
    <Item>
    <ID>2574</ID>
    <Type>2575</Type>
    <Name>2576</Name>
    </Item>
    </Items>
    source XSD like:
         <element name="Items" type="tns:ItemsType"></element>
         <complexType name="ItemsType">
              <sequence>
                   <element name="SourceSystem" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="TimeStamp" type="dateTime" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="Item" type="tns:ItemType"
                        maxOccurs="unbounded" minOccurs="1">
                   </element>
    </sequence>
         </complexType>
    <complexType name="ItemType">
              <sequence>
                   <element name="ID" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="Type" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
    <element name="Name" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
    </sequence>
         </complexType>
    target need to be like:
    <ns1:AttributesCollection>
    <ns1:Attributes>
    <ns1:fieldname>SourceSystem</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>TimeStamp</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>ID</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>Type</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>Name</ns1:fieldname>
    </ns1:Attributes>
    </ns1:AttributesCollection>
    target XSD:
    <xs:element name="AttributesCollection" type="AttributesCollection"/>
    <xs:complexType name="AttributesCollection">
    <xs:sequence>
    <xs:element name="Attributes" type="Attributes" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Attributes">
    <xs:sequence>
    <xs:element name="fieldname" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    I know we can use local-name() to get the tag/field name,
    but I have not idea how to get these leaf field names one by one and then mapping to every array elements.
    I tried whole day but no successful
    Does anyone have some idea?
    Thanks very much!
    Keith
    Edited by: user1065212 on 17-Jan-2010 22:50
    Edited by: user1065212 on 17-Jan-2010 22:53
    Edited by: user1065212 on 17-Jan-2010 22:59

    can you paste source xsd and the correct xml output, the current one isn't really valid
    <ID>2574</TotalNumOfItems>

  • Allocate array elements one at a time?

    Is there a way to allocate array elements one at a time?
    The following code will crash because the minimumLogIndices array is not allocated.
    // get all indices where cArray[i] > minimumLog
    int[] minimumLogIndices = null;
    for (int i=0; i < columns; i++)
      if ((cArray[i] > minimumLog))
        minimumLogIndices[i] = i;
    }I would like a statement like:
    minimumLogIndices[i] = new(i);but this is not allowed, of course.
    If I use ArrayList, then the elements can be added one at a time, but I cannot use int.
    null

    int[] minimumLogIndices = new int[columns];As described here:
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html
    [Edit] The array will, however, have "holes" in it when cArray[i] <= minimumLog, but that's inevitable if you are using an array.

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • How do I set cursor.index to anywhere in the graph array?

    I am using LV 8.5.1 and feeding an XY graph with an X-Y array of data. Only a section of the array is displayed on the graph. I have a cursor (single-plot).
    I would like to set Cursor.Index property node of the cursor associated with the plot to the maximum index value of the graphed array regardless of the XScale range. I don't seem to be able to do it. I cannot set it beyond a certain number. When I rescale the graph I have a new maximum number. Is this what should happen?
    To get around this, I am momentarily setting the XScale.ScaleFit property to 1, which then allows me to set Cursor.Index to maximum (I then immediately reduce my scale range appropriately). I am having to do this before every occurrence of setting the Cursor.Index in case the new setting exceeds the currently allowed maximum value. Just seems a bit clunky.
    Thanks for any help.

    This is no longer a problem. My data is too big to feasibly be fed into a graph so am having to chop it up and use my own index pointer.

  • Problem in assigning value to an array element

    hi all
    in the following prog i am not able to assign the value to the array element
    i am not getting why it is giving me error
    //my program is as follows
    public class ArrayTest
         static int [] intArray = new int[5];
         static int [] intArray1 = new int[1];
         intArray1[0] = 5; // this line gives error
         static char [] charArray = new char[5];
         public static void main(String args[])
              System.out.println(charArray);
              intArray1 = intArray;
    }thanx in advance as usual

    The problem is that you try to execute code outside a method. This can be only done in form of a variable declaration or as a static initilization block which will be executed once when the class is loaded:public class ArrayTest
         static int [] intArray = new int[5];
         static int [] intArray1 = new int[1];
         static char [] charArray = new char[5];
         static {
              intArray[0] = 5;
         public static void main(String args[])
              System.out.println(charArray);
              intArray1 = intArray;
    }

  • How to change the color of Numeric array elements (seperatel​y) programmat​ically using property node??

    For example, i have 3 numeric controls, controlling 3 numeric array elements (Numeric control is connected directly to indicator). Then if i change value in numeric control 1, then the array element No.1 of numeric array should turn red when value exceeds 5. Similarly when i change num control 2 then element 2 of array should turns red when value in num control 1 exceeds 10. Similarly for 3rd element. In other words, i want to control the property of array elements individually through seperate numeric control.
    I have done it for single numeric indicator.i.e. when i change numeric control's values then a single numeric indicator changes values and color (Numeric text BG property) but with array, the color of whole array changes but i want to change color of singles element of array.
    Please help thanks.  
    Solved!
    Go to Solution.

    ...or replace the numerics with clusters that have a numeric and a color box. make the background of the nmeric transparent and slide the color box behind the numeric. Use the color box to control the background color.
    Other alternatives would use a cluster instead of the array or if your req's are really weird "roll-your-own" with a Picture control.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to set an array element in an object type of array??

    Hi,
    I have set attribute as follow:
    Color[] colors;
    Color[] colors = new Color[20];
    colors[0] = "Red";
    colors[1] = "blue";I can't compile this code. It said:
    "Incompatible type -found java.lang.String but expected Colors
    Could you tell me how to set an array elements when the array type is an object?

    in your case, the array shouldn't be Color[] but String[] since you re intending to put strings into it
    by the way, you could also use a hashmap to map a string to a color:
    HashMap<String, Color> hm = new HashMap<String, Color>();
    hm.put("Red", Color.RED);
    hm.put("Blue", Color.BLUE);
    etc.

  • "In initializer for 'mxmlContent', type Object is not assignable to target Array element type..."

    Hi all,
    So I've have built an application on flash builder 4.5 using Christophe Coenraets' tutorial "Building an EmployeeDirectory" (http://www.adobe.com/devnet/flex/articles/employee-directory-android-flex.html#articlecont entAdobe_numberedheader).
    I'm getting this error message "In initializer for 'mxmlContent', type Object is not assignable to target Array element type mx.core.IVisualElement." and then the debugger highlights my code this line of my code "</s:List>" in my EmployeeDetails.mxml file. This started after I coded Part 5, Step 2 "Integrating with the Device Capabilities: Triggering the Actions".   The rest of the code debugged fine.
    I think it relates to Christophe's note "Note: Make sure you import spark.events.IndexChangeEvent (and not mx.events.IndexChangedEvent) for this code to compile.".  I don't know where to place this
    " import spark.events.IndexChangeEvent;" line of code. 
    Any help?  Tks in advance..
    Any help would be greatly appreciated.  Thanks

    You have a DataGrid directly inside a State element. Perhaps wrap it in an AddChild element?
    More information on using states can be found here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=using_states_1.html

  • Read part of an array element

    Hello All.
    As indicated in the title, I am trying to read part of an array element.
    What I'm doing is reading values from a LeCroy scope using a "write" than "read" I have returned the read values into an array but the issue is the scope returns a value "1, 52.33E-3"
    I simply want the element to be 52.33 that way I can use that for other calculations.
    For example my array is.
    "1, 34.334E-3"
    "1, 53.343E-3"
    "1, 143.232E-"
    And I want it to be
    34.334
    53.343
    143.232
    Thanks!
    Solved!
    Go to Solution.

    Another option is to use Spreadsheet String to Array and use the comma as the delimiter.  It can actually change your string into an array of numbers.  Then you just index out the number you want.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Uninstall InDesign CS6 when uninstaller does not work

    trying to uninstall CS6 applications through their "uninstall applications" but i get an error message and it won't let me uninstall. Can i just try to drag files to trash. Not ideal but this is ridiculous

  • Writing text file in while loop

    Here is my question about writing text data to a file in a while loop...worded best I can. I have an Init case where I have the user choose a file path and name. I take the ref out and then I have data that is being written to the file. The loop will

  • Hook up an NES???

    I love my old Nintendo Entertainment System. I would love to play it on my computer (the one listed on my summary), but I don't know how to plug it up or if I need any software to do so. Here is what I do have: -The system w/ the necessary games and

  • How can I choose an iphoto library on itunes?

    I need to switch to a different iphoto library on itunes to sync with my ipad, how can I do this?

  • GetServerInfo from CallManager 5

    Hi, I'm trying to use the GetServerInfo method implemented in the RisPort service. When calling this method I always get the following error: 2007-07-17 12:31:52,301 INFO [http-8443-Processor18] security.RequestRateControl - http://schemas.cisco.com/