AYUDA FUNCION SEARCH 1 D ARRAY

Buenos dias:

Estoy utilizando dicha funcion para realize a UN dato busquea y posteriormente utlizarlo, ver imagen en archivo Editor:

Lo deseo hacer are that in part con senalada flecha, corpos entrada to 'element' SEARCH 1 TABLE D variable sea, decir, what dependa del dato as desee buscar. The "item" variable value must be a control string. Como puedo hacer para transformar el UN valor string a UN elemento 1 cluster (the entrada elemnt)?.

MUCHAS gracias a todos.

Como eso?

Tags: NI Software

Similar Questions

  • "black square shrinking" appears when some the search results for "Array Constant" are double-cliquée.

    In the process of troubleshooting an issue of size of table, I did a Ctrl + F search after selecting a constant matrix.  I find a large number of raster constants in the search results.  However, many of these results (most behaves normally), if the item in the search results has double-clicked, momentary displays a black square, about the size of a standard icon, which immediately reduced to nothing.  There is no indicator selection outline.  I used this nice ShowAllControls & TabCtrl .vi utility to display all the controls, but nothing appears in this place.

    Someone has encountered this?  So far, it's just a nuisance. I am not free to view the code that was developed by a third party.  I would like to make a screenshot, but the black square disappears too quickly.


  • indexOf() function for search object. < property > in an array of objects

    Hello world!
    OK, I know that the subject of this sounds a little awkward wire, with an example, it will be much clearer.
    I have a series of tables that contain strings, now named "label"; These tags can only produce only once in each table (which is therefore a 'set' of the mathematical definition of 'package', tags), but more than one table may contain a given tag (intersections of the sets are not always zero).
    I want to write a function that goes through all the tags in all tables and counties, which gives the result in a separate table called tag_counter that contains the objects of the tag. A tag object contains two fields: 'value', which is the tag itself, and 'events', which takes account of the time the tag was found.
    The function logic is simple: for each table, cycle all its labels. If the tag already exists in the tag_counter table, increment the counter 1; If not, add a new entry in the table with the given tag tag_counter. The line in bold-italics is exactly in the place of my question, because I don't know how to search within an array of objects by a property of such an object. Here is the code:

    private function harvest_tags(dt:DataTable):Array {
        var tag_counter:Array = new Array();
        
        for each(var site_feeds:Object in dt.data) {    //cycle through the Arrays
            for each(var tag:String in site_feeds.t) {  //cycle through the tags
                if(tag == '') continue;     //in case an empty tag is found, skip it
                tag = tag.replace(',', ''); //strip commas
                var i:int = tag_counter.indexOf(tag); //this needs fixing!
                if(i != -1) {
                    tag_counter[i].occurrences++;
                 }
                else {
                     tag_counter.push(new Tag(tag));
                 }
             }
         }
    
         tag_counter.sortOn("occurrences", Array.NUMERIC | Array.DESCENDING);
         return tag_counter;
    }
    

    and the class of tag definition:

    public class Tag {
            private var value:String;
            public var occurrences:Number;
            
            public function Tag(value:String) {
                this.value = value;
                this.occurrences = 1;
            }
    }
    

    Any help would be greatly appreciated.

    Andrea

    I think you want to use a hash table.  The object class is often used for this.  It is much faster than searching for an array of strings.

    private void harvest_tags(dt:DataTable):Array {}

    var tag_counter:Object = new Object();

    for each (var site_feeds:Object in dt.data) {//cycle through the berries

    for each (var: string tag in site_feeds.t) {//cycle by tags

    if(tag == '') continue;     where is an empty tag, pop it

    tag = tag.replace (',', "); Strip commas

    If (tag_counter [tag])

    tag_counter [tag] ++;

    on the other

    tag_counter [tag] = 1;

    }

    }

    var tag_array:Array = new Array();

    for {(var p:String in tag_counter)

    var tagObj:Tag = new Tag (p);

    tagObj.occurences = tag_counter [p];

    }

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • How to case statement based on the array of values of 3 or more?

    I'm trying to figure out how to do a comparison or case structure... based on the creation of an array of boolean 3 (or maybe more).

    I have a table (it's from a serial connection, and I am conversion back to a table to work with) [t, F, F] in this case I would like to display on a status indicator "STBY".

    If the array is defined on [F, T, F] I want to display in this indicator "ON".

    If the array is defined on [F, F, T] I want to display in this "EMPTY" indicator

    I can not understand how to compare combinations of things... I read in an array of bytes, and the first 3 bits in this example, determine what to display in a status... I can't figure out how to do with structure case... or without some channels to research and/or bad comparison...

    Any suggestions?

    Thanks in advance,

    Cayenne

    You can use search 1 d array and find the first real.

    Or you could convert the table of Boolean integer U8 and integer that results to determine which cases to run.  (4, vs, vs 1-2)

  • Search Excel

    Hello all

    I am in need of some advice (again) and would appreciate any assistance.

    Attached is the file "2010-06-01. The file is downloaded from a webbox which is used to collect data from a solar plant. The webbox can capture data from any number of inverters attached and detectors of weather data.

    Each channel of the inverters and respected. collectors of data has its own unique name for example WindVel m/s...this is quite explicit and is simply the wind speed.

    Now, the problem is the following... the data file contains the data values in the column heading over the name of meta (of course). According to the number of inverters in line, the position of the name meta in the table can move randomly and is not predictable... This means that a search in a particular column will not always return the appropriate channel data, so fixed to the index values for a search of rows/columns is not bulletproof.

    My intention is to use the name of meta so that the search criteria... Yes... There will be a number of entries (depending on the number of inverters online) for each meta name, but this isn't my concern (again).

    I did a job on a (joint) vi who is successfully looking on and find one name on meta, but I have some difficulty to do a search for an array of different metadata names.

    The vi will be eventually found the column and then rip the data value of the last row of the table (getting to work on a single value of meta)

    Could someone give me a clue as to the way forward?

    Thank you and best regards

    Ray


  • map with LabVIEW

    Hi all

    I would like to know if it is possible to use the card as in C++?

    I have 2 tables, one chain and one of dbl. The user must write a parameter name in the control chain, and after that I need to find the value of this parameter by a search in the array of strings. It's a long way. And I need to do this several times. It's to make me think map in c ++

    If anyone can help me ^^

    Thank you

    Another place to read about the use of the attributes of Variant (LAVA Forums)

  • contradiction between the delay and fetch file bmp

    Hi all

    I need to extract the BMP file in confirm.vi (pic2), but when I run the program, the BMP file will not come out correctly. the last picture always come out. (for example, the first photo has come out of time, but when image B should be out, he still see A photo.)

    the correct picture will come out correctly when I put the delay of 100 ms in the loop. but it will cost you lost time, two arraies have 300 and 20 elements separately. How can I do it more quickly to get the correct image? Thank you!

    Hi Yes,

    It seems that you used too many loops to make your comparison function. Try to use Search 1 D Array.vi to eliminate inside while loop.

  • Get the current Index of the Ring System

    I need to know the index of the ring box that is currently displayed on the front panel during execution.

    The ring box values do not necessarily correspond to their clues so I can just wire the ring box itself to property [] DisabledItems.

    The way I'm going to get the index of the item "displayed" the control of the ring is as follows:

    A reading in the strings [] property returns an array of strings of the 'Elements' of the order of the ring.

    A reading in the RingtText.Text that returns the string value of the current item displayed in the control of the ring.

    I use the search function to search in the array of strings to the current text, and it gives me the index of the current item displayed in the control of the ring.

    Is there a way to get the index of the currently displayed index of the ring directly control?

    In a Word, no.

    the method that you use is the easiest.  If the srtings are very long, you could unbudle [channels] and property values and this table just to save a few (very minor) research paper.  Keep in mind, control system properties depend on the operating system

  • Indexing VI Clone reference

    Hi all

    In a table of references VI (which can refer to several clones of a VI), on the search for a particular clone reference VI by using 'Search 1 D Array' output is always the index of the first clone of this VI, even if we seek other clones.

    Please give an explanation of this behavior and report if there are any other ways to obtain the required index VI clone.

    PS: Find the screw demonstrating this behavior attached below.

    Thanks in advance

    Use the name of VI, or in this case, the name of the Clone.  Then do the table 1 d of search on names that are unique.  Your opinion about if this is normal or a bug, will probably depend on your level of experience in computer science.

  • How to index the occurrences in the table

    Hi, is there a way we can index every occurrence in the table?

    It seems that search that ID Array is once and I can't understand how do.

    Please notify

    Thanks in advance

    Clement

    You need only the index that corresponds to the item looking like this?

  • Haw to find the element in the table that appears only once

    I have a table like this 2d:

    1 2 3 4 5 0

    5 6 2 4 7 2

    8 3 6 0 9 4

    5 6 7 7 3 2

    And I need to find items that appear only once in this table

    In this case, 8 and 9

    I also need this elements (row and column) position

    Are integers

    I tried to remodel the table and use the find but no result.

    Your best bet is to remodel a table 1 d do your seaching and use 'Quotient & rest' to convert location (index) in the table 1 d back to the index in table 2D. Use "Array Size" to get the number of rows and columns of the table 2D.

    The histogram only works on 1 d arrays.

    Or reshape a 1 d table. For each digit (0-9), use 'Search 1 D Array' twice. If the first 'search' finds a match (does not =-1), use the offset to start the 2nd search beyond the 1st index discovery. If 2nd 'search' returns-1, then one and the SAME time happens

    The index of the first 'search' to calculate the index (Quotient & rest") line and collar of the 2D array.

  • Run the specified case the value found in the table

    Hello, I am trying to build a VI that looks for a specific (in time) value in a table and if the duration is greater than or equal to this value, a specific case is executed.

    So far I have been successful if the value is only "equal to" but not "superior to", how to fix this?

    The function "Search 1 D Array" will only find an exact match.

    See the attachment for the fix.

  • losing conection micro

    Hello

    I have Dell Studio 1536 and my Webcam and the microphone does not work, actually the web cam works now thanks to the video of the forum.

    can somehow show me where to find the connection or the MIC its self if I can try to fix it?

    Hello. If you have not yet installed your IDT audio driver, do so now. This version IDT 6.10.0.6162 is supposed to work on a Studio with Windows 7 1536. 32-bit or 64-bit.

    First, open the recording of the sound Properties tab (right click on the sound icon / speaker in the taskbar, and then click recording devices.) In the list of devices, if you see "microphone array" right click on it and set it to the default recording device. If you don't see it listed then do right-click on the blank white area to open the context menu, click "show disabled devices". Do it again and click on "show disconnected devices". Now, search to new array mic in the device list and select it at the default recording device.

  • help - match I want to write the output to a release

    I'm trying to write a script that connects to a vcenter server and search for a virtual machine with an ip address that is entered by the person running the script.  I've got it works fairly well except if I try to format the output (I want that he give me the name of the virtual machine when it finds the ip address or to tell me that he has not found a match) with an if / else statement I get no results when a match is found.  I don't know just where and how the 'match' information is kept so I can go back to the end user. If I just run $array - $match_address match it returns information, but with the formatting:

    If ($array - corresponds to $match_address)

    {Write-host "Match found $_"}

    He says just "Match Found."  Where / how to stored the game?

    I have attached the script to the aid station.

    Thank you.

    In $array you have a PSCustomObject admissions, where each has a property of intellectual property.

    You can find the match/nomatch like this

    #Connectez VIServer vct-00-ls

    #

    #$match_address = Read-Host "enter the ip address of the virtual machine to search."

    #

    # $array = get - VM | Select Name, @{N = 'IP address'; E = {@($_.guest.) IPAddress)}}

    # Specifies vCenter Server

    # #Prompt for the virtual center to connect to

    $vCenterName = Read-host "enter the name of the virtual center server you want to connect to.

    Password and user id # #Provide

    $vcentercred = get-Credential-Message "enter the user name and password to connect to $vCenterName"

    # #Connecting on the server vCenter/ESX

    write-host "connecting to vCenter Server $vCenterName" - green foreground

    SE connect-viserver $vCenterName - Credential $vcentercred

    Write-Host ""

    $match_address = Read-Host "enter the ip address of the virtual machine to search."

    $array = get-View - ViewType VirtualMachine. Select Name, @{N = "IP"; {E = {[string]: Join(',',$_.Guest.net.IPAddress)}}

    $vm = $array | where {$_.} IP-match $match_address}

    {if ($VM)}

    Write-Output "Match found $($vm.). (Name) ".

    }

    else {}

    Write-Output "no match found."

    }

    Write-Host 'Disconnect' from $VcenterName. ForegroundColor - Red

    Disconnect-VIServer $VcenterName - confirm: $False

  • Add a group of users to the other, holding the strings as arguments

    For something that should be very simple, this has had tearing me my hair for hours, now...

    We are currently running version 2.0.3 of the Plugin Active Directory.

    I found the included workflow "add groups of members of the group.

    In the opening, I found the following line;

    userGroup.addElements (groups);

    Easy peasy, I thought.  Takes an AD:UserGroup object, with an array of AD:UserGroup objects.

    So, all I have to do is create a script task which takes a string and retrieves the associated with the object Active Directory...

    Group is included

    var srcgrp = ActiveDirectory.search ("UserGroup", sourceGroup);

    Target group (the one that we're adding groups too)

    var taggrp = ActiveDirectory.search ("UserGroup", targetGroup);

    But here's where the wheels are loose...

    The research method appears to return an array of objects of type "AD_UserGroup".

    For the life of me, I CAN'T find a way convert objects AD_UserGroup objects AD:UserGroup that requires that the workflow "add groups of members of the group.

    Any help or advice on this would be much appreciated!

    Well... maybe this will help you as a primer...

    // Get a one item array... it is a UserGroup Object (but in an array of 1)
    var srcgrps = ActiveDirectory.search("UserGroup","GrpIG_smkLabTest-MGR"); //Use an S at the end for plural arrays - good practice
    System.log("Warning... search returns an array always... even if there is only one.");
    for each (srcgrp in srcgrps){
     System.log(srcgrp.getAttribute("cn"));
    }
    // Get a two item array... they are UserGroup Objects (but in an array of 2)
    var taggrps = ActiveDirectory.search("UserGroup","GrpIG_smkLabTest"); //Use an S at the end for plural arrays - good practice
    System.log("Warning... search returns an array always... even if there is only one.");
    for each (taggrp in taggrps){
     System.log(taggrp.getAttribute("cn"));
      if (taggrp.getAttribute("cn") == "GrpIG_smkLabTest") {
       System.log("Setting the one I actually want from the array: " + taggrp.getAttribute("cn"));
       var singleTargetGroup = taggrp;
      }
    }
    System.log ("Do I have the right group?"); // should be "GrpIG_smkLabTest" in my Lab
    System.log (singleTargetGroup.getAttribute("cn")); // yeppers
    // ONE user group has a method for addElements that takes an ARRAY of UserGroup and/or User objects
    singleTargetGroup.addElements(srcgrps);
    System.log("Warning... groupMembers returns an array always... even if there is only one.");
    singleTargetGroupMembers = singleTargetGroup.groupMembers; //Use an S at the end for plural arrays - good practice
    //Loop through all the members of the UserGroup object and syslog the name
    for each (singleTargetGroupMember in singleTargetGroupMembers){
     System.log(singleTargetGroupMember.getAttribute("cn"));
     }
    

Maybe you are looking for