Jump to content
Brian Enos's Forums... Maku mozo!

jeff59

Members
  • Posts

    1
  • Joined

  • Last visited

Profile Information

  • Real Name
    Jeff Block

jeff59's Achievements

Looks for Range

Looks for Range (1/11)

  1. Thanks to Doug G for explaining how the checksum is calculated! I've been working on a project that communicates with the ProChrono to gather data that is integrated with other shot information. I've got most of the commands used by CE's PCRemote program working in my project including: Get Statistics, Get Velocities, and String Change. Here's the function I'm using to append the checksum to the end of the command string. I work in MS Visual Studio using C++/MFC but you should be able to modify for regular C/C++ easily. - Jeff59 void AddChecksum(CString& strCommand) { // appends the checksum to the end of a command string // assumes that the first character is a ':' // calculate the total of the char values in the string int nChecksum = 0; for(int x = 1; x < strCommand.GetLength(); x++) nChecksum += (int)strCommand.GetAt(x); // get least significant byte and subtract from 256 nChecksum = (256 - (nChecksum % 256)); // add the checksum to the command string CString strTemp; strTemp.Format(_T("%02X"), nChecksum); strCommand = strCommand + strTemp; }
×
×
  • Create New...