I have a string 'CA,0,0,3,0,0,1,ED$R$N'
may i know how to write a source code using codesys 2.3 in ST to calculate the CRC of this string?
look at oscat basic library it as the function CRC_GEN that will calculate if for you
thank you for your suggestion,
but the crc_gen only works on byte array, need to change the string to byte array! how, no lib function supports this conversion.
stolen from l viewtopic.php?t=948 l
MyString AT %MW0: STRING(80);
MyBArray AT %MW0: ARRAY [0..79] OF BYTE;
sString:STRING(8 ); (a normal string has a size of 80 chars)
abyByte: pointer to POINTER TO ARRAY[0..7] OF BYTE;
abyByte:=ADR(sString); (if lengths do not match you can get real weird problems)
Log in to post a comment.