Odd CRC calculation

Greetings!

I built an interface to a sensor of bubble Sonotec.

There is a detail that I have not been able to solve; calculation of the CRC.

The manufacturer sent me a pair of examples in based scripting languages, Delphi, and C for the calculation of the CRC. (see attached .txt files)

I made an attempt to interpret the two examples and code creation LabVIEW (see Calc Sonotec CRC.vi)

I built a brute force method that increments the CRC 0 - FF, while checking the bytes of return.

Some commands do not return a response, so no idea as to when my code 'Assumes that the CRC' work on these.

I thank everyone who is interested to help out me.

Mike


Tags: NI Software

Similar Questions

  • Configuration of the loops in LabVIEW to return to the beginning under certain conditions of CRC calculation

    Hey gurus of LabVIEW,.

    Well, I recommend also move your file in writing to be inside the loop, more precisely inside the TRUE (I could bad told you before).  If the CRC was released in 0, do you all the processing, otherwise do nothing.  Then the next iteration.  By moving the file i/o inside the loop, you're avoiding accumulate huge berries (IE a lot of memory).

  • 16 bit CRC IBM

    Hello

    I'm new to CRC calculation and currently having difficulties to find the Labview live that I can use for the calculation.  I was able to find and use a calculator online CRC to generate correct values, however I could not find any Labview VI that generates values that correspond to the online calculator. See the link: http://www.lammertbies.nl/comm/info/crc-calculation.html

    I am using CRC-16-IBM. I found a VI that seems applicable, but I don't know how to use it.  All my attempts here to a CRC calculation with the vi has failed. Perhaps, it is not the good vi or I'm doing something wrong.   Please try to see if you can use the VI and generate corresponding values with the on-line calculator of the CRC. See attachment.

    Thank you

    I had to do some research to figure out what was the real polynomial (actually lied here).  But then looking at the code, I came up with this.  Certainly, the lookup table will be faster because many of these calculations are predone.

  • Calculation of FCS Ethernet-II

    Hello

    The length of the frame of an Ethernet-II frame is not specified in the framework itself, but determined by the IFG (Inter frame Gap) to 10Base-T. Fact a front switch and store must now go through any of the frame again to check the FCS? Or can he calculate the FCS during the reception of the frame and somehow know not to include the FCS itself field calculation?

    Regards Marcel

    Marcel,

    In Ethernet, FCS is based on a cyclic redundancy check, or a CRC calculation. Without getting too deep into mathematics, CRC is the remainder after Division of two polynomials - the first polynomial corresponds to the data to be protected, the second polynomial is the specific setting of the CRC mechanism in use, and after dividing them, the rest is the CRC value. As to divide two ordinary integers, this is what has been "missing" in the first polynomial to a "whole" multiple of the second polynomial. If the rest is "added" to the first polynomial, next time CRC calculated on the first polynomial (now while the rest was added), the new is calculated will be zero, as the first polynomial becomes now a "whole" multiple of the second polynomial.

    This is used to check the FCS efficiently. A switch does not need to wait for a future overall framework, then calculate the CRC on everything except for the FCS field and compare the result with the FCS field. Instead, the switch can simply calculate the CRC value because the frame is delivered, and at the end, when a full frame is received and the CRC was calculated on the entire frame data, including its FCS, the result of the CRC field must be zero. If it is different, an error occurred.

    Best regards
    Peter

  • Converting C code for the calculation of the CRC in labVIEW

    Hi guys, I am a bit stuck. I'm trying to implement a piece of code C in LabVIEW and I make an apparent error. You could someone compare code C my VI and tell me what I'm missing? Thanks in advance.

    For combination of Bytes1 and 2 CRC results must be (by decade):

    Octet1 octet2 CRC
    254 0 061
    253 0 002
    252 0 023
    251 0 124
    250 0 105
    249 0 086
    248 0 067
    247 0 128
    246 0 149
    245 0 170

    I did very little improvement + correction (you forget the binary inversion)

    -Benjamin

  • Calculation of the CRC-16 CCITT

    I need help for generating a CRC - 16 CCITT.  I've searched high and low and can't find the right one.  Here is a list of the sites that I have used to try to find a LabVIEW VI to do the trick:

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/1660

    https://decibel.NI.com/content/docs/doc-1103

    http://forums.NI.com/T5/LabVIEW/CRC-CCITT-16bit-initial-value-of-0xFFFF-or-0x1D0F/TD-p/896664

    http://forums.NI.com/T5/LabVIEW/CRC-16-CCITT-of-serial-packets/TD-p/1471386

    http://forums.NI.com/T5/LabVIEW/trying-to-find-VI-in-LabVIEW-to-calculate-CRC-CCITT-1021-X-25/TD-p/1...

    http://forums.NI.com/T5/LabVIEW/CRC-CCITT/TD-p/109061

    http://forums.NI.com/T5/LabVIEW/computing-CRC/TD-p/825325

    Some of these even have several CRC to the choice.

    Now, what I have is a piece of code C.  And this is where I ask for help because I have no idea how to turn C in G.  And I'm certainly not fair why this CRC is different from 'standard' ones found in the links above.

    I have attached the PDF with the code.

    Here are a few hexadecimal strings and their corresponding CRC:

    String: 00 CRC 08:07 1

    String: 00 09 CRC: 1-06

    Chain: 02 22 03 E8 CRC: E5 6a

    Chain: 02 27 03 E8 CRC: B5 CF

    Chain: 02 29 00 02 CRC: EB 57

    String: 04 29 00 01 00 03 CRC: CC 94

    Chain: 02 00 64 CRC 3D: 05 38

    If there is someone out there willing to give a shot of this I am CERTAINLY happy!

    Paul.

    Ah.  There is a small tweak in there that makes it different from the 'standard' CRC  How sneaky of them.  This code gives me the results you're looking for.

  • creating a total which adds 1 days, 2 odd days

    I have a spreadsheet of numbers that keeps the total stocks of drugs race which calculates how many pills are left and gives the date they run out.

    It is based on a start date and the stock of departure and has always worked fine where the same number of each pill is taken every day.

    I now have a complication when a type of pill is issued 1 one day, 2, 1 the next and so on alternately.

    I need a formula that lowers the left over stock every day by one or two depending on whether it is an odd day / pair

    It should be relatively simple, but I just can't get my head around it.

    any help welcome

    Without the screenshots, it's hard to guess how you have your document updated in place, but according to your description, you could do something like this:

    The table below simply illustrates the push model as you describe.  If that is correct, then the calculations could be as shown in table 1.  The formulas used in column B are shown in column C.

    The formula with the ROUND function simply assumes that a pill is given every day then add half (because an additional pill is added every day) and rounded to the nearest integer.

    SG

  • CRC 32 bit

    Hello

    I am in communication with stm 32 via UART. The framework that I get is "1C000000B0B80700040400000000000000" and the CRC of the frame is "9D0351B5". its does not not in the calculation of the crc which I do, the calculated crc is '226F9471 '. I tried the calculation with python and other sources calculated crc works very well. If someone how to solve, pleas ëlet me know.


  • Series Packet Question: How to calculate CRC

    Hi all, I have tryied to find an answer on how to calculate the CRC on a RS232 packet received, its really driving me crazy!

    im a beginner, learned how to use labview read on different forums, and I had managed to build really good applications, but im stuck in this, hope someone can help me...

    OK, so im constantly receive packets of 15 bytes:

    A5 09 0C 00 61 05 1F A0 10 00 05 00 04 05 3F

    A5 09 0C 00 61 05 10 00 05 0C 2F 03 A0 1F-3F

    A5 09 0C 00 61 05 10 09 05 09 04 09 A0 1F-3F

    the supplier for material gave me the following code to calculate the CRC:

    Control CRC program:

    #define unsigned char uchar
    UCHAR CRC_Bitwise8 (uchar * buf, uchar size)
    {
    UCHAR i, j, b;
    UCHAR crc = 0;
    for (j = 0; j<>
    {
    b = * buf ++;
    for (i = 0; i<>
    {
    If (((CRC^b) & 0x01)! = 0)
    CRC ^ = 0x18;
    CRC > = 1;
    b >> = 1 ;
    }
    }
    return crc;
    }

    so my question is, how can we insert this code in labview? any example?

    Thanks in advance, this forum has really helped me learn labview in a practical way.

    You can use my code for the thread that I've referenced.  To play with a web version of my code go here. My code is based on the code on this Web site.

    My code to the following parameters:

    Calculation of the CRC: Other (specify)

    Order of the CRC: 8

    Polynomial CRC: 0 x 30

    CRC initial value: 0

    CRC XOR final value: 0

    Reflect the preprocessing of data: TRUE

    Match the data before Final XOR: TRUE

    In your messages, the A5 09 0c is certainly a header.  I think that the 00 following is also part of the header, but without the manual, I can't confirm.  00 will not affect the calculation of the CRC, in order to get the same results with it and without it.  So, in your first example, I use 61 05 3F 1E A0 00 05 00 04 10 and the result is 0x05.

  • 8-bit CRC-CCITT

    Hello

    I'm trying to generate a bit 8 CCITT CRC with the polynomal 9-bit U3 + U2 + U4 + U8 + 1

    I have studied and tried to change the CRC 16 bit found here calculator and Vi post by Shoneill here, but I'm getting nowhere...

    Generator of CRC should be initialized to 0, LSB is sent first.

    In the datasheet, I found the example:

    Data 1:1010 0000

    2 data: 0000 0011

    CRC: 0010 1010

    Any intervention on how I can modify the existing 16-bit calcultors, or would it be a better idea to start from scratch?

    Solved. Change the shoneill vi finally gave me the result I needed.

  • Need help with CRC-16-IBM

    Hi all

    I have a servo-motor brand Ezi-Servo, which operate by sending the command series for her.

    The problem I've got is on CRC Checksum. I tried my best to do, but the result was not the same as the sample code they gave me.

    Please check my code and my VI and show me what I'm wrong. I would appreciate.

    Polynomial is x 16 + x 15 + x 2 + 1

    Some examples of good result of the CRC16

    6 A 04 01 00 - CRC16 = 0020

    03 00 00 - CRC16 = 01 D9 B 0

    My VI below, is

    Hello

    In regards to our result of offset by comparing the C-program. I already spoke with the support of the product.

    The CRC algorithm is CRC 16 Modbus, even we used.

    Cause we got wrong with the result is that they did is not calculated CRC of the whole package.  they cut part of the outside (example: header, address etc.) and calculate only the data component.

    If I appreciate everyone of you guys for helping me solved the problem.

    Thank you very much.

  • CRC-CCITT I guess

    I searched through the various threads on CRC and am at a loss as to what I really need. I received a specificaiton with almost no information. I am very familiar with the Red Cross Canadian so I hope some of you can help out me.

    Requirements

    * One CRC 16 bit is calculated for load fields useful sequence number and message. The CRC should be placed after the message payload.

    * CRC is calculated according to the standard polynomial x 16 + x 12 + x 5 + 1

    * CRC initial value. The computation of the CRC initial value must be zero

    Then, I give myself a C code sample which is suppose to calculate CRC using a lookup table. The upper part of the code includes the following comment, "CRC-16-CCITT, Reversed, x ^ (16) + x ^ (12) + x ^ (5) + 1, 0 x 8408.

    Verification Test data

    Here is a sequence of test data for the verification of the CRC algorithm. This data consists of 16, 16-bit (in hexadecimal format).

    0 x 5554 CCCE EEE9 6963 637B 5B 24 DA16 D836 CDB6 EDB6 D5B6 DFB6 DB8E 7B5B C71D 9249

    CRC for this sequence of data is 0x86DE

    I tried to put this sequence in various vi I found in the forums, but none of them give me the 0x86DE. Even change the entries form 8 bit to bit 16 etc.. Because I can't seem to find out how the CRC is suppose to work I can't debug the problem. I worked with this code as it seems the simplist (wish I could remember who posted it so that I could give credit).

    Any help would be appreciated.

    Skydyvr,

    I fiddled a bit and you got an implementation that I think that works you need (based on one of several others I have done).  No tables, so it's a run more slowly, but is generally irrelevent for infrequent calls or short messages.

    From the sources I have, it looks like "Kermit" flavor, some descriptions describe as a 'real' CRC-CCITT.

    Here's a good link:

    Online calculator of the CRC - Lammert Bies

    I would like to know if it works for you.  I pasted your example chain in and makes it the default input data, just to make demonstration easier.

    Best regards

    Dave

  • Hex String CRC with different polynomial equation

    Hello

    I can't change a standard CRC16 (I guess) code for working with the equations I.

    The camera I use has the equation of x 16 + x 13 + x 12 + x 11 + x 10 + x 8 + x 6 + x 5 + x 2 + 1, with an initial value of 0.

    I tried to read about CRC via wikipedia etc, but I don't follow it now.

    I watched a lot of examples, but to be honest, I don't know why it is calculated as it is.

    Thank you.

    Here's an example, I was looking at: https://decibel.ni.com/content/docs/DOC-11072

    This code works in both cases.  But not the first.  You type something?

  • The Calculator display is glitching in Windows 7

    Hello

    I have a question where the bottom of the calculator of Windows 7 (behind the buttons) displays the image of the Office opening.  When I move the application to another area of the screen, it keeps the ghost image of the background where he opened its doors.  Also I try to use the calculator, the numbers of top of the other to create a jumble of numbers.
    It looks like this:
    -J' tried C: > SFC/scannow
    -J' tried logging into my account of comments to see if my account is corrupted and it has the same behavior.
    Is there anything else I can try to solve this problem?
    Thank you
    Dave.

    Oddly enough, I think I can find something related - I managed to solve my problem.  I had an older version of http://www.fastpictureviewer.com/forum/viewtopic.php?f=11&p=3806 that was interfering with Visual Studio 2012.  When I updated this Codec (that I use to view the RAW files from my camera) went off the issue of the calculator.  I had an older version of FastPictureViewer - 2.4 - ish.

  • Calculation of value tx rx bandwidth

    Hello

    Can someone help, how to calculate the bandwidth utlization of "sh int' details..?"

    Can the percentage will get calculated from values tx rx... ?

    I use the lease line 4 Mbit/s.

    FastEthernet0/0/0 is up, line protocol is up

    Material is FastEthernet, address is 001a.6c70.4b14 (bia 001a.6c70.4b14)

    Description: Internet connection

    The Internet address is 1.1.1.1/30

    MTU 1500 bytes, BW 4000 Kbit, DLY 100 usec,

    reliability 255/255, txload 31/255, rxload 120/255

    Encapsulation ARPA, loopback not set

    KeepAlive set (10 sec)

    Full-duplex, 100 MB/s, 100BaseTX/FX

    Type of the ARP: ARPA, ARP Timeout 04:00

    Last entry of 00:00:00, 00:00:00 exit, exit hang never

    Final cleaning of "show interface" counters never

    Input queue: 0/75/0/0 (size/max/drops/dumps); Total output drops: 0

    Strategy of queues: fifo

    Output queue: 0/40 (size/max)

    5 minute input rate 828000 bps, 111 packages/s

    5 minute output rate 498000 bits/s, packets/s 92

    788931865 packets input, 4036778275 bytes

    Received 398 broadcasts, 0 Runts, 0 Giants 0 shifters

    entry 0, 0 CRC errors, frame 0, saturation 0, 0 ignored

    Guard Dog 0

    entry packets 0 with condition of dribble detected

    571607354 packets output, 3639639717 bytes, 0 underruns

    Thanks in advance,

    Kind regards

    Emilie Thakare

    Disclaimer

    The author of this announcement offers the information in this publication without compensation and with the understanding of the reader that there is no implicit or explicit adequacy or adaptation to any purpose.  Information provided is for information purposes only and should not be interpreted as making the professional advice of any kind. Use information from this announcement is only at risk of the reader.

    RESPONSIBILITY

    Any author will be responsible for any damage that it (including, without limitation, damages for loss of use, data or profits) arising out of the use or inability to use the information in the view even if author has been advised of the possibility of such damages.

    Poster

     

    There are several ways to do it, but if your link is 4 Mbps, use the statement of bandwidth on the interface and the value 4000 (I seem to remember that he uses K, if it is not correct value would be 4000000).

    So when you look at the tx or rx loads, those are the load reports.  for example, 128/255 = 50%, 64/255 = 25%.

Maybe you are looking for

  • Wifi Lenovo b50-80 problem

    I have a problem with the driver wifi (Atheros AR956x Qualcomm). the wifi does not illuminate and he wrote its disabled I reinstallet the driver a couple of times, but it didn't work Someone knows how to fix this? Photo

  • FUNCTION SLOW - subset of the string

    Hello everyone, in the image of attacched, I have a loop that goes through a 1 d array of strings, searches for items starting with "02" and went back inside their index in the array. The problem is that it is very slow, it takes about 18 seconds to

  • Event type: Failure Audit

    I have a security failure Audit, what can be done? Event type: Failure AuditEvent source: securityEvent category: monitoring detailedEvent ID: 861Date: 11/05/2013Duration: 02:16:51User: Authority NT\SERVICE networkComputer: RICHARD-33JHYZYDescription

  • Download DVD decoder

    I put a dvd into my disc drive and was informed that he will not play without a download of necessary decoder. I can't find the download on the site of microsoft windows xp. Where can I find?

  • BlackBerry Smartphones new bb reload software 507

    Hi, I just bought new bb 8900 and after software update all I get is on the device (reload software 507) can someone tell me how to reset the device or to reload the software?  Thank you...