LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a checksum number of a char[256]

I have to generate a checksum number of a char[256] before send it trough a TCP/IP port, and check it on the other side (remote PC) when I receive it. Did anybody knows how to do it in a easy way.

Many thanks in advance.

Xavier

xcaparros@capatest.com
Image Hosted by ImageShack.us
0 Kudos
Message 1 of 11
(6,240 Views)
Here's a function that generates a "Internet" style checksum on a string. Runs all OK under CVI.

Bob Hayes

USHORT CheckSum(UCHAR *pszString) {

// Create checksum for a string. Note that ANSI C specifies the
// overflow behavior of unsigned integer types.

USHORT sum = 0;

while (*pszString) sum += *pszString++;
return ~sum; // 1's complement checksum

} // end, CheckSum
0 Kudos
Message 2 of 11
(6,250 Views)
I attach an abstract from a document by Angelantoni Industrie (climatic chambers constructor) that describes the communications protocol between a PC and a Siemens PLC. The protocol extensively uses CRC calculation to assure goodness of messages. There is a description of the CRC calculation method and examples in C and Visual Basic to use the functions for calculating the CRC to transmit and checking the CRC received.
This examples follows the MODBUS protocol specifications.
Roberto.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 11
(6,250 Views)
Hi Roberto,
Would you happen to have the entire document from angelantoni? I've just 'inherited' one of their chambers and want to find a way of controlling it via the RS232... so any more info that you may have would be appreciated...

Many thanks
email
0 Kudos
Message 4 of 11
(6,250 Views)

Some years ago You tried to control an angelantoni climate
chamber via LABView. As we’re experiencing some problems using LABview to set
the target temperatur, I wondered if You had any success.


0 Kudos
Message 5 of 11
(5,675 Views)

dfgsdfgkljgsdguxcvnjb wrote:

Some years ago You tried to control an angelantoni climate
chamber via LABView. As we’re experiencing some problems using LABview to set
the target temperatur, I wondered if You had any success.



Hi, it's possible that you are confusing me with some other poster here, since I never used LabVIEW to interface such equipments.

Which problems are you experiencing? If you can add some details maybe I can assist you a little.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 11
(5,668 Views)

slaine, I have sent you the documentation you asked me.

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 11
(5,667 Views)

OOPs. Sorry You're right. I mismatched that.

Thanks anyway.

 

Markus

0 Kudos
Message 8 of 11
(5,660 Views)
slaine, I received a "user unknown" error while posting you the documentation: please send me an email so that I can reply sending you the informations you asked. My address is in my profile.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 9 of 11
(5,616 Views)

Roberto, did you notice the date of slaine's request? I doubt that he is still waiting for the information, after nearly six years Smiley Happy

 

JR

0 Kudos
Message 10 of 11
(5,609 Views)