Click here to Skip to main content
15,894,740 members

Is there any online check sum calculator

Tarun Batra asked:

Open original thread
I have got the following packet format to be send to machine:-
    byte     byte     byte         byte
      2       2         1           1
+---------+-------+-------------+----------+
|  CM     |   00  |  check sum  |  CR      |
+---------+-------+-------------+----------+

I have the following instructions:-

All data isASCII character code without checksumand CR.
Calculate sum total from top till before checksum ( 1 bite unit ),then recognize this complement of 1 as checksum.
Finish of format is CR (Hexadecimal: OD)
I implemented the check sum algo given on the following link http://tools.ietf.org/rfc/rfc1071.txt[^]

I have to send the above packet to the Dialysis machine.
Can anyone tell me the Algorithm which is mostly used in Hardware machines.
Is there any check sum calculator from which i can directly calculate check sum and send the hard coded check sum value to the machine as my contents of packet are fixed.

[edit from OP]
i did like this have a look:-
C++
char data[6]="CM00";
data[4]=0xF0;
data[5]=0x0D;
iResult = send( ConnectSocket, data, (int)strlen(data), 0 );
if (iResult == SOCKET_ERROR) {
    printf("send failed with error: %d\n", WSAGetLastError());
    closesocket(ConnectSocket);
    WSACleanup();
    return 1;
    }

printf("Bytes Sent: %ld\n", iResult);
i get a display bytes sent 6
but still not getting the response please help
[/edit]
Tags: C++, C, Visual Studio, Algorithms, Checksum

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900