String equal?

I have an instrument that communicate with the PC via RS232. So I use VISA write, read...

It works OK, but have the following problem

I want to compare two strings, one is constant other out by VISA read. If I use the indicator, this is the show "hexagonal"(par exemple 3E04 4B73) the value of VISA, but if I use the same wire to the 'equality?' to compare two strings is strange... return values ".

We see them all together to see what my problem is:

A string is an array of bytes interpreted as text characters.

If the string that appears as '3E04 4B 73' mode normal consists of the characters '3' ASCII '0' ' E' '4' '' '4' 'B' '7' '3 '. The hexadecimal values in the ASCII characters are "3345 3034 2034 4237 33.  ASCII 3 = 33 hex.  ASCII E = 45 hexagonal.

If you want to type in the hexadecimal values to a control of the chain or the constant, you must assign to the hex display.

To see what is in a thread of string in a string to the conversion of primitive bytes and the wire table then said to a table indicator output.  This will show the numerical values of each byte of the string.  You can set the digital display to decimal, hexadecimal, octal, or binary.

Lynn

Tags: NI Software

Similar Questions

  • String equals and == difference...

    Hi all

    According to my understanding is equal to string corresponds to the string value and 'is' corresponds to objects represented on each side of the operator. but I saw a strange behavior while playing with these String API.

    class StringTest1
    {
    Public Shared Sub main (String [] args)
    {
    Ja string = "Ja".
    String's = "go";

    Java2 string = "Java";
    String java1 = ja + is going;
    String java1 = "Java";

    System.out.println ("is equal to:" + (java1.equals (java2)));
    System.out.println ("==:" + (java1 is java2));
    }
    }

    For the code above I get the output as 'true' for the first and 'false' for the second expression. output equal to equal is fair enough, but for the operator "is" its fake giving that according to my thinking should be true as says the chain worn No. TWO CHANNELS WITH SAME VALUES funda.
    Among the 2 variables java2 is a string 'Java' and java1 is the result of the concatenation smthing like 'Ja' + 'goes '.

    I tried to do something like
    System.out.println ("obj1:" + java1.hashCode ());
    System.out.println ("obj1:" + java2.hashCode ());
    BTU that returns the same value.

    Please help me understand how is the expression be false for "is".

    Published by: 807216 on May 10, 2011 02:20

    For comparison, try to "ja" and "goes" final.

    final String ja = "Ja";
    final String va = "va";
    
    String java2 = "Java";
    String java1 = ja + va;
    //String java1 = "Java";
    
    System.out.println("equals: " + (java1.equals(java2)));
    System.out.println("==: " + (java1 == java2));
    

    prints

    equals: true
    ==: true
    

    This is because "ja + is going" is a constant expression and can be evaluated by the compiler.

  • String.startsWith, method behaves like the method String.equals

    Hello

    I work through the assignment of the Java Servlets and JSP, and told me to use a simple iterator method and startsWith. This bit is not part of the assignment as they write it for you, but it does not work for me.

    Grateful for any help, I'm not cheat my assignment because it comes to Servlets and JSP, and I'm not marked on this part.

    Here is my results using System.out during an iteration through my loop.

    Green home starts with the Green House
    the Pink House does not start with the Green House
    the Blue House does not start with the Green House
    the Pink House is bigger that the Pink House does not start with the Green House
    the Green House is bigger that the Pink House does not start with the Green House
    the Green House is bigger that the Green House does not start with the Green House
    the Green House is bigger that the Red House does not start with the Green House
    the Blue House is bigger that the Pink House does not start with the Green House


    My table list is built like this: -.

    searchPrompts = new ArrayList < String > ();
    searchPrompts.add ("the Green House");
    searchPrompts.add ("the Blue House");
    searchPrompts.add ('pink house');
    etc.


    and my loop is less and does not compile if I throw the (String): -.

    int countMatches = 0;
    for (Iterator it = searchPrompts.iterator (); it.hasNext () & & countMatches < = 5 ;))
    {
    String aPrompt = (String) it.next ();
    If (searchString.StartsWith (aPrompt))
    {
    System.out.println (aPrompt + "begins by" + searchString);
    matchingPrompts.add (aPrompt);
    countMatches ++;
    }
    on the other
    {
    System.out.println (aPrompt + "does not begin by" + searchString);
    }
    }

    Your code says:

    If one starts with B, then print "B starts with a.

    Until your prints claims is put trial is not actually what is being tested.

  • Sort a table of strings [problem]

    Well, im pretty new in the java development and app, I used to make games using AS3 and now I am with my teacher in certain BlackBerry applications.

    The thing is I can't sort an array of string, I looked around and I noticed that I need to make a comparison.

    I want to sort an array of XML that will be used on a drop-down list. How can a comparator and use it?

    Easy PS:go on me, im really new ^^

    Which part of this is a problem with? Looks like things fairly straigh-forward.

    You write a class that implements the comparison. You have two methods to implement, compare() and equals(). Each method is passed two objects. It is the responsibility of your application to prvide the good performance based on the two objects.

    Since your comparator compares strings, you have already integrated routines to compare.

    String.compareTo)

    and

    String.Equals)

    In both cases, you can simply return the value of the construction compared with chains.

    See the javadocs for comparator, String, and SimpleSortingVector

    Work on it a bit and come back with a more specific question.

  • How to write &lt; Cntrl &gt; Z to the port

    For surgery, I want to write Z on the port. Kindly tell me what I should write.

    I send ^ Z, but it does not work.

    Thank you

    Have a look here

    http://zone.NI.com/reference/en-XX/help/371361B-01/lvhowto/backslash_codes_display/

    Set your string '-' display mode of the Codes. 26 is 1A in hexadecimal, and then type in hello\1A will give you a string equals HelloZ. A common mistake that I did several times is to type in hello\1A and do NOT use the '-' display mode of the Codes. Which cost several hours of debugging. So be 100% constant/control of the chain is in '-' Codes display mode

  • TCL Script work until it gets recorded

    Hello!

    I'm fumbling my way through TCLtrying to meet a need.

    I had an EEM script that would daily pull into a file via TFTP and apply the content of this file. It's the different ACL update daily automatically. It worked well except that every day, he created a version of config, meaing my off the Strip frames and my LMS withdrew in a new copy of the configuration of all day even when nothing has really changed, but the ACL file has been updated. The most effective use of resources.

    I created a TCL script that does the following. Takes an argument passed, uses to create a path, and download a Flash file.

    He MD5s queue and compares it to the eve of the downloaded file's MD5. If the MD5s are equal, does nothing and quit unexpectedly. If they are different, the commands in the file are applied and removed in flash.

    The script works very well using tclsh:

    VID - RTR # tcltest.tcl VID - ACL.txt
    VID - ACL.txt

    VID - RTR #.
    23507465: 16:55:12.669 on April 26: signature of downloaded file ACL is identical to the previous. No changes. Deletion of source file

    I'm trying to save the script and most of the commands does not work. More specifically, the exec commands. I managed to get the hourly part of it worked to test, I used this:

    : cisco::eem:event_register_none

    What I've read, to do with the script being not approved and running in Safe-TCL mode. I ask for help. How can I convert this script in a script which will be executed via cron per day and get the same results?

    Define ACLFile «»
    Set oldmd5 «»

    If {$: argc > 0} {d
    Set ACLFile $argv
    } else {}
    does 'No success of ACL, outgoing Filename'
    breaking
    }

    puts $argv

    exec "enable."
    exec ' copy tftp://192.168.101.179/$ACLFile flash:

    If {[file exists "flash: $ACLFile ']} {}

    } else {}
    puts "file not downloaded, an abortion!"
    breaking
    }

    If {!} [There is file 'flash: md5old.txt']} {}
    Define sysout [open "syslog:" 'w']
    puts $sysout {file not found, variable settting = 0}
    close $sysout
    Set oldmd5 "0".
    } else {}
    set fin [open "flash: md5old.txt' 'r']
    Set oldmd52 [read $fIN]
    Set oldmd5 [string trim $oldmd52]
    close $fIN
    }

    the value fo [open "flash: md5old.txt' 'w']
    adjust the input setting [exec "check /md5 flash: $ACLFile ']
    All RegExp - nocase {= ([a-f0-9] {32})} $input matched md5
    #puts ' NewMD5: ^ $md5 ^ '.
    puts $fo $md5
    close $fo

    If {[string equal $oldmd5 $md5]}}
    Define sysout [open "syslog:" 'w']
    puts $sysout {ACL downloaded signature file is the same as the previous one.} No changes. Deletion of source file}
    close $sysout
    exec "delete flash: $ACLFile.
    } else {}
    Define sysout [open "syslog:" 'w']
    puts $sysout {file ACL found updates. Applying the config and removing the file source...}
    exec ' copy flash: running-config $ACLFile.
    exec "copy run start".
    close $sysout
    exec "delete flash: $ACLFile.
    }

    This command is interactive.  Then you need to either set "fast file calm" or interact with the guests using cli_read_pattern and cli_write.

    cli_write $cli (fd) ' copy tftp://192.168.101.179/$ACLFile flash:

    cli_read_pattern $cli (fd) '192.168.101.179 '.

    cli_write $cli (fd) '\r '.

    ...

    Essentially, repeat using cli_write and cli_read_pattern on the lookout for trends in the guests that you get by doing the command manually until you return to the EXEC prompt IOS.

  • Analysis of chain


    Use String.equals. == only who controls a * object * is identical to the other (that is to say, by its address), not necessarily that the * content * of these objects are identical.

  • Filter the table break corresponding to the part of the column

    Hello

    JDeveloper Version 11.1.2.4.0.

    I have a table with a filter. I need to make this filter to do the following:

    select column1 from table where upper(column1) like upper ('%filterValue%')
    

    (If in the column, I have a name of "Christopher" and I look in the filter of "Frank" I want the line with Christopher is put into correspondence.)


    I have replace the getCriteriaItemClause like this:

        public String getCriteriaItemClause(ViewCriteriaItem vci) {
            if (vci != null) {
                AttributeDef attrDef = vci.getAttributeDef();
                String attrName = attrDef.getName();
    
    
                if ("java.lang.String".equals(attrDef.getJavaType().getName()) && vci.getValue() != null) {
                    String colName = vci.getViewCriteria().isCriteriaForQuery() ? vci.getColumnNameForQuery() : attrName;
                    String filterVal = (String)vci.getValue();
    
    
                    String sql = "(UPPER(%s) like UPPER('%s%%'))";
    
    
                    String clause = String.format(sql, colName, filterVal);
                    System.out.println(" The view criteria is overriden to: " + clause);
                    return clause;
                }
            }
            return super.getCriteriaItemClause(vci);
        }
    

    The display criteria replaced: (UPPER (Person.LAST_NAME) as UPPER ("Franck%%'))

    I tried to do the SQL string to be ' (UPPER (%s) as SUPERIOR ('%%%')) ", but it does not work and gives me very strange and unexpected results.").


    Kind regards

    Pamela

    Is not you the problem in how you build the qry sql? Have you tried something like:

            String qwe = "Hello";
           

    String xyz = "upper('%"+qwe+"%');";

    It prints "upper ('%hello%');", which is what you want. Right?

  • Currently logged-on user in Identity Manager Application

    I have a scenario where you need to capture the currently connected users in User Manager Application of identity so that when the user makes a change (right system UNSAccountBInUNSGroupB) is changed, I can connect this to a new Custom table.

    How to capture the currently logged on user name?

    If it is a component, you can try to use a global function GetUser()

    something like this:

    sqlcompare ("uid_person", GetUser (), "String", "Equal", "none")

    Web designer looking for GetUser() which should show you other examples of this use.

  • Custom converter does not not in ADF

    Hi gurus,

    I use Jdeveloper 11.1.1.7.0 (Build JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493) and try to create a simple custom converter to convert the string to uppercase.

    I can see out of PON show uppercase value, but the value is not rendered in the user interface.

    Steps to follow:

    1 create the converter of java class called UpperConverter

    2 register in faces-config. XML

    3 set the property of af: inputText as below

    < af:inputText value = "#{bindings." TestName.inputValue}.

    label = "#{bindings." TestName.hints.label}.

    required = "#{bindings." TestName.hints.mandatory}.

    columns = "#{bindings." TestName.hints.displayWidth}.

    maximumLength = "#{bindings." TestName.hints.precision}.

    shortDesc = "#{bindings." TestName.hints.tooltip}"id ="it1.

    immediate = "true" autoSubmit = "true" >

    < f: validator binding = "#{bindings." TestName.validator} "/ >"

    < / af:inputText >

    package xx.oracle.apps.fnd.custom.view.converters;

    to import java.util.Collection;

    import java.util.Collections;

    javax.faces.component.UIComponent import;

    Import javax.faces.context.FacesContext;

    javax.faces.convert.Converter import;

    Import org.apache.myfaces.trinidad.convert.ClientConverter;

    / public class UpperConverter implements converter, {ClientConverter}

    public UpperConverter() {}

    Super();

    }

    public String getClientLibrarySource (FacesContext facesContext) {}

    Returns a null value.

    }

    public Collection < String > getClientImportNames() {}

    Return Collections.emptySet ();

    }

    public String getClientScript (FacesContext facesContext,

    UIComponent uIComponent) {}

    Returns a null value.

    }

    public String getClientConversion (FacesContext facesContext,

    UIComponent uIComponent) {}

    Returns a null value.

    }

    public getAsObject (FacesContext facesContext Object,

    UIComponent uIComponent, String string) {}

    System.out.println ("value GetAsObject:" + string);

    If (!) (String.Equals (null)) | (chaîne == ""))) {

    System.out.println ("GetAsObject convert value:" + string.toUpperCase ());

    return string.toUpperCase ();

    }

    Returns a null value.

    }

    public String getAsString (FacesContext facesContext,

    UIComponent uIComponent object object) {}

    System.out.println ("value of GetAsString:" + object.toString ());

    Return object.toString () .toUpperCase ();

    }

    }


    Enjoy all the entries.


    Kind regards

    Ferrere

    Hello

    I don't see the converter applied to the inputtext. I was expecting the inputtext will be like:

    
                
               
              
    
  • Database of flashback through RMAN (10 g)

    Hi all;

    How can get a rear base using database of flashback (rman) in 10 g.

    SQL > select current_scn, to_char (SYSTIMESTAMP, "YYYY-MM-DD HH24:MI:SS) database v$.

    TO_CHAR (SYSTIMESTAM CURRENT_SCN

    ----------- -------------------

    1153432 2014-05-25 00:07:35

    SQL > select * from tab;

    TNOM TABTYPE CLUSTERID

    ------------------------------ ------- ----------

    TAB6 TABLE

    TABLE TAB1

    TABLE TAB2

    SQL > delete from tab2.

    2048 deleted rows.

    SQL > truncate table tab1;

    Table truncated.

    SQL > drop table tab6.

    Deleted table.

    SQL > commit;

    Validation complete.

    SQL > conn / as sysdba

    Connected.

    SQL > drop user cascade of sam;

    Deleted user.

    SQL > shutdown immediate;

    The database is closed.

    The database is dismounted.

    ORACLE instance stops.

    SQL > bootable media.

    ORACLE instance started.

    Total System Global Area 465567744 bytes

    Bytes of size 1274308 fixed

    96472636 variable size bytes

    364904448 of database buffers bytes

    Redo buffers 2916352 bytes

    Mounted database.

    SQL > exit

    Disconnected from the database to Oracle 10 g Enterprise Edition Release 10.2.0.5.0 - Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    [oracle@oel5 ~] target rman $ /.

    Recovery Manager: Release 10.2.0.5.0 - Production on Sun may 25 00:10:21 2014

    Copyright (c) 1982, 2007, Oracle.  All rights reserved.

    connected to target database: ORCL (DBID = 1373939619, is not open)


    RMAN > FLASHBACK DATABASE TO TIME timestamp ('2014-05-25 00:07:35 ');

    RMAN-00571: ===========================================================

    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.

    RMAN-00571: ===========================================================

    RMAN-00558: error occurred during parsing of order entry

    RMAN-01009: syntax error: found 'identifier': expected an a: 'double-quoted-string, equal, single-quoted-string '.

    RMAN-01008: the bad ID was: timestamp

    RMAN-01007: in the file column 28 line 1: entry standard

    Recovery Manager: Release 10.2.0.5.0 - Production on Sun may 25 00:10:21 2014

    Copyright (c) 1982, 2007, Oracle.  All rights reserved.

    connected to target database: ORCL (DBID = 1373939619, is not open)

    FLASHBACK DATABASE IN TIME ' TO_DATE ('2014-05-25 00:07:35 ',' YYYY-MM-DD HH24:MI:SS') ";

  • How to get the return values by a button on the main program.

    Hello

    I have a main program that has an Authenticate button. Click to authenticate open for auth form that has the USERNAME and PASSWORD FIELDS.
    If the input fields are true then enable editing of jtable in main program...

    Basically something like this:
    main program
    Authenticate.addActionListener (new ActionListener()
    {
    public void actionPerformed (ActionEvent ae)
    {
    Au UpdateAuth = new UpdateAuth(); / / Opens the form that has the username and pass for authentication
    ua.setVisible (true);

    need code for activation of table here
    if(s=="mactus")
    {
    enable editing of the table
    }
    table.repaint ();
    }

    });


    form opened for auth... (class UpdateAuth)

    private String SigninMouseClicked (java.awt.event.MouseEvent evt) {}
    String aname = Aname.getText ();
    String apass = Apassword.getText ();
    If (aname. Equals("") & & apass.equals(""))
    {
    JOptionPane.showMessageDialog (null, "enter the login name or password", "Error", JOptionPane.ERROR_MESSAGE);
    }
    If (!) (Aname.Equals("")) & & apass.equals("")))
    {
    If (aname. Equals("harshil") & & apass.equals ("harshil123"))
    {
    String s = "mactus"; If the user name and password is success enable editing in table in the main program
    return s;

    }
    else if (! aname.equals ("mactus") & &! apass.equals ("mactus123"))
    {
    Aname.setText("");
    Apassword.setText("");
    }
    }
    Returns a null value.
    }

    String.Equals (String)

    String.equalsIgnoreCase (String)

  • RMAN-01005: syntax error:

    Hi all

    I have a backup script as below
    RUN {
    ALLOCATE CHANNEL ch00 TYPE DISK FORMAT 'E:\BACKUP\rmanbackup\db\%d_DB_%u_%s_%p';
    ####crosscheck backup;
    backup
    filesperset 4
    INCREMENTAL LEVEL 0 AS COMPRESSED BACKUPSET database include current controlfile;
    sql "alter system archive log current";
    release channel ch00;
    ALLOCATE CHANNEL CH01 TYPE DISK FORMAT 'E:\BACKUP\rmanbackup\ar\al_%U';
    backup
    filesperset 4
    AS COMPRESSED BACKUPSET archivelog all delete input;
    restore database validate;
    delete noprompt archivelog until time 'SYSDATE-1';
    ###delete backup completed before 'sysdate-1';
    delete obsolete device type disk;
    RELEASE CHANNEL CH01;
    }
    It gives the following error
    RMAN-06091: no channel allocated for maintenance (of an appropriate type)
    I have search the Internet and find the following command
     allocate channel for maintenance type disk;
    delete obsolete device type disk;
    but it gives the following error
    RMAN-00558: error encountered while parsing input commands
    RMAN-01005: syntax error: found "for": expecting one of: "channel_id, double-quoted-string, equal, identifier, single-quoted-string"
    I think my rman is not recognize the command.
    my version of oracle's
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
    PL/SQL Release 10.1.0.2.0 - Production
    CORE    10.1.0.2.0      Production
    TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
    NLSRTL Version 10.1.0.2.0 - Production
    Kindly help.

    "ALLOCATE CHANNEL FOR MAINTENANCE" should not be used as a block RUN

  • Disable Vmotion, the SVmotion and cloning in Vmmark 2.1

    Has anyone disabled Vmotion, SVmotion or cloning Vmmark 2.1 in the VMMARK2. CONFIGURATION file for the purpose of comparative analysis to a single host or a different hypervisor platform benchmarking? Looks like it has an option to comment on specific workloads like Deploy/Templates or deploy/DeployVMs in the VMMARK2. The CONFIGURATION file and I was wondering if anyone has ever tried this process successfully.

    Greetings!

    In the file VMMARK2.config the INFRASTRUCTURELIST line specifies to DEPLOY, Vmotion and default SVMotion.

    By setting the value of string equal to INFRASTRUCTURELIST = "", you can simply run the workload by tiles (and do the tests more hypervisor agnostic).

    Hope that helps,

    Davis

  • Search Query By Example uppercase (value only)

    Hello

    I use Jdev 11.1.1.6.
    I need users to use QBE on table (encapsulated by PanelCollection) using a case-insensitive search.
    My application stores all uppercase, so there is no need to put high on the database column. So I'm looking for a solution for only uppercase value entered by the user.

    I found an old post from Steve Muench here [http://radio-weblogs.com/0118231/2004/04/16.html#a276]
    private void adjustStringViewCriteriaToUppercaseWildcards() {
        ViewCriteria vc = getViewCriteria();
        if (vc != null) {
          ViewCriteriaRow vcr = (ViewCriteriaRow)vc.first();
          AttributeDef[] attrs = vc.getViewObject().getAttributeDefs();
          int attrCount = attrs.length;
          while (vcr != null) {
            for (int z = 0; z < attrCount; z++) {
              if (attrs[z].getSQLType() == Types.VARCHAR ) {
                String criteria = (String)vcr.getAttribute(z);
                if (criteria != null) {
                  vcr.setAttribute(z,criteria.toUpperCase()+"%");
                }            
              }
            }
            vcr = (ViewCriteriaRow)vc.next();
          }
        }    
      }
    Steve suggested this method in ViewObjectImpl custom and called from getViewCriteriaClause(), something like this:
    public String getViewCriteriaClause() {
        adjustEnameViewCriteriaToUppercaseWildcards();
        return super.getViewCriteriaClause();
      }
    I noticed that getViewCriteriaClause() has been deprecated in GR 11, 1 material, so instead, I implemented it in getViewCriteriaClause (boolean b).
    The problem is that first statement ViewCriteria vc = getViewCriteria(); Returns a null value. My view object doesn't have any criteria in mind. I expect the VC temp which is connected by the framework at QBE.

    I modified the code for this:
            ViewCriteria[] vcs = getApplyViewCriterias(ViewCriteria.CRITERIA_MODE_QUERY | ViewCriteria.CRITERIA_MODE_CACHE);
            if (vcs != null && vcs.length > 0) {
                for (ViewCriteria vc : vcs) {
                    if (vc != null) {
                        
                        ViewCriteriaRow vcr = (ViewCriteriaRow)vc.first();
                        AttributeDef[] attrs =
                            vc.getViewObject().getAttributeDefs();
                        int attrCount = attrs.length;
                        while (vcr != null) {
                            for (int z = 0; z < attrCount; z++) {
                                if (attrs[z].getSQLType() == Types.VARCHAR) {
                                    String criteria = (String)vcr.getAttribute(z);
                                    if (criteria != null) {
                                        vcr.setAttribute(z,
                                                         criteria.toUpperCase());
                                    }
                                }
                            }
                            vcr = (ViewCriteriaRow)vc.next();
                        }
                    }
                }
            }
    Now, I see this, it's getting the Victoria Cross and execution of vcr.setAttribute (z, criteria.toUpperCase ()); the value that I got during the search but always matching lines are not retrieved.
    When I explicitly put the uppercase value on the UI, then it returns the correct rows.

    What I'm doing wrong here? What else do I manage here? Is there another way to make my usecase?

    Note: If I do vc.setUpperColumns (true) then it returns all rows corresponding to the search criteria, but the statement is executed with the TOP on both sides where clause, which is the behavior desired, but something that I don't want that it doesn't use any index on this column.

    Thank you
    JAI

    Hi Jai,

    You can override the method getCriteriaItemClause (ViewCriteriaItem vci) of ViewObjectImpl, the code should look like this:

    @Override
    public String getCriteriaItemClause(ViewCriteriaItem vci)
    {
      if (vci != null)
      {
        AttributeDef attrDef = vci.getAttributeDef();
        String attrName = attrDef.getName();
        if ("java.lang.String".equals(attrDef.getJavaType().getName()) && vci.getValue() != null)
        {
          String colName = vci.getViewCriteria().isCriteriaForQuery() ? vci.getColumnNameForQuery() : attrName;
          return String.format("(%s = upper('%s'))", colName, vci.getValue());
        }
      }
      return super.getCriteriaItemClause(vci);
    }
    

    AP

Maybe you are looking for