How to search for specific match from an array?

Hi Mike,
Thanks for the reply.
I am reading a position of switches whether ON/OFF. It is nothing but the digital inputs status from the field. I am Indexing that array, and connect it to the LED indicators to show the relevant status. Also I want to raise an alarm  once, for the ON switches.  By using Search 1D array, I got the first TRUE match index from the array. But if I want to know all the occurrences of ON condition (TRUE from an array of booleans) from an array of switches. How to do that?
Hope this clarifies.
Thanks
Kousy

I almost missed this message because you started a new thread.
In any case, the code altenbach posted will give you an array of the indexes that are set to true. So it sounds like that is at least part of what you want. The alarm you mention, is that one "master" alarm if any of them are true, or is it a separate alarm for each bit?
If it is one "master" alarm for all of them the logic menu has a function for ORing all the elements in a boolean array. Also when you say "alarm" what is the nature of this alarm? A dialog box? a flashing light (real or on the applications's front panel)? message in a status display?
The attached code shows one possible direction by adding onto altenbachs code the ability to accumulate a single error message based on the states of individual bits. (BTW: The other alternative that you might see would be to pass the array into a loop and use a case to append a message of the bit is true. The advantage of the one in the combined VI is that the loop only iterates for the number of true bits +1. Where as the other approach would have to look at all the bits one at a time.)
In a sense this is why I asked for clarification because there are a lot of things you can do when parsing an array like this.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Attachments:
TRUEadditions.vi ‏31 KB

Similar Messages

  • How to SEARCH for specific file TYPES, e.g. PDF?

    If I know the title has in it "resume" and I know it's a PDF, how do you search for all PDF files that have the word "resume" in the title?
    AND..
    How would you search all PDF files that had the word "supervisor" inside the document?
    Thanks

    Command F should do it. Once the search window appears, you should see a drop down box headed kind and next to it one headed any. Select PDF from the any one. Click the plus button, and another field will appear and you can see again more drop down boxes. You just want to set these up so you end up with name and contains, you can then add your text to the remaining field.
    Also see [this|http://apps.tempel.org/FindAnyFile/index.html]
    Message was edited by: gumsie

  • How to Search for Collab Documents from Specific Collab Projects

    I am looking for some sample code that will use the portal Remote Search API to query for documents in Collaboration Server Only.
    I have a specific group of projects that I need to query. I can gather these in an Array --> IProjects[].
    The Collaboration Server Search portlet appears to have this capability already but I have to do it in a custom portlet.
    Thanks in advance.
    Phil Orion
    Orion like the constellation, not the Irish guy..

    Bump- Any takers --on this question?
    How about does anyone have any sample code to simply query for collab documents...
    Edited by: PhilOrion on Jul 3, 2010 5:28 PM

  • How to search for a matching string

    <cfcatch>
    <CFMAIL to="[email protected]" From="[email protected]"
    Subject="Error message" Type="HTML">
    #cfcatch.message#
    </CFMAIL>
    </cfcatch>
    I need to create a condition based on the string in the
    message, if #cfcatch.message# is "The element at position 12 of
    dimension 3 can not be found" I need to deliver certain message
    through email BUT if #cfcatch.message# is matching other
    sentence I need to deliver a different message.
    I used the following condition (see below) but it somehow did
    not work, even when I know for sure the error message is saying the
    right think, for example, "The element at position 12...etc"
    Is there a way to do this differently or have I done it wrong
    somewhere?
    <cfif #cfcatch.message# EQ "The element at position 12 of
    dimension 3 can not be found">
    Deliver message 1
    cfelse>
    Deliver message 2
    </cfif>

    Why not catch a specific error type?
    <cftry>
    <cfthrow type="foo.bar.custom" message="anything you want
    to say!">
    <cfcatch type="foo.bar.custom">
    Do something special here!
    </cfcatch>
    <cfcatch type="Any">
    An Unknown error has occured!
    </cfcatch>
    </cftry>
    If you're not sure of the error that is being thrown, dump
    the cfcatch and grab the first part of the stack trace and then
    recode using that error type in your cfcatch block.
    Here's an example of catching an invalid file format upload
    with cffile.
    <cftry>
    <cffile action="upload" destination="#pathInfo#"
    fileField="imagefile" nameconflict="makeunique" accept="image/jpg,
    image/jpeg, image/png, image/eps, image/tif, image/gif,
    application/pdf" >
    <cfcatch
    type="coldfusion.tagext.io.FileTag$InvalidUploadTypeException">
    Invalid File Type
    </cfcatch>
    </cftry>

  • Spotlight: How to search for specific file types?

    Hi. I'm looking for bookmarks that may contain a particular word. Is there a way to filter my spotlight (or finder) searches just for a particular file type? I know you can sort results by file type, but it's rather just filter in the first place...

    Command F should do it. Once the search window appears, you should see a drop down box headed kind and next to it one headed any. Select PDF from the any one. Click the plus button, and another field will appear and you can see again more drop down boxes. You just want to set these up so you end up with name and contains, you can then add your text to the remaining field.
    Also see [this|http://apps.tempel.org/FindAnyFile/index.html]
    Message was edited by: gumsie

  • HT204266 how to search for a specific app eg tetris in the app store?

    Hi is there anyone that can please help me on how to search for a specific app eg tetris in the app store? Thanks

    Hi Friend,
    You just write down the name of the app or for what the app is used for (eg, write down Notes and then will appear a lot of options), then download what you wish.
    Hope it will be helpful

  • When I am searching for any particular song or album from my shared ITUNES folder, the search is conducted  in the apple store and not on the shared library. How to search for the song in the shared library

    I am using IPAD Mini.When I am searching for any particular song or album from my shared ITUNES folder, the search is conducted  in the apple store and not on the shared library. How to search for the song in the shared library

    Search for shared library is impossible, as far as I know.  Searches supported - are local and internet.

  • I have a iphone 5. How do I search for a event from 2013 under search? I do have "all events" selected

    I have a iphone 5. How do I search for a event from 2013 under search? I do have "all events" selected

    I would check, but I believe I have read that the calendar only lets you search back in the current year. You might find additional information about that in the User Guide. http://manuals.info.apple.com/MANUALS/1000/MA1565/en_US/iphone_user_guide.pdf
    What happens if you go back to a month in 2013, do you see a date with any events in it? I'm not saying the calendar is deleting data, just that you cannot search earlier than the current year.

  • How To Search For a Specific File name?

    Hello Everybody
    How To Search For a File Like NewFile.txt in a Root Like C:\\
    And If The File Is Found Open It And Write In It?

    http://forum.java.sun.com/thread.jspa?threadID=5194090&messageID=9763314

  • How to search for file in jsp page

    i need help on how to search for a file in a folder where there is a lot of subfolder.like how u search in a document in windows. i need a complete codes in jsp page.
    thank you in advance.
    Message was edited by:
    n_dilah

    no i need to do a search engine in jsp page which is the j2ee.
    i type smth than tat file from any folder will appear the same way when u need to search your file in a document in windows.
    well can u nice people tell me where i can get the codes bcos i stinks when it come to programming.
    thank you very very very much.

  • How To Search For a Text In JTable Column?

    hi there
    i want to search for specific text in a JTable Column
    And If The Text Exists Highlits it?
    any ideas or useful links or tutorials?

    Well, then that would be a Swing related question. Did you search the Swing forum to see how rendering works.

  • How to search for a badi

    how to search for a badi
    srinivas.

    Hi Srinivas,
    Good
    Check this link
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    Run this program
    *& Report ZNEGI16 *
    REPORT ZNEGI16 .
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.
    Solution 2
    1.Get the Package of the program name of the transaction.
    2.Go to Transaction SE18.
    3.Press F4 on the badi definition name.
    4.Click the information systems button.
    5.Give the Package name and press enter.
    6.Select the BADI that is relevant to the application.
    Good Luck and thanks
    AK

  • How to search for password policy

    Hello,
    Using DS 5.2:
    I've created a test policy, dn: cn=Test Policy,ou=People, o=xxx, o=isp. I can apply the policy, I can see the policy in my backup ldifs, but I can't figure out how to search for and display it (and eventually, delete it) either from the command line using ldapsearch or form within the admin gui. Any help?

    What I would like to do is query my 8i instance for the current password policy
    Can anyone provide a query to retrieve this info?connect as sys
    in Oracle 8i and issue the command;
    select object_name,object_type from all_objects where object_name like '%PASS%';
    and
    select object_name,object_type from all_objects where object_name like '%POLICY%';
    I think , i'm not sure these policies would be transfered to 10g through migration except -if any- some of them are obsolete to 10g!!!!!
    Regards,
    Simon

  • How to search for a particular pattern in a string

    Hi,

    Hi ,
    How to search for a particular pattern in a string?
    I heard about java.util.regex; and used it in my jsp program.
    Program I used:
    <% page import="java.util.regex"%>
    <% boolean b=Pattern.matches("hello world","hello");
    out.println(b);%>
    I run this program using netbeans and am getting the following error message.
    "Cannot find the symbol : class regex"
    "Cannot find the symbol : variable Pattern "
    How to correct the error?

  • How to search for array in another array ?

    i want to search for array in another and when i got this array i want to take the next 5 bits  EX: array1 [ 4 8 7] , array2 [ 9 1 4 8 7 6 3 2 ] , output array [ 6 3 2 9 1]
    Thanks  

    I know we should be encouraging others to help them selves, but I had a solution that I think is what the user wants.  Attached is a VI that searches for a subarray in an array, and will return the index it is found at.  It will also return the input array, filtered if a match is found.  This VI just handles the double data type.
    Most of the code comes from an old post by Altenbach that I can't seem to find at the moment, but I saved a copy a while ago.  Props to him for posting it.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    Filter Subarray - DBL.vi ‏18 KB

Maybe you are looking for