Search timestamp array for a specific value

Hello,
I need some help creating a VI that will allow me to do some data post-processing.  The problem is multifaceted, so help on any aspect will be of great help.  The end goal of the VI will allow the user to select two times, intial and final, and create a plot based on the corresponding data vs. the time selected, and output to a .jpg. 
1.  How do I find the index of the time array?  Right now, no matter what time value i input, the index is zero.  The time input should only be significant at most to seconds.
2.  How do i select all the values between the two chosen times?
3.  Is there a better way to read in my .tdm file?
4.  Documentation on exporting plots?  I also have Diadem.
Attached is the VI that im working with.  The post unfortunately does not allow .tdm files.  I can't say that i've gotten very far, so any advice would be much appreciated.
Alex
Attachments:
post-analysis.vi ‏50 KB

The "Threshold 1D Array" works in a similar manner as the "Search 1D Array" except that it doesn't try to find an exact match. It finds the two array elements between which your search value falls. It then tells you a fractional index that basically tells you where it falls between those two values. So, a value of 2.5 means it falls smack in the middle between the third and fourth elements of the array. A value of 2.1 means it would fall just after the third element, and a value of 2.9 means it would fall just before the fourth element. The one caveat is that the array must be monotonically increasing. The "Interpolate 1D Array" can be used to interpolate a value given the fractional index. In your case it isn't really necessary - I was showing it for demonstration.
As to your specific question, I'm not sure which array you're talking about. When you run the VI does the "32bit ingerer" indicator give you the correct index based on the timestamp that you're looking for?

Similar Messages

  • Filtering a Query result for a specific value of a key figure

    Hi folks,
    I want to filter a query for a specific value of a key figure. The report should display all customer who has an account balance greater than EUR 500'000.
    Can I only implement this kind of filter via a condition in Query-Designer? If I run that query on an InfoCube with non-cumulative key figures over all our customers (> 400'000) I have problems with the consumption of the memory. If I restrict the amount of the customers to 50'000 - 60'000 then it works. It seems that the query reads all customer records in an internal table before applying the condition.
    Is there another way to deal with? Any help appreciated.
    Kind regards
    Hansjörg Luzi
    Graubündner Kantonalbank
    CH-7002 Chur

    You could try to implement an alternative solution: define a new Characteristc with discrete values (in the following example I suppose to have intervals of 10)
    KF -> CHAR
    115 -> 110 (110 <= KF < 120)
      5 ->   0 (  0 <= KF <  10)
    83 ->  80 ( 80 <= KF <  90)
    Then you can use these dicrete values to filter ...
    I know that it's not so "flexible" (discetization must be predefined), but query response time is quicker and you can use Aggregates ...
    Hope it helps
    GFV

  • How do i search a textfile for a particular value?

    How do i search a textfile for a particular value?
    I have made the records etc, six fields per record, i would like to find a value which is typed into the search textbox, find the record in the textfile and display the record in the boxes used to enter the data.
    SO HOW WOULD I SEARCH A TEXTFILE?
    Thanks very much for your help, Antony (UK)...

    If it were me, I'd use Lucene. Each line could be a separate document, and each field would be a field in Lucene. That would provide you one of the fastest and most flexible ways to do what you want.
    Or did you mean you want someone to complete your homework assignment? :-)

  • How to Search and Array for multiple occurrences of a value

    Hi,
    I am trying to search an array of doubles for a number and report the index location(s) of a number. I.e. -allow for repetition. Search and report all index[i] where the number is contained in the array. For example I have
    double[] myInputArray = new double[5];
    double[] myInputArray = { 1, 2, 3, 3, 5 }I know how to search through the array ONCE and return the first occurrence of a number:
    public double GetIndexOf(double Number) {
        for (int i=0; i<myInputArray.length; i++) {
             if (myInputArray[i] == Number){
                  return(i);
        return(-1);
      }How do I expand this code to report multiple index[i] locations if the number reoccurs in the array like the number 3 does in my example array above?

    The way the Java libraries do this type of operation (String.indexOf(), etc) is to specify the starting index along with what you want to find.
    Changing your example slightly (notice how I fixed your naming and more importantly, your return type):
    public int indexOf(double num) {
       return indexOf(num, 0);
    public int indexOf(double num, int fromIndex) {
        for (int i=fromIndex; i<myInputArray.length; i++) {
             if (myInputArray[i] == num){
                  return(i);
        return(-1);
    //usage to get all indices:
    for ( int index = -1; (index = indexOf(num, index+1)) != -1; ) {
       System.out.println(index);
    }Note that due to how floating point numbers work, you may find doing this on doubles (or any other operation that uses == with double arguments) to give you unexpected results.

  • How to search a genre for a specific title in the iTunes Store and have a concise result

    How can I search the iTunes for say:  Title = "Satisfied" and Genre = "Christian & Gospel" and have a result with only tunes that start with "Satisfied" within the Genre "Christian & Gospel"

    Hi Aravinda,
    SharePoint list column (or site column used as a list column), after we create a list item and make sure column has value, and start a full crawl, then a Crawled Property format as ows_thisColumnName (e.g. ows_Description in this case) will be
    generated for this column, you can check the search service application from Central Administration site, find the Crawled Property ows_Description and make sure the option "include values for this property in the search index" is checked, and
    re-start a full crawl, then check results again.
    Thanks
    Daniel Yang
    TechNet Community Support

  • How can I change all Inf elements in an array to a specific value?

    I would like to change all Inf elements in my array to -1. Basically, I am looking for something similar to the range and coerce function, except that I want all values above a certain value to be a specific negative value, rather than go to that value.
    I could use a case structure and go through each element in the array, but I am hoping to find something more efficient.Any ideas?
    Solved!
    Go to Solution.

    P@Anand wrote:
    I would do that in this way.
    Here's a simpler version...
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Replace in Array.png ‏4 KB

  • Searching 1D array for data present in lookup 1D array.

    Hi!,
    I have a sorted 1D array of strings(say initial array) and I have
    three lookup array of string(say array A, array B and array C). I want
    to search the initial array with array A, array B and array C and then
    create a new array Final which will contain the elements of array A,
    if any, its start index and its last index and then element sof
    arrayB, if any found, its start index and its end index and then
    element of array C its start index and its end index.
    The start index and end index are stored in different indicatrs for
    all the three found.
    How do I search elements of 1D array with another 1D array?
    TIA,
    RK

    There are probably several ways to do it. One way to do it you would create a For Loop with the initial array run into it with auto-indexing turned off. You would then run array A into it with auto-indexing turned on. Inside of the loop, you would use a Search Array to find the index (if any) of the element in the initial array that matched the auto-indexed element of Array A. You will want to either build an array of only the indexes >=0 (trapping the "not found" -1) or you can autoindex the results and have you later code deal with them.
    You will need three of these loops, one for each searching array. Or better, you could push it into a subVI and call it three times.
    I hope that this helps!
    Bob Young
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Searching 2D array for duplicates

    Hi There. I wonder if someone can help.
    I have a 2D array of strings (resulting from a database query) One col is a list of job numbers and the other is a list of dates. My SQL query produces results for distinct job numbers and distinct dates. So if there are entries in the database where a job number is split between two or more dates, there will be two (or more) entries.
    SELECT DISTINCT SONumber, DateEstimatedShip FROM JobDetails WHERE jobdetails.status <700
    What I am trying to do is search through the list of job numbers and list out in a separate array the numbers that are duplicated. I've tried to do this by passing the raw 2D array into a indexing tunnel in a for loop. Then check if there are any duplicates from the next position down in the array to the end. This works fine, but if there are any items that are duplicated more than once I get two entries in my list of duplicates - as in my example below job number 3466 is listed twice as it has three entries in the raw sql table.
    How can I turn this array into a list of just the numbers that are duplicated (with no duplicates within it)
    I hope I've explained this to a satisfactory level.
    Any thoughts will be greatly appreciated.

    You can perform a second search on your 'list of duplicates' array using the same input as your first search, then if the second search index is <0 you can insert into the 'list of duplicates' array.
    (Norbert beat me by a few seconds...)
    Message Edited by Phillip Brooks on 12-02-2009 07:58 AM
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • How to scan an Excel Page/sheet for specific value in cells?

    Hi,
    I want to be able to scan an excel sheet for a specific value and return it.
    My goal is to be able to scan the excel file which it compares to another value:
    I.E : reads item 1 which gives it a value of A it will then search for this A at location X it will then return a value that matchs it or return a pop up message saying no such item exists in area excel page G.
    Message Edited by MrSafe on 07-23-2008 04:48 PM

    I did not understand your explanation since I don't know what "item 1" is supposed to be to read. Skipping that, the easiest way to do this is to do the searching in LabVIEW. Simply read the Excel sheet into an array and search the array in LabVIEW. You can try to use ActiveX to execute the "Find" method, but that's up to you. You can research MSDN on how to call the "Find" method. The attached example is one that I created a while ago as an example to read an Excel range into an array. It's in 8.0.
    Attachments:
    Read Excel.vi ‏35 KB

  • How do I search a spreadsheet for a list of URL's | then search those URL's for keywords | save the output? (Oh yeah..., and schedule it)

    Fist, I should mention I am not a programmer but am eagerly learning powershell!
    I am looking for an automated solution to accomplish what I am currently doing manually.  I need a script that would combine the following:
    Reach out to a list of websites (probably a loop of some sort since the list will come out of a spreadsheet which could contain 1 or 100 different sites)
    Search each page for a specific word or words (not contained in the spreadsheet though that may make it more scalable)
    Save the URL of the site(s) that contained the keywords to one text file (versus the multiple .html files I am creating today)
    Have the output contain which words it found on which site.
    If not overly complicated, I would like to schedule this to recur once a week.
    A working script would be ideal, but even the resources that show me how to incorporate each element would suffice.
    I have had success pulling down the full content of the listed pages and saving them to a directory, which requires manual intervention.
    So far this works, but it's not scalable:
         Set-ExecutionPolicy RemoteSigned
         $web = New-Object Net.WebClient
         $web.DownloadString("http://sosomesite/54321.com") | Out-File "C:\savestuffhere\54321.html"
         $web.DownloadString("http://sosomesite/54321.com") | Out-File "C:\savestuffhere\65432.html"
         Get-ChildItem -Path "C:\savestuffhere\" -Include *.html -Recurse | Select-String -Pattern "Keyword 1"
    In otherwords, I have to manually replace the "http://sosomesite/54321.com" and "C:\savestuffhere\54321.html" when the URL changes to .\65432.com and the output name to match.  That works fine when it's a couple sites, but again,
    is not scalable.  
    Then, to see if any of the saved file's contain the keyword(s), I have to search the directory for the keyword which I am using:
    Get-ChildItem -Path "C:\savestuffhere\54321.html" -Include *.html -Recurse | Select-String -Pattern "Keyword 1"

    Hi Sure-man,
    Sorry for the delay reply.
    To automatically Reach out to all urls, you can list all urls in a txt file "d:\urls.txt" like this:
    http://sosomesite/54321.com
    http://sosomesite/65432.com
    Then please try the script below to save the URL of the site(s) that contained the keywords to one text file "d:\outputurls.txt":
    $urls = get-content d:\urls.txt
    foreach($url in $urls){
    $results = $web.DownloadString("$url")
    $matches = $results | Select-String -Pattern "keyword1","keyword2"
    #Extract the text of the messages, which are contained in segments that look like keyword1 or keyword2.
    if ($matches.Matches){
    $Object = New-Object PSObject
    $Object | add-member Noteproperty keyword $matches.Matches.value
    $Object | add-member Noteproperty URL $url
    $output+=$Object}
    $output|Out-File d:\outputurls.txt
    If you want to schduled this script in Task Scheduler once a week, please save the script above as .ps1 file, and follow this article:
    Weekend Scripter: Use the Windows Task Scheduler to Run a Windows PowerShell Script
    If I have any misunderstanding, please let me know.
    I hope this helps.

  • How to generate a triangle waveforma array for a particular duration?

    I am generating a triangular waveform from a starting potential of 'x' to a switching potential of 'y'. I want to set a hold period after generating the array for a specific time.
    For example, after I have generated a triangular signal containing 1000 points, I want to hold the waveform for some duration before applying the potential again. In the attached vi, CreateWaveform.vi, after i get a triangular pattern, I want to insert a hold at the starting/negative potential for a time period determined by the frequency that i set.
    Attachments:
    CreateWaveform.zip ‏73 KB

    what is meant by holding the waveform for some duration? is it a set of new value that needs to be appended to the traigle waveform?
    Regards
    Guru (CLA)

  • Need Search help to appear on Multiple Value Screen - Monitor SC

    Hello All,
    We have a requirement where we need to add a new field in Monitor Shopping Cart screen. This field is at the item level and should be able to take in multiple values.
    The problem we face is - On getting the multiple value screen, the search help for the field is dissappearing.
    We already have a standard field 'Purchase Group' for which this functionality is provided and the search help works for the multiple value screen.
    Please provide any pointers to how to fix the problem. Would the problem be on the ABAP side or the HTML side?
    Thank you.
    Johnson

    Hi,
    Jsut to see in the error is on abap side, sign on in SRM sapgui and run /n then bbp_mon_sc to enter the monitor SC application.
    Navigate till your Zdevelopment field and check it
    Kind regards,
    Yann

  • Querying many tables at once from a select statement for specific values

    Hi all,
    I'm very new to PL/SQL and have a daunting task ahead of me. I'm pretty sure our database normalization scheme is all out of whack, which I dont have the experience to fix yet, but this is the task ahead of me without getting to change or fix our structure:
    in the universe has 1000+ tables.
    need--> Some of those tables have fields that contain a value that has to be changed.
    The only thing I have to go on is the column name will contain 'EMP'... but there is no specific naming convention for the column names.
    When I search on:
    select * from all_tab_columns where column_name like UPPER('%EMP%')
    It returns 750 rows. (So 750 rows = 750 columns in 500 different tables (some tables have 2 or more columns in it))
    tables names are random (table1, table2, etc).
    columns names are random with EMP in it (column1,column2,etc).
    I have 75 possible field values that I need to check each of those 750 columns for.
    Maybe this is too messy, but I'm looking at subqueries, joins, arrays, cursors, etc, anything to minimize the amount of work I have to do.
    I think this is too much to do a join with, but that seems to be what all the documentation is pointing me to.
    can you point me to a simple example of what i could
    write?
    the logic i see it would be
    run the select statement to grab the column names that meet EMP.
    one at a time, search each column in the corresponding table for the 75 values.
    return the results of rows for each column/table that meet one of the 75 unique values.
    I'll have to also update each of the 75 values to (used to be values 1, 2, 3 ... to new values X1, X2, X3, etc.)
    Any help at all would be very helpful,
    aspiring pl/sql programmer but having a rough time of it

    I think you're looking to do something like the following pseudocode:
    BEGIN
        FOR tblrec IN (SELECT table_name, column_name
                         FROM all_tab_columns
                        WHERE column_name LIKE '%EMP%')
        LOOP
            FOR rec IN (SELECT ROWID
                          FROM tblrec.table_name
                         WHERE REGEXP_LIKE(tblrec.column_name, '(expr1|expr2|...)')
            LOOP
                DBMS_OUTPUT.PUT_LINE(
                    'Found expression on ROWID ' || rec.rowid
                    || ' in column ' || tblrec.column_name
                    || ' on table ' || tblrec.table_name);
            END LOOP;
        END LOOP;
    END;

  • Search for records in the event viewer after the last run (not the entire event log), remove duplicate - Output Logon type for a specific OU users

    Hi,
    The following code works perfectly for me and give me a list of users for a specific OU and their respective logon types :-
    $logFile = 'c:\test\test.txt'
    $_myOU = "OU=ABC,dc=contosso,DC=com"
    # LogonType as per technet
    $_logontype = @{
        2 = "Interactive" 
        3 = "Network"
        4 = "Batch"
        5 = "Service"
        7 = "Unlock"
        8 = "NetworkCleartext"
        9 = "NewCredentials"
        10 = "RemoteInteractive"
        11 = "CachedInteractive"
    Get-WinEvent -FilterXml "<QueryList><Query Id=""0"" Path=""Security""><Select Path=""Security"">*[System[(EventID=4624)]]</Select><Suppress Path=""Security"">*[EventData[Data[@Name=""SubjectLogonId""]=""0x0""
    or Data[@Name=""TargetDomainName""]=""NT AUTHORITY"" or Data[@Name=""TargetDomainName""]=""Window Manager""]]</Suppress></Query></QueryList>" -ComputerName
    "XYZ" | ForEach-Object {
        #TargetUserSid
        $_cur_OU = ([ADSI]"LDAP://<SID=$(($_.Properties[4]).Value.Value)>").distinguishedName
        If ( $_cur_OU -like "*$_myOU" ) {
            $_cur_OU
            #LogonType
            $_logontype[ [int] $_.Properties[8].Value ]
    #Time-created
    $_.TimeCreated
        $_.Properties[18].Value
    } >> $logFile
    I am able to pipe the results to a file however, I would like to convert it to CSV/HTML When i try "convertto-HTML"
    function it converts certain values . Also,
    a) I would like to remove duplicate entries when the script runs only for that execution. 
    b) When the script is run, we may be able to search for records after the last run and not search in the same
    records that we have looked into before.
    PLEASE HELP ! 

    If you just want to look for the new events since the last run, I suggest to record the EventRecordID of the last event you parsed and use it as a reference in your filter. For example:
    <QueryList>
      <Query Id="0" Path="Security">
        <Select Path="Security">*[System[(EventID=4624 and
    EventRecordID>46452302)]]</Select>
        <Suppress Path="Security">*[EventData[Data[@Name="SubjectLogonId"]="0x0" or Data[@Name="TargetDomainName"]="NT AUTHORITY" or Data[@Name="TargetDomainName"]="Window Manager"]]</Suppress>
      </Query>
    </QueryList>
    That's this logic that the Server Manager of Windows Serve 2012 is using to save time, CPU and bandwidth. The problem is how to get that number and provide it to your next run. You can store in a file and read it at the beginning. If not found, you
    can go through the all event list.
    Let's say you store it in a simple text file, ref.txt
    1234
    At the beginning just read it.
    Try {
    $_intMyRef = [int] (Get-Content .\ref.txt)
    Catch {
    Write-Host "The reference EventRecordID cannot be found." -ForegroundColor Red
    $_intMyRef = 0
    This is very lazy check. You can do a proper parsing etc... That's a quick dirty way. If I can read
    it and parse it as an integer, I use it. Else, I just set it to 0 meaning I'll collect all info.
    Then include it in your filter. You Get-WinEvent becomes:
    Get-WinEvent -FilterXml "<QueryList><Query Id=""0"" Path=""Security""><Select Path=""Security"">*[System[(EventID=4624 and EventRecordID&gt;$_intMyRef)]]</Select><Suppress Path=""Security"">*[EventData[Data[@Name=""SubjectLogonId""]=""0x0"" or Data[@Name=""TargetDomainName""]=""NT AUTHORITY"" or Data[@Name=""TargetDomainName""]=""Window Manager""]]</Suppress></Query></QueryList>"
    At the end of your script, store the last value you got into your ref.txt file. So you can for example get that info in the loop. Like:
    $Result += $LogonRecord
    $_intLastId = $Event.RecordId
    And at the end:
    Write-Output $_intLastId | Out-File .\ref.txt
    Then next time you run it, it is just scanning the delta. Note that I prefer this versus the date filter in case of the machine wasn't active for long or in case of time sync issue which can sometimes mess up with the date based filters.
    If you want to go for a date filtering, do it at the Get-WinEvent level, not in the Where-Object. If the query is local, it doesn't change much. But in remote system, it does the filter on the remote side therefore you're saving time and resources on your
    side. So for example for the last 30 days, and if you want to use the XMLFilter parameter, you can use:
    <QueryList>
    <Query Id="0" Path="Security">
    <Select Path="Security">*[System[TimeCreated[timediff(@SystemTime) &lt;= 2592000000]]]</Select>
    </Query>
    </QueryList>
    Then you can combine it, etc...
    PS, I used the confusing underscores because I like it ;)
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specifi

    [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
    An you help me with this error?
    This is the problemativ query:
    Search QUERY : SELECT DISTINCT theK_files.fileid, theK_files.name, theK_files.t
    itle, theK_files.description, theK_users1.name AS AuthorName, theK_users1.surn
    ame AS AuthorSurname, [theK_file-extensions].name AS Extension, theK_files.publ
    ished, theK_files.updated FROM theK_users INNER JOIN [theK_users-to-groups] ON
    theK_users.userid = [theK_users-to-groups].userid INNER JOIN theK_usergroups
    ON [theK_users-to-groups].groupid = theK_usergroups.groupid INNER JOIN [theK_g
    roups-to-files] ON theK_usergroups.groupid = [theK_groups-to-files].groupid INN
    ER JOIN theK_files ON [theK_groups-to-files].fileid = theK_files.fileid INNER
    JOIN theK_users theK_users1 ON theK_files.authorid = theK_users1.userid INNER
    JOIN [theK_file-extensions] ON theK_files.extensionid = [theK_file-extensions]
    .extensionid WHERE theK_users.userid = '1' AND theK_files.extensionid = '1' AN
    D ( theK_files.name LIKE '%a%' OR theK_users1.name LIKE '%a%' OR theK_files.de
    scription LIKE '%a%' )

    are these columns character/string/varchar:
    theK_users.userid = '1'
    theK_files.extensionid = '1'
    if these are number columns, change them to
    theK_users.userid = 1
    theK_files.extensionid = 1
    Jamie

Maybe you are looking for