DAQUSERatNDCPower Posted July 26, 2012 Share Posted July 26, 2012 I am trying to communicate with an electronic load. The protocol is very simple and requires a 26-byte set. The 26th byte is a checksum that adds the previous 25 bytes, but only keeps the two least sig figs. For example, if the sum of the 25 bytes is 0x3af, the checksum would be 0xaf. I am having trouble efficiently computing this sum. Right now I just have the 26 bytes as 26 different local variables. I then have the following line of code: Byte26 = Sum({Byte01, Byte02, Byte03, Byte04, Byte05, Byte06, ... Byte23, Byte24, Byte26}) Byte26 = Byte26 & 0xFF //I do this to get the byte back down to 8 bits It is throwing a C1072 error for the first line. I looked this error up and it says I am missing a bracket. Am I going about this incorrectly? Thanks for your help... Marshall Link to comment Share on other sites More sharing options...
AzeoTech Posted July 27, 2012 Share Posted July 27, 2012 You can't put variables inside {} notation. Please see this post: http://www.azeotech.com/board/index.php?/topic/4890-passing-variables-into-array-functions/ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.