Crestron SIMPL+ Reference Manual page 291

Language reference guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

®
Crestron SIMPL+
Software
// temporary buffer. A Command looks like
H{out}{l1}{l2}...{l8}
// {2 byte checksum}{CR}{LF} where {out} and {l1}..{l8} are 3
// digit ASCII bytes with leading zeros. An example is
// H001001002003004005006007008{2 bytes checksum}{CR}{LF}
//
makestring(PESABUF,"H%03d%03d%03d%03d%03d%03d%03d%03d%03d",
// OUTPUT, LEVEL1, LEVEL2, LEVEL3, LEVEL4, LEVEL5, LEVEL6,
// LEVEL7, LEVEL8);
COUNT=0;
// Checksum count initialized to 0.
// Add each byte in the string to the running count.
for(i=1 to len(pesabuf))
COUNT = COUNT + BYTE(PESABUF, I);
// The checksum is computed by taking the COUNT and throwing
// away all but the lower byte. The upper nibble + '0' is the
// high order checksum byte, the lower nibble + '0' is the low
// order checksum byte.
// Compute the low byte of the checksum.
CKSLOW = (COUNT & 0x0F) + '0';
// Compute the high byte of the checksum.
CKSHI = ((COUNT & 0xF0) >> 4) + '0';
// Send the checksum command to the COMMAND$ that gets routed
// to the switcher via the SIMPL program.
makestring(COMMAND$, "%s%s%s", PESABUF, CHR(CKSLOW),
CHR(CKSHI));
}
®
Language Reference Guide - DOC. 5797G
SIMPL+
281

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SIMPL+ and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF