create a string ASCII of BCC

I've been working on trying to fix a small detail in a communication routine, I write for speaking to a Hitachi L300P motor controller. My problem is that the commands are sent in blocks with a command STX to indicate the beginning, a node to indicate which of the RS485 devices is called, control, data, a sum of check blocks (BCC) and a carriage return. My problem is the generator BCC I wrote, which proved to be very similar to this example, returns the BCC # as a single hexadecimal digit, but the instrument apparently wants the number broken down into ASCII characters that she, or Bcc from 05, would represent Protocol wants to apparently "30-35", ASCII '0' '5 '.

My befuddled brain fatigue think I had a simple way to do it, but remember me (I was working on it until about 0230 this morning).

The example from the manual of the controller is:

in ASCII

(STX) 01 00 1 (BCC) [CR]---> 02 30 31 30 30 31 33 30 0D where the ICC would have returned '30' and their protocol sends 33 30 which are ASCII "3" and "0".

As always, thanks in advance

Something like that

Tags: NI Software

Similar Questions

  • How to create the string of JSON using QVariantMap array?

    Hi all

    How to create sub string of Json using QVariantMap array?

    {
        "Test1": [
            {
                "dataTest1": "0000",
                "dataTest2": 1412,
                "dataTest3": "",
                "dataTest4": "0000",
            }
        ],
        "Test2": {
            "data1": 1412008,
            "data2": "0000",
            "data3": "A",
            "data4": "0000",
        }
    }
    

    Waiting for your answer please reply me as soon as possible.

    JSON array is QVariantList

    JSON object is QVariantMap

    then create a QVariantLsit and insert your QVariantMaps

  • Maintenance mode to create query strings?

    Why should I switch to Maintenance Mode to create query string parameters?  I created query string parameters in the past and I have never been held to switch to maintenance mode.  If I go to activate maintenance mode, here is the message I get:

    Maintenance mode is currently DISABLED. Click on the button at the bottom of the page to activate the Maintenance Mode. With the Maintenance Mode on visitors register as not being on the Web site.

    Then... I guess I have to move fast while it is in maintenance mode, so I don't miss the important Web site visitors.  I just took an Eloqua University class on the web of profiling and of maintenance mode was not mentioned when creating query string parameters.

    Just wondering why this requirement has been added in order to create new query string settings?  I'm sure there is a good reason, but I was surprised by this today.

    Hi Vince,.

    Maintenance mode is necessary if you are generating a high volume of web traffic. When the volume of Internet traffic is low, the system is able to create the settings while continuing to capture relevant data provided by all. If the traffic volume is high, the system cannot create additional "fields" in the database at the same time perform all write-queries that generate your visitors. In addition, when the new channels/parameters sets query are created, the system must comb all existing data to find these settings in one of the existing data, so if clickstream data is generated more quickly that the script can work through the data, it would cause a problem.

    So yes, it is possible that sometimes maintenance mode will be needed, and other times not. If necessary, its best to activate only for very short periods of time, as Yes, all incoming data in maintenance mode is ignored.

  • Decimal string to string Ascii (hex)

    Hello

    I want to convert a decimal string like this "12345" in the string (hex) Ascii as this "3132333435"

    How can I do?

    concerning

    Schwede

    It is a way to do it.

  • Creating a string of bits to send through questions series VISA, complete noob here...

    Hi all

    I'm trying now, to browse the values I have on my collection of GUI and with these, construct a message to send through VISA.

    I have the usb-> rs232 cable and NO, and I have attached a connector, with the pins 2 and 3 tied together so that I can loopback and see the messages I send.

    I'm supposed to (from the instructions that I read on a design doc) will send a message of length of 24 bits.

    And please bear with me, I've never worked on this low a level before, nor with the serial interfaces, so I can be completely off on how I'm doing... and this is my

    first really relay with LabView for this project.

    I have some time execution of every 20ms in a loop.

    I have a structure of the event looking for user actions on my front.

    I also breast that everything in a loop, a flat sequence structure... my assumption was, every 20ms, the flat sequence structure would run, except where it is interrupted by an event... that could trigger and then continue with the flat structure...

    I have seen that the entry VISA (and read) take a string.

    So, I started the flat structure with build my string of bits/bytes outgoing... first section is coded hard and then, through the two sequences, loop it and based on the values of the controls within each cluster, I concatenate to my outgoing string... in which case, I send by the visa by the closure, and post it on the message indicator.

    It seems that I can send on only 8 bits at a time through VISA... so, I try to understand (and I wonder people with the req on this part) why they said to send such a long chain... or am I supposed to send each message of 8 bits, one at a time?

    If one bit 8 message at the same time, I wonder how I have let him know when I am finished?  I have heard and read things about start and stop bits, but I don't know where to put them.

    In addition, is the string that I'm supposed to put them together to send something waiting for data series bits/bytes? I saw a reference to a string of bytes while the research, but I Coulnd't ' t find a piece of string byte on the pallets.

    And when I run the present (a simpler example of my real application, simply to show here the parts I am trying to figure)... the message echoing again to me is:

    111000010000\n

    When if I have all the tubes with a value in them... I want to get something new like:

    1110000111111110111111110\n

    I'm also noting that messages do not seem to be transmitting every 20ms... seems only to get a message back when when I trigger an event, as the option switch on the LED.

    In any case, I'm confused, I think that, on certain basic principles and hope someone can maybe send me some links or give me some advice on where I'm wrong so seriously...

    Is my construction of the right to follow path string message?

    Is something wrong with the flow of the program... the events + flat sequence structure?

    I received this property by searching for forums and other papers OR, but I'm stuck sort of and confused I think on some concepts with read/writes...and possible VISA my flow control.

    Any suggestions and/or links GREATLY appreciated.

    Thank you

    Cayenne

    PS. Some asked to record for older versions, so I enclose a copy saved to more 2011 v10

    Cayenne,

    Your sequence structure is not necessary.  You have a dependency on the data, as well as the structure of sequence is not really do anything for you.  Seems to me that what you want to do is to build the table of your clusters that you already own and send the table directly in a > 0? function.  It will accept berries and an array of Boolean output.  You can then use the Boolean array to the Number function to create a U8.  Do this for each of your clusters and integrate the results in a table of U8 and fixed data.  Then use the array of bytes to the string function to get a string to pass in the VISA to write it.  Without loops or the necessary structures.  Any additional manipulation you need, I recommend to the byte level.

  • create time string 800 Hz to tiara

    How create a time of 800 Hz channel using the 'create string of time' in the section analysis of Diadem.  It will not accept integers to be used as a time step.  To create a channel of time 1000 Hz, I use a time unit of 'miilisecond' and a time step of 1 to 100 Hz time I use a time of 'millisecond' unit and a 10 time step.  But for a 800 Hz channel of time using the unit of time "millisecond" no time will be be 1.25 Diadem will not accept.

    I have other time frequencies that have this problem, such as 325 Hz and so on.

    Any help will be appreciated

    Thank you

    John

    Thanks, who takes care of my question

  • is it possible to put in place a control of the event in labview to create a string indicator when you press a button

    I'm trying to implement a user interface where an operator can set the column headers for a report and I use indicators of the string as the placement for the text in the column headers.  Given that many of them will have experience with Labview, I was hoping to set a button with the ability to add or possible delete a string indicator when you press.  Is it possible to set up an event like this?

    You cannot create an indicator of the string, but you can change the visibility of the existing volumes.

    For example, you can display an indicator of the string, giving the impression that his creating.

    /Y

  • String ASCII to decimal string and its sum

    Hi all

    I am a beginner in Labview and this is my first post on the forum.

    I get a package series "1200F" on a MCU COM port. These are all ASCII characters.

    I want to convert all of these ASCII characters into decimal numbers and add their decimal values to get the sum. So I took the ASCII string in a table using "Array of strings of bytes" and then typecast this constant using type U8. I put this in a loop and collects the decimal value using the Array function build. So I "Add elements of an array" function to add these decimal values to get the sum.

    The problem is that for the input string, I am able to get the sum of "1200" only. At the time wherever I type the last character ASCII F, the sum does not. I see that when the sum exceeds 255 it resets again from 0. I have attached the VI for reference.

    Any help would be appreciated.

    Convert 32 to avoid the limitation 255 of U8.

  • create the string in the array item

    Problem... I want to create a unique string item. My entry is an array of integers 1 d of two elements, for example (10, 5) and the output should be a part of string in the form of "10.5." Just a single item and not a table. Any tips or ideas?

    Thank you!

    Table in spreadsheet string.

    You may need to remove the character from end of line that arise.

    Alternatively, if you know it's always 2 items.  Index table and food for both outputs in Format to a string with %s, %s format code.

  • How to create two string of digits of a loop counter I have?

    Hello

    I have a loop that loops 20 times (1.20) with the numeric variable I.

    Now, I want to use this to create a switchingpath - but here I need channel "01" instead of just "1".

    So, I can not only use str (i)

    How can I create the prefix 0 for i 1.9?

    Thank you

    Str (Locals.i, "%.2d")

  • Create a string to an integer with zeros

    I want to take an integer, that is, 2, 23, 100, 123456

    and convert them into channels: 00000002 00000023, 0000100, 00123456 respectively

    In python, in my view, it is something like this: % 08D

    There are several ways to do so, but this should work and is easy to understand:

    var str = ' ' + 123456.  your variable of integer type here

    While (str.length< 8)="" str="0" +="">

    Dan

  • bt_gatt_write_value_noresp HowTo convert ascii uint8_t string *.

    my C knowledge is very poor and so I have a question.

    use case:

    Crystal APP

    connected to a custom equipment

    Find services and connect to services: OK

    Characteristics of the found Services

    Record the reading for the notification Service: OK - all notifications are coming through

    now, I also have to WRITE a feature using

    int bt_gatt_write_value_noresp(int instance, uint16_t handle, uint16_t offset, const uint8_t *data, int size)
    

    This is the command that I want to write to the device as a String:

    "$HTMEA, 1, 7 * 7F\r\n".

    How to convert this string ascii uint8_t *?

    and what is the length (size)?

    using the. toAscii() I take a ByteArray and there is a. constData() which gives me a char *- but it does not help.

    looked at BT THE Primer, examples of applications and blogs, but did not find an example where a QString will be converted and sent to the device.

    the other way back to recall notice where the uint8_t * was transformed into a QString, I found in the sample application and this heart rate monitor market.

    thx for help

    overdraft.

    First, I had to get the hexadecimal value of my request chain.

    QString theRequest = "$HTMEA,1,,7*7F\r\n";const int characteristicLen = theRequest.size();uint8_t *characteristicBuffer = (uint8_t *) alloca(characteristicLen + 1);QString theRequestAsHex = theRequest.toAscii().toHex();
    

    so I found some utilities BT THE sample applications to help me turn this into uint8_t *.

    Utilities::hexToIntArray(theRequestAsHex, characteristicBuffer);
    

    The following methods of the utility:

    const QString Utilities::HEX_CHARS = QString("0123456789ABCDEF");
    uint8_t Utilities::hexToInt(QChar c1, QChar c2) {
        c1 = c1.toUpper();
        c2 = c2.toUpper();
        uint8_t result = 0;
        result = HEX_CHARS.indexOf(c1) * 16;
        result = result + HEX_CHARS.indexOf(c2);
        return result;
    }
    void Utilities::hexToIntArray(QString hex_string, uint8_t* output) {
        const size_t numdigits = hex_string.length() / 2;
        for (size_t i = 0; i != numdigits; ++i) {
            output[i] = hexToInt(hex_string.at(2 * i), hex_string.at(2 * i + 1));
        }
    }
    

    Thanks to the old guys BlackBerry John Murray and Martin Woolley, for all their great stuff on BT, BTLE and NFC.

  • How to create an XML Document and convert it into a string? (send through wireless network)

    Hello

    I am now able to post data to a web server by using Blackberry JDE (medical use).

    Now, instead of display the plain text, I would like to send an XML file.

    I am able to do it using this code on a 'normal ': Java application

    import java. IO;
    Org.w3c.dom import. *;
    Import javax.xml.parsers. *;
    Javax.xml.transform import. *;
    Javax.xml.transform.dom import. *;
    Javax.xml.transform.stream import. *;

    public class {XML
    Public Shared Sub main (String [] args) {}
    try {}
    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    Doc document = builder.newDocument ();
               
    Root element = doc.createElement ("root");
    doc.appendChild (root);
               
    Child element = doc.createElement ("child");
    child.setAttribute ("name", "value");
    root.appendChild (child);

    Add a text element to the child
    Text = doc.createTextNode ("text");
    child.appendChild (text);

    implement a transformer
    TRANSFAC TransformerFactory = TransformerFactory.newInstance ();
    Transformer trans = transfac.newTransformer ();
    trans.setOutputProperty (OutputKeys.OMIT_XML_DECLARATION, 'yes');
    trans.setOutputProperty (OutputKeys.INDENT, 'yes');

    create the string of the xml tree
    StringWriter sw = new StringWriter();
    StreamResult result = new StreamResult (sw);
    DOMSource source = new DOMSource (doc);
    TRANS. Transform (source, result);
    String xmlString = sw.toString ();
    System.out.println (xmlString);
    } catch (Exception e) {}
    make error management
    }
    }
    }

    However, on the Blackberry JDE, many functions is not recognized.

    I saw the class DocumentBuilderFactory (net.rim.device.api.xml.parsers.DocumentBuilderFactory), the DocumentBuilder (net.rim.device.api.xml.parsers.DocumentBuilder) class and the interface of Document in the docs of Blackberry Java (4.2.1).

    So, I'm able to create an XML Document... but I don't know how to convert to a string?

    How can I do this? The TransformerFactory class doesn't seem to exist... and I did not find an alternative yet.

    At the present time, here is the code I use to publish data:

    String coord = lat + ";" + LNG; post data
    con = (HttpConnection) Connector.open (url); Open the connection URL
    con.setRequestMethod (HttpConnection.POST); POST method
    con.setRequestProperty ("Content-Type", "application/x-www-formulaires-urlencoded");
    out = con.openOutputStream (); display the results in a stream
    out. Write (Coord.GetBytes ());

    responseCode = con.getResponseCode (); Send data and receive the response code
    If (responseCode! = HttpConnection.HTTP_OK) {}
    System.out.println ("HTTP STATUS CODE: 404"); error
    } else {}
    System.out.println ("HTTP STATUS CODE: 200"); successful
    }
    If (con! = null) con. Close; close the connection to the URL

    As mentioned, rather than display a string with a delimiter between each value (there will be a lot more than two values finally), I would like to publish an XML.  It will be more "elegant" and easier to parse by my code on the web server.

    Maybe I don't have to convert it to a string?

    In other words, how can I convert my XML Document to send it via the wireless network?

    Thanks for your help!

    TransformerFactory does not exist in the BlackBerry API.  As far as I can tell, you need to implement yourself.  You can do this by walking the DOM and the output of channels.  They have an example of the market of the DOM in the XMLDemo, but they view as fields, you just need to write strings.

  • ASCII to string

    Hello

    I would like to know how to get the string ascii say "Tiger."
    ASCII function gives the character ascii value.
    What is the process to get the ascii to string?
    loop the only option?
    Thanks in advance for your answers :)

    SMON wrote:

    SMON wrote:

    My approach was to find the ascii of each character and then add 3.
    suggestions to improve this?

    Hmm, what happens if it's X, Y or Z?

    at the risk of seeming strange to have answered my own question... :)

    you could enveloping the ascii values I guess.

    select chr(case when ascii('&A')+3>90 then ascii('&A')-23 else ascii('&A')+3 end) from dual
    

    Or wrap it up without the aid of a box/decode instruction... ;)

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select chr(rownum-1+ascii('A')) as ch from dual connect by rownum <= 26)
      2  --
      3  select ch
      4        ,chr(ascii('A') + mod(ascii(ch)-ascii('A')+3,26)) as encode
      5        ,chr(ascii('A')+(26*power(sign(floor((ascii(ch)-ascii('A')-3)/26)),2)) + ascii(ch)-ascii('A')-3) as decode
      6* from t
    SQL> /
    
    CH ENCODE DECODE
    -- ------ ------
    A  D      X
    B  E      Y
    C  F      Z
    D  G      A
    E  H      B
    F  I      C
    G  J      D
    H  K      E
    I  L      F
    J  M      G
    K  N      H
    L  O      I
    M  P      J
    N  Q      K
    O  R      L
    P  S      M
    Q  T      N
    R  U      O
    S  V      P
    T  W      Q
    U  X      R
    V  Y      S
    W  Z      T
    X  A      U
    Y  B      V
    Z  C      W
    
    26 rows selected.
    
  • Create an array of strings of names of JPEG in a folder

    I create a dynamic flash Gallery. I have filled external files with thumbnails, which are named descriptive. I was wondering if there was a way to create a string array of the names of JPEG (by file), then use that to drive my charger loop, instead of 'pic' + i + '.jpg', something like picArray [i], or picArray [i] + '.jpg '. I honestly don't want to rename hundreds of files named way descriptive pic1, pic2, etc., that I I want to use descriptive file name in the SWF file. In addition, if the user wants to browse the contents of the file without the SWF, they have an idea of what is the image. Any help is appreciated. Thanks in advance!

    lol you need to use a 3rd party (such as zinc) application or use another application like adobe air.

Maybe you are looking for