¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Calculate a checksum


Chip
 

Then you could use an ATOS symbol in SIMPL with an option of 259d.

If you want to do this in S+, and your bytes are in "msg$", you could do this:

X = 0;
FOR (Y = 1 TO LEN(msg$))
{
X = X + BYTE(msg$,Y);
}
// This gives you a sum of all your bytes in "Y"

CHK = 256 - LOW(Y);

// In case the bytes add up to more than $FF, use LOW

- Chip

--- In Crestron@..., "maglite4cell" <maglite4cell@...> wrote:

It uses all of the hex bytes to calculate it the formula is (&#92;x100 - (sum of data bytes))

--- In Crestron@..., Neil Dorin <neildorin@> wrote:

We're going to need to know what kind of checksum you're calculating here.
The API/Protocol document for the product you're integrating should specify
how to calculate it. If you can tell us what product or the specified
calculation we can try to assist you in how to build the calculation in
code.


On Thu, Jun 6, 2013 at 9:15 AM, maglite4cell <maglite4cell@>wrote:

**


Does anyone have an example to calculate a checksum?

Im having a brain fart here....



[Non-text portions of this message have been removed]

Join [email protected] to automatically receive all group messages.