Logic operations on a string of bits

Hi, I have a very simple question that I cannot seem to figure out.  I would just like to perform logic operations (AND, OR, etc.) on 2 strings of bits that are 24 bits long each, however I cannot find in the functions palette a function that acts as a binary constant.  I only see numeric constant and hex functions.  Can somone please let me know where I can find this.  For example, I would like to AND '111111111111111111111111' & '000000000000000000000000'.    
Solved!
Go to Solution.

I think that these bitwise operations should work directly on strings too. Thus I wrote up this idea.  
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Ignore logical operator in string

    I assign a string string to a variable var, then show the variable using $$var$$
    This works if the string is something like "Black White", and $$var$$ returns "Black White"
    However, if the string contains a logical operator like "and" or "or", then captivate sees it as a logical operator, and returns "false".  Therefore the string "Black or White" makes the variable return "false"
    I believe I need to put something in front of or around the logical operator so that it's ignored, like "Black */or/* White", or something like that, but I can't remember what.

    Still no concatenation in CP8 One of my old, old feature requests.
    Captivate doesn't know the difference between a string and a number.

  • How to apply different Logical operations to N.of Signals

    Hello all,
    Please help me if anyone have idea about this.
    I have “N” number of signals. I want to apply different Logical operations for this.
    For Example:
          (((SigA >= 30 && SigB <=55) || (SigC = 42)) && (SigD > 45))
    ((((SigD >= 89.25 && SigF <=55.568) ||(SigG = 156.89)) && (SigA >= 45)) || ((SigF – Sig A) >25))
    Here Conditions will change every time. User can input different conditions (like Excel calculations). I need to check signals as per these type of conditions. Is there is any tool kits available in LabVIEW / we need to develop?
    Currently I’m thinking about string manipulations to extract the each condition . Once first condition is finished then check this results with next conditions (so on..)
    Munna

    Hi GerdW,
    After long time again I stated doing this task. Could you please help me in this.
    As per my snippet, at 1st making array based on given String. From that string I need to check where open & closed brackets are coming to do logical operations.
    For Example: (2 OR ((1 AND 2) OR 3))
    Index
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    String
    2
    O
    R
    1
    A
    N
    D
    2
    O
    R
    3
    Please give me any idea/sample VI for the same.
    Here, 1,2 & 3 are Indices of Boolean 2D Array.
    Munna

  • Logical operations on different systemgroups

    Hi,
    I want to define several systemgroups in the transaction RZ21 on a central monitoring system. Afterwards I want to make logical operations on these groups (like: group1 and group2) in the monitor definition. Is this possible and in what way? I hadn't found hints on sap-notes.
    Greetings
    Christian Wosgien

    > I think you mixed up bit and binary datatype.
    > Binary datatype is normally used for images, text, storing a pdf in your db, etc
    I'm aware that's what they're usually used for (although I have thought varbinary would have been better)
    but I need to store lots of bit fields and  was hoping I could use a binary datatype, rather than have status1, status2, status3, etc
    > If you want 1 column to store multiple values using bitmasks, than you can use an integer to do that.
    > e.g. see examples in system tables like sysdatabases..status (small int) and sysdatabases..status4 (int)
    That's what we're using at the moment - if fact we're now using unisgned bigint - that gives 64 bits.
    The fact that sys* tables have multiple status fields shows it would be useful here.
    > Sybooks: The bitwise operators are a Transact-SQL extension for use with integer type data.
    > So it looks like you've got to use multiple columns to achieve wat you want.
    Yep - that's exactly what we've found.
    It seems unfortunate to not allow bitwise operations on binary datatypes. Its not a common use of them I know
    but I've worked at couple of places which would have benefited from this.
    We've spent some time writing our own functions that implement bitwise operations on binary fields, but would have been better if these were build in.
    > Why would you want to store 200 bitfields in 1 column?
    For a similar reason as the sys* tables have multiple status columns - If binary columns allowed bitwise operations - they'd only need 1 status field.

  • Logical operator 'like'

    I have a small query where I have to retrieve vendor details not including the vendors starting with '9'.
    I have written the below query for that.
    select b~lifnr  " Vendor number
         into corresponding fields of table gi_output_vendors
    from  lfa1
    where  lifnr   not like  '9%'.
    But the output I am getting contains vendor numbers '0000950000' where I wanted to eliminate these type of numbers also. i.e, I don't want to consider leading zeroes.
    So, the below code I have written for that.
    The problem is with if condition or delete statement  'like' logical operator is not being allowed.
    loop at gi_output_vendors into wa_output_vendors.
    shift wa_output_vendors-lifnr left deleting leading '0'.
    if wa_output_vendors-lifnr like '9%'   " didn't work delete gi_output_vendors from wa_output_vendors   where
                  lifnr like '9%'. "didn't work
    endif.
    endloop.
    When I use 'like' with 'if' condition or 'delete' statement, I am getting error saying that 'Like operator is not allowed'.
    How could I deal with this situation.
    Thanks in advance.
    Vishnu Priya

    If you can guarantee the 9 will always be in the same place then it would be better to use offset logic or something like 'lifnr NOT LIKE '00009'' - incidentally, I believe the % wildcard only replaces one character so '9%' will be looking for a 2 char string containing a 9 followed by ONE other character.  Using '9' will look for a 9 followed by any number of other characters. Since lifnr is a 10 char field (according to your example) '9%' will always fail. I would suggest using the Data Browser (SE11) selection screens to try out some of the possibilities and see what works.
    Hope that's of some help!
    Andy
    By the way, I wouldn't recommend using '9' becasue this will look for a 9 <b>anywhere</b> in the lifnr field i.e. it could exclude a perfectly valid number just because it ends in a 9!
    Message was edited by: Andrew Wright
    Sorry, ignore me, in SQL you should use % and not * for multiple characters.  However, the same applies if you can guarantee the position of the 9.
    Message was edited by: Andrew Wright

  • How to store logical operator in an array in java

    how to store logical operator in an array in java.
    Array should not be String type if i pass an element of that array it should be considered as logical operator

    my exact requirment is like this, i need some logic
    to convert string like this "2 Equals 3 AND 4 greater
    than 7" to condition like this
    2 == 3 && 4 >7 which i can pass to if
    condition.So you want to create an expression parser?
    No need for something as ugly as what you think you need, a simple nested conditional will do it for just the few logical operations.

  • How to use varaible in place of logical operator in query

    Hi Experts,
    How can we use a variable in place of logical operator (OR, AND) ?
    For ex:
    select * from sflight where carrid = 'LH' AND connid = 100.
    data x type string.
    x = 'AND'.
    Now, I want to replace AND with the variable x.
    Query will be:
    select * from sflight where carrid = 'LH'  x connid = 100.
    I am doing this because user can select any logical operator while creating the search criteria at run time .
    I already tried this but i am getting following compilation error:
    Error: Incorrect expression used in place of logical expression.

    hi,
    Check out this sample code
    Display of flight connections after input of airline and flight number:
    PARAMETERS: carr_id TYPE spfli-carrid,
                conn_id TYPE spfli-connid.
    DATA:       where_clause TYPE  STRING,
                and(4),
                wa_spfli TYPE spfli.
    IF carr_id IS NOT INITIAL.
      CONCATENATE 'CARRID = ''' carr_id '''' INTO where_clause.
      and = ' AND'.
    ENDIF.
    IF conn_id IS NOT INITIAL.
      CONCATENATE where_clause and ' CONNID = ''' conn_id ''''
        INTO where_clause.
    ENDIF.
    SELECT * FROM spfli INTO wa_spfli WHERE (where_clause).
      WRITE: / wa_spfli-carrid, wa_spfli-connid, wa_spfli-cityfrom,
               wa_spfli-cityto, wa_spfli-deptime.
    ENDSELECT.
    Regards,
    Santosh

  • Regular expression evaluation with logical operator

    Hi All,
    I am bit confuse with expression evaluation with logical operator. I am trying to understand below expression.
    eXa.getTrue() && eXa.getFalse() || eXa.getFalse() && eXa.getTrue() || eXa.getFalse() comes as false and True Count: 1 False Count: 3
    As per understanding it should be true with True Count: 1 False Count: 3
    it should execute 1st getTrue() and then 1stGetFalse() and then 2nd getfalse() and should skip 2nd getTrue() and execute 3rd fetFalse()
    eXa.getTrue() && eXa.getTrue() || eXa.getFalse() && eXa.getTrue() || eXa.getFalse() comes as true and True Count: 2 False Count: 0
    As per understanding it should be true with True Count: 3 False Count: 0
    it should execute 1st 2 getTrue() and skip 1st getFalse() and then execute 3rd getTrue() and skip last getFalse().
    eXa.getTrue() || eXa.getFalse() && eXa.getFalse() || eXa.getTrue() && eXa.getFalse() comes as true and True Count: 1 False Count: 0
    As per understanding it should be true with True Count: 2 False Count: 2
    it should execute 1st getTrue() and skip 1st getFalse() and then execute 2nd getFalse() and then execute 2nd getTrue() and then 3rd getFalse()
    Please help me to understand above expressions.
    Here is the methods definition:
    private boolean getTrue() {
              trueCount++;
              boolean retrunValue = 4 > 3;
              return retrunValue;
    private boolean getFalse() {
              falseCount++;
              boolean retrunValue = 3 > 4;
              return retrunValue;
    Thanks for ur help

    >
    adding parenthesis to make order of ops more obvious. adding "?" to show un-executed calls.
    (eXa.getTrue() && eXa.getFalse()) || (eXa.getFalse() && eXa.getTrue()) || eXa.getFalse()  comes as false and True Count: 1 False Count: 3
    (T && F) = F
    (F && ?) = F
    (F) = F
    F || F || F = F
    (eXa.getTrue() && eXa.getTrue()) || (eXa.getFalse() && eXa.getTrue()) || eXa.getFalse()  comes as true and True Count: 2 False Count: 0
    (T && T) = T
    (? && ?) = ?
    (?) = ?
    T || ? || ? = T
    eXa.getTrue() || (eXa.getFalse() && eXa.getFalse()) || (eXa.getTrue() && eXa.getFalse())  comes as true and True Count: 1 False Count: 0
    (T) = T
    (? && ?) = ?
    (? && ?) = ?
    T || ? || ? = T

  • A quick question  of Logical Operator - NOT?

    I know that the logical operator for NOT is " ! " sign.
    But someone could please tell me how do I use the NOT operator in the below code.
    if (c instanceof JLabel) Thanks

    Before you use this, think long and hard if there's a better way to
    achieve your goal than wandering through all of a panel's
    components checking for those that aren't JLabels.
    import javax.swing.*;
    public class Not {
         public static void main(final String[] argv) {
              final JComponent panel = new JPanel();
              if (!(panel instanceof JLabel)) {
                   System.out.println("It works.");
    }

  • Does bitwise operation on boolean datatypes work like logical operation ?

    Does bitwise operation on boolean datatypes work like logical operation ?
    For example, in the following code, how is each bitwise operation (say) 'b1 & b2' evaluated ?
    1) by converting the values of b1 (true) and b2 (false) to binary and doing '&' on them OR
    2) just treating it as a logical operation (i.e. similar to &&) where both have to be equal to be true
    Also, does the outcome of the if condition need to result in a 'true' or 'false' for the relevant message to print ? ....... Just fyi, I tried out this program and it goes to condition 2 but I do not understand why.
    class SSBool {
    public static void main(String[] args) {
    boolean b1 = true;
    boolean b2 = false;
    boolean b3 = true;
    if (b1 & b2 | b2 & b3 | b2)
    System.out.println ("condition 1");
    if (b1 & b2 | b2 & b3 | b2 | b1)
    System.out.println ("condition 2");
    Thank you,
    AG

    The Java Tutorial (always my first stop if I need an answer) says :
    "When both operands are boolean, the operator & performs the same operation as &&."
    That your program goes to condition 2 is obvious because the last test in the if-clause if (b1 & b2 | b2 & b3 | b2 | b1) looks at b1 which is true...

  • Logical Operations in SQL decode function ?

    Hi,
    Is it possible to do Logical Operations in SQL decode function
    like
    '>'
    '<'
    '>='
    '<='
    '<>'
    not in
    in
    not null
    is null
    eg...
    select col1 ,order_by,decode ( col1 , > 10 , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 , <> 10 , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 , not in (10,11,12) , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 ,is null , 0 , 1)
    from tab;
    Regards,
    infan
    Edited by: user780731 on Apr 30, 2009 12:07 AM
    Edited by: user780731 on Apr 30, 2009 12:07 AM
    Edited by: user780731 on Apr 30, 2009 12:08 AM
    Edited by: user780731 on Apr 30, 2009 12:08 AM
    Edited by: user780731 on Apr 30, 2009 12:09 AM

    example:
    select col1 ,order_by,case when col1 > 10 then 0 else 1 end
    from tab;
    select col1 ,order_by,case when col1 &lt;&gt; 10 then 0 else 1 end
    from tab;
    select col1 ,order_by,case when col1 not in (10,11,12) then 0 else 1 end
    from tab;As for testing for null, decode handles that by default anyway so you can have decode or case easily..
    select col1 ,order_by,decode (col1, null , 0 , 1)
    from tab;
    select col1 ,order_by,case when col1 is null then 0 else 1 end
    from tab;

  • Nqs error 59001: Binary logical operation error in OBIEE 11g

    Hi,
    Requirement: Need to calculate YTD for invoiced amount and Prior YTD for invoiced amount and last year total invoiced amount.
    Logic we used: For YTD Invoiced amount we used “Year To Date” time series function in rpd.
    For Prior YTD we used “Ago function on Calculated YTD column”.
    For Last Year Invoiced amount we used “ CASE function and dynamic variables” as:
    CASE WHEN year=valueOf(previous_year) THEN invoiced_amount END;
    Now, when I’m creating a report, I’m getting the following error as:
    *[nQSError: 43119] Query Failed: [nQSError: 59001] Binary Logical operation is not permitted on VARBINARY, INTEGER operand(s). (HY000)*
    Please help me to solve this, i need to release the instance by EOD

    Hi,
    As per my understanding the ValueOf(previous_year) is double precesion so it wont allow to use binary logical operator.Change to integer becos we can manage year with interger data type.
    [nQSError: 59001] Binary Logical operation is not permitted on DOUBLE PRECISION, VARBINARY operand(s).
    mark if helpful/correct
    thanks,
    prassu

  • How do I download after changing my operating system from a 32 bit to a 64 bit system?

    I changed my operating system from a 32 bit to a 64 bit system and I need to re-purchase or trade my purchase for a different download -fridayjunior

    Hi fridayjunior,
    Which Adobe software are you trying to install?
    All 32 bit applications are compatible and can be installed on a 64 bit machine.

  • Logical Operator list to end users

    Hi,
    Is there any way that we can provide Logical operator also in the filter/prompt, for the end user in WebI on top of a SAP BW universe?
    Ex: User has to select a logical operator(like <,<=,>,>=,= etc) and value for a 'Net Due Date' filter
    Tried searching the forum, but did not get the proper work around.
    Thank you in advance.
    ---Veera

    are you talking about adding filters in webi reports?
    i think its easy,
    just in the query itself you can add filter and make it as prompt.
    but you have to select the operator, case this is something you have to do into the query itself.
    users can not do this when they are running the report.
    but there is another option which is "Quick Filter" in there users can add quick filters and select operators as they like.
    good luck

  • Logical Operator list t oend users

    Hi,
    Is there any way that we can provide Logical operator also in the filter/prompt, for the end user in WebI on top of a SAP BW universe?
    Ex: User has to select a logical operator(like <,<=,>,>=,= etc) and value for a 'Net Due Date' filter
    Tried searching the forum, but did not get the proper work around.
    Thank you in advance.
    ---Veera

    Hi,
    Yes it is possible.
    Here is a sample based on @CALYEAR characteristic
    <FILTER KEY="@Select(Calendar Year\L01 Calendar Year).[TECH_NAME]">
    <CONDITION OPERATORCONDITION="@Prompt('Select operator','A:A',{'Equal':'Equal','Not Equal':'NotEqual','Greater':'Greater','Less':'Less','Greater or Equal':'GreaterOrEqual','Less or Equal':'LessOrEqual'},mono,primary_key,persistent,{'Equal':'Equal'})">
    <CONSTANT TECH_NAME="@Prompt('Select year','A','Calendar Year\L01 Calendar Year',Mono,Primary_Key,Persistent)"></CONSTANT>
    </CONDITION></FILTER>
    Here is the prompt definition you have to create instead of a static value for the OPERATORCONDITION:
    @Prompt('Select operator','A:A',{'Equal':'Equal','Not Equal':'NotEqual','Greater':'Greater','Less':'Less','Greater or Equal':'GreaterOrEqual','Less or Equal':'LessOrEqual'},mono,primary_key,persistent,{'Equal':'Equal'})
    Regards
    Didier

Maybe you are looking for