Converting ASCII as Binary... Transposed?

Hello friends!
I am building a VI to break apart a string of characters and convert each to binary code.   Please see the attached example.   When verifying the input string against the output boolean array, I notice that each 8bit code is transposed from left to right when compared against any standard ASCII to Binary table.   Am I understand that binary is usually read from right to left?   My concern is how other systems will translate this code after it is transferred.   The main question is this:  Do I leave it be, or transpose it before data transfer?
Any advice or comments would be greatly appreciated!
Thanks,
Zach
Solved!
Go to Solution.
Attachments:
example_strobe_1.vi ‏7 KB

Remember you are looking at an array.  Index 0 of an array (which corresponds to bit 0 of the number) will be to the left.  As long as you are just doing standard computer functions and bit manipulations, don't worry about it.
If you are doing something where you want to graphically show on the front panel to a user what the bits look like and have the 0th bit on the right, then you will need to manipulate the array so that the 0th bit will be in index 7 and the 7th bit will be in index 0, and so on.

Similar Messages

  • Converting ASCII to Binary

    Hello I need some help.
    I need to convert the ASCII data to Binary form. Like if i have the character 'A' and its ASCII is 65 then its binary would be 01000001.
    If there is any function/method available in java to convert ascii to binary, i would be really thanful.

    Hello I need some help.
    I need to convert the ASCII data to Binary form. Like
    if i have the character 'A' and its ASCII is 65 then
    its binary would be 01000001.
    If there is any function/method available in java to
    convert ascii to binary, i would be really thanful.
    byte ascii = 65;
    String binresult = "";
    for(int i=0;i<8;i++) {
      if(ascii%(2^i)=0) binresult += "0";
      else binresult += "1";
    }

  • Sending text (ASCII) as binary code. Beginner.

    Hello there LV-gurus.
    My mission is basically being able to send information one bit at a time and since I have no background knowledge it is a tedious process figuring out how to do so. I'm not asking for complete solutions considering I want to actually learn it, but I am hoping I could get some pointers on what I should read up on or how to make this happen.
    At my disposal I have a DAQmx, from which I hope to send binary information (or a digital wave) regulating a component that will basically just pass this information on to another (actually the same for now) DAQmx where I want to decode it back.
    What I'm trying to do, but failing to understand how, is more or less this;
    Convert ASCII to binary/digital wave. Here I've tried using the string to byte array but I'm having trouble to finding a way to use the values I get in the byte array.
    How to incorporate a "start/stop listening" signal before/after sending the information.
    I'm certain there is whole bunch of functions/procedures/whatnots I'm completely missing, so any help or friendly nudges in the right direction is much appriciated. My feeble attempts to scan through the plethora of instructions, help texts and posts relating to this matter has left me stumped.

    So is this going to be continuos transmission of a stream of bits that emulate a maintained connection or bursts of data transmission followed by long periods of zeros? Square wave is not really going to be helpful for transmitting data considering the effort required to start/restart/stop the square wave would cause significant slow down, especially if you want to transmit real data and not just varying frequency square waves. 
    You should simply be able to start off converting your data into a digital waveform then passing that data through a DAQmx Write command (Digital Wfm>1 Chan>1 Samp).
    Assuming you want to be able to read this information as well you can simply read the data using a DAQmx Read command configured similarly to compare the output and inputs.
    For most of your data configuration set up you will want to have a look around the Waveform -> Digital Wfm
    The conversion menu should hold some VIs of interest regarding generating the waveform data.
    For the data transmission I would say looking at the "Digital - SW - Timed Output.vi" in the example finder would help a lot.
    (Example finder is found under Help -> Find Examples)

  • Converting ascii to iCal?

    I currently use Solaris CDE with Calendar details kept
    in ascii format. If I am going to use iPlanet's latest
    version of Calendar I need a way of importing all of ascii files for users into iCal. Otherwise I'm left resubmitting all details for the year.

    Hello I need some help.
    I need to convert the ASCII data to Binary form. Like
    if i have the character 'A' and its ASCII is 65 then
    its binary would be 01000001.
    If there is any function/method available in java to
    convert ascii to binary, i would be really thanful.
    byte ascii = 65;
    String binresult = "";
    for(int i=0;i<8;i++) {
      if(ascii%(2^i)=0) binresult += "0";
      else binresult += "1";
    }

  • Is it possible to convert ascii data in binary?

    Hi all.
    In my one table there is a column which contains ascii value. i want to convert it in binary. It it possible in oracle?
    eg field value:1250ÿ it should be 125011111111
    kindly tell how to do this.
    i have tried this using a simple java program but doesnot work for some ascii values.
    thank you

    I created two functions :
    create or replace FUNCTION dec2bin (N IN NUMBER) RETURN VARCHAR2 IS
    binval VARCHAR2(64);
    N2 NUMBER := N;
    BEGIN
    WHILE ( N2 > 0 ) LOOP
    binval := MOD(N2, 2) || binval;
    N2 := TRUNC( N2 / 2 );
    END LOOP;
    RETURN binval;
    END dec2bin;
    And other :
    create or replace function to_ascii( inSource IN VARCHAR2 )
    return varchar2 AS
    ResultString varchar2(381); -- 3 * possible length of source
    TempNumber number;
    begin
    for i in 1..length( inSource ) loop
    TempNumber := dec2bin ( ascii( substr( inSource,i,1 ) ) );
    ResultString := ResultString || trim( to_char(TempNumber,'00000009'));
    end loop;
    return ResultString;
    end;
    Now, in sqlplus : (just to show the binary string)
    column mybin for 9999999999999999999999999999999999999999
    SQL> select to_ascii('g') mybin from dual;
    MYBIN
    01100111
    SQL> select to_ascii('girish') mybin from dual;
    MYBIN
    011001110110100101110010011010010111001101101000
    SQL>Source:http://psoug.org/snippet/Convert-between-Decimal-Binary-Octal-and-Hex_536.htm
    http://www.dbforums.com/oracle/974944-converting-string-binary.html
    Is this you want or something else ?
    Regards
    Girish Sharma

  • Converting float to binary

    Hi,
    I was wondering if anyone knew of a way to convert a float value (as ascii) to a binary value?
    I need a program that will take in a number of floating values from a file, convert the values to binary and then write out these values in another file, 4 bytes at a time.
    I know that you can convert decimals to binary with an easy function but i've searched for float to binary and came up with nothing.
    any help would be really appreciated,
    cheers!

    One of the Java's problems is that you can easily get lost in the sea of Javadocs...
    java.io.DataOutputStream
    writeFloat(float v)
    Converts the float argument to an int using the floatToIntBits method in class Float, and then writes that int value to the underlying output stream as a 4-byte quantity, high byte first.
    java.io.DataInputStream
    readFloat
    public float readFloat()
    throws IOException
    Reads four input bytes and returns a float value. It does this by first constructing an int value in exactly the manner of the readInt method, then converting this int value to a float in exactly the manner of the method Float.intBitsToFloat. This method is suitable for reading bytes written by the writeFloat method of interface DataOutput.

  • To store ASCII into Binary

    I just want to store a large set of numbers.when i did it..the file is too big to open.is about 100 MB.
    its in ASCII ,now i have to convert it into binary files..can anyone help me.

    MK.K wrote:
    I just want to store a large set of numbers.when i did it..the file is too big to open.is about 100 MB.
    its in ASCII ,now i have to convert it into binary files..can anyone help me.
    Well, if it is now too large to open you cannot convert the existing ASCII file , instead you should modify your application to write a new one in binary. Presumably, later you also need to have a way to read the binary file back into another LabVIEW application.
    Open the example finder in LabVIEW 6.1 and look at the following two examples:
    Write Binary File.vi
    Read Binary File.vi
    They are both in section "Fundamentals ... File Input and Output". Let us know of you get stuck .
    LabVIEW Champion . Do more with less code and in less time .

  • ASCII to binary conversion

    Does anyone knows how to convert the ASCII value to binary? For example
    ASCII 'U' to 01010101?

    Hi,
    If I understood you correctly, you want to convert a character eg:'U' to
    its ASCII value which is 85 (in binary representation 01010101).
    With the following method you can convert the first character of a string to
    a one byte long unsigned integer.
    method BaseClass.CharToInt(input pStr: Framework.string): Framework.ui1
    begin
    return *(pointer to ui1)(*(pointer to pointer)(&pStr));
    end method;
    See also the attached .pex file for some more, usefull little methods...
    Regards,
    Tamas Deak
    -----Message d'origine-----
    De: Sing Nyguk Ling [mailto:Thomas.Lingbass.com.my]
    Date: dimanche 12 mars 2000 09:49
    &Agrave;: kamranaminyahoo.com
    Objet: (forte-users) ASCII to binary conversion
    Does anyone knows how to convert the ASCII value to binary? For example
    ASCII 'U' to 01010101?
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • Converting characters to binary

    Could anyone give me an idea how to convert characters to binary, and vice verse?
    It's like those hex and binary editors out there.

    See if this helps you out
    char c = 'a';
    String binaryString = Integer.toBinaryString(c);
    char translatedChar =
    (char)Integer.parseInt(binaryString, 2);
    System.out.println(binaryString);
    System.out.println(translatedChar);
    Thanks. It worked.

  • How to convert image to binary format

    Hi all,
      We have developed an Employee search  mobile web application in .net which is hosted on an exposed IP server, we need to show the employee data along with the image of the employee on mobile.
    When we run this application through our desktop we are able to see the image of the employee since we are doing this through <b>intranet</b> , but when we try to access the same from any mobile device we are able to see only the data but no image, since we are doing this through <b>internet(exposed server).</b>
    Please suggest some way to get this image,
    is there any<b> function module in ABAP</b> which can <b>convert image to binary format</b>
    so that we <b>export binary data</b> to .net application

    Hei evryone!
    CAn anyone pls help me on how to solve this error:
    java.security.AccessControlException: access denied (java.security.SecurityPermission insertProvider.SunJCE)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkSecurityAccess(Unknown Source)
         at sun.plugin.security.ActivatorSecurityManager.checkSecurityAccess(Unknown Source)
         at java.security.Security.check(Unknown Source)
         at java.security.Security.insertProviderAt(Unknown Source)
         at java.security.Security.addProvider(Unknown Source)
         at CryptoTest.processFile(SwingApplet.java:68)
         at CryptoTest.<init>(SwingApplet.java:65)
         at SwingApplet.init(SwingApplet.java:39)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Is it allright for a swing code to access local resources? like in my case i want my swing app to decrypt and encrypt an image file but when i tried to access the method for decrypting and encrypting i got this error message on my console. Do i have to make my code signed before i could write/read a file on my hard drive?
    Any help / suggestions would be much appreciated.Thanks!

  • How to convert pdf  to binary

    hi all,
       how to convert pdf  to binary .
    regards,
    sheetal

    refer this -
    http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_XSTRING_TEXT_CONVER.html

  • How to convert XML to Binary in OSB Message flow

    Dear All,
    Can you please help me in converting XML to Binary in OSB Message flow.
    Please help.
    Thanks,

    ah ok, then you have to apply a transformation from XML to some fixed length format, EDI style
    probably you have 2 options: the traditional MFL
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/consolehelp/mfls.html
    or the (probably) more supported nXSD with a JCA adapter
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/nfb.htm
    I will let you digest this info and then we can continue.
    There are a number of threads in this forum on whether one technology is better than the other (as usual, google can assist you)

  • Convert ASCII File into HTML

    Hi All,
    I have a requirement to convert ASCII files (formatted files when opened through Textpad / Editplus) into HTML when its hyperlink is clicked from my application.
    The present code is that, the TXT file was streamed, html tags have been added and the entire file was re-written as HTML (based on char 12 / 32, as the case may be) and saved as JSP / HTML extension, and placed in a temp folder.
    response.sendRedirect() was used to open this file, which threw OutofMemoryException errors.
    It was also revealed that, if the original ASCII file was 40KB, the converted JSP file would be 160KB (around 4 times)
    The ideal conversion should be - add html tags in the new file and maintain the same formatting as the original ASCII file, & save the file with new extension.
    Thus I need a memory efficient method such that these files are converted on the fly by the application, yet the size kept minimum.
    Please suggest. Thanks in advance
    Regards
    Hari N

    160k is trival on a modern desktop OS. Especially since it is temporary. What heap size is the server using?

  • Hi I would like to know if you can convert decimal to binary using actionscript 3.0?

    Hi I would like to know if you can convert decimal to binary using actionscript 3.0?

    Hi thanks for the response Ive tried to implement the code as you stated but it is not outputting please if you could check the following code and let me know where Ive gone wrong that would be much appreciated Thanks!.
    miles_txt.addEventListener(KeyboardEvent.KEY_DOWN,convertKilometres);
    miles_txt.restrict ="0-9";
    function convertKilometres (k:KeyboardEvent):void {
    var miles:Number;
    var kilometres:Number;
    if (k.keyCode == Keyboard.ENTER){
    miles=Number(miles_txt.text);
    kilometres=miles* 1.609344;
    kilometres_txt.text = kilometres.toPrecision(2);
    kilometreConvert_txt.addEventListener(KeyboardEvent.KEY_DOWN,convertKiloToMile);
    kilometreConvert_txt.restrict = "0-9";
    function convertKiloToMile(k:KeyboardEvent):void{
    var kilometreConvert:Number;
    var milesAnswer:Number;
    if (k.keyCode==Keyboard.ENTER) {
    kilometreConvert=Number(kilometreConvert_txt.text);
    milesAnswer=kilometreConvert* 0.621371192;
    milesAnswer_txt.text = milesAnswer.toPrecision(2);
    binary_txt.addEventListener(KeyboardEvent.KEY_DOWN, checkEnterKey2);
    function checkEnterKey2(e:KeyboardEvent):void{
    if(binary_txt.text != '' && e.keyCode == Keyboard.ENTER){
    decimal_txt.text=binaryToDecimal(binary_txt.text).toString();
    function binaryToDecimal(s:String):Number{
    var n:Number = 0
    for(var i:int=0;i<s.length;i++){
    n+=Number(s.substr(i,1))<<(s.length-1-i)
    return n;
    function decimalToBinary(n:Number):String{
    return n.toString(2);
    return_btn.addEventListener(MouseEvent.CLICK, goBackToCalculator);
    function goBackToCalculator(e:Event):void
    mybuttonSound.play();
    gotoAndStop("Calculator");
    clear_btn.addEventListener(MouseEvent.CLICK,clearField);
    function clearField(e:MouseEvent):void{
      mybuttonSound.play();
      miles_txt.text ="";
      kilometres_txt.text ="";
      milesAnswer_txt.text ="";
      kilometreConvert_txt.text ="";
      binary_txt.text ="";
      decimal_txt.text ="";

  • HELP! Converting ascii to its decimal codes

    Does anyone know how to convert ascii code to its decimal equivalent? Is there a simple function that can do this?
    Thanks for any help!!

    Yes there is.
    String whatever = "whatever"
    char[] chars = whatever.toCharArray();
    for(int i=0; i<chars.length; i++) {
    System.out.println( (int) chars[i] );
    And since its friday I wont flame you for not reading
    a simple tutorial, though its hard not to
    ehmm, the square brackets around the chars[i] are replaced by
    non-squares, or not visible, but they ARE square brackets

Maybe you are looking for

  • BPM does not start

    Hi guys, I have developed an XI interface that takes three files from an ftp location and by making use of a business process, it correlates them and creates some Idocs in target system. In SXMB_MONI, on the outbound side, I can see a green flag for

  • Question mark instead of apostrophe

    In many webpages where there is supposed to be a apostrophe I see a blacked out question mark, as depicted below. Any ideas? In the central system, for example, the MX-980 can trigger sophisticated smart macros, RS232 and relay controls via a central

  • Document content do not appear in finder preview, quick look or cover flow

    The contents of all types of appleworks documents do not appear in finder preview, quick look or cover flow on both of my computers. The generic AWKS logo appears. Why does this happen and what can be done to correct this? I have repaired permissions

  • Oops in abap

    •     Create an ABAP program (e.g. an executable program). •     Define a (local) class CL_FLIGHT_DATA that cannot be instantiated outside the class and contains a private internal table attribute of line type SPFLI, which is filled during instance c

  • Rotten Apple?

    I need help please and a lot of convincing.... I bought an iMac in 2009 which runs Mountain Lion 10.7.5. We have 2 iPads and 3 iPhones in the house. I have a Time Capsule and several Airport Extremes which provide a roaming Wifi network in our house.