和校验部分为 http://download.csdn.net/download/andyshawchina/7080801 下载资源,在此感谢!可用于IEC101规约的和校验。
其他为自己整理收集。
CRC8部分DELPHI 代码为本人原创(https://wenku.baidu.com/view/e7ebb221bcd126fff7050b62.html),最早公布于2011年9月,
CSDN下载中的该资源为他人上传(http://download.csdn.net/download/as504615572as/6607677)。
function StrToHexStr(const S:string):string;
//字符串转换成16进制字符串var
I:Integer;
begin
for I:=1 to Length(S) do
begin
if I=1 then
Result:=IntToHex(Ord(S[1]),2)
else Result:=Result+IntToHex(Ord(S[I]),2);
end;
end;
function Hex2Dec(Hexs: string): string;
//十六进制转换成十进制
begin
Result := IntToStr(StrToInt('$'+Hexs));
end;
function CRC8(Value: String): char; //CDT 校验
var
uchCRC: Byte; <