Created
July 13, 2016 12:11
-
-
Save 7m4mon/751ff4ec13103360a0db71a4b293a402 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'RC-S620Sのチェックサムを返す | |
Function ByteAryToCheckSum(commandAry As Byte()) As Byte | |
Dim chkSumInt As Integer = 0 | |
For i = 0 To commandAry.Length - 1 | |
chkSumInt = chkSumInt + CInt(commandAry(i)) | |
Next | |
chkSumInt = 256 - chkSumInt Mod 256 | |
If chkSumInt = 256 Then chkSumInt = 0 | |
Return CByte(chkSumInt) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment