[r68]: / trunk / Monarco / Monarco_FB / utility / getCRC / svnobj  Maximize  Restore  History

Download this file

29 lines (29 with data), 2.7 kB

Gx_lW
!0…jьoћ{Нѓ‘Ў
ъSystem.StringL{f8a58466-d7f6-439f-bbb8-d4600e41d099}ImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocumentL{f3878285-8e4f-490b-bb1b-9acbb7eb04db}TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}	Id
longTagText
.// startadress of bytes>pByteTx								:= ADR(abyBuf); Ц// calculate CRC-16 checksum, beware that for the checksum calculation, we need to skip the checksum itselfBuiSizeTx							:= SIZEOF(abyBuf);<// should always be 24 / 16#18LudiCRCLen							:= (uiSizeTx -16#02);		„CheckSum							:= MEM.CRC16_Modbus( pByteTx, TO_UINT(udiCRCLen) );$// return checksum6getCRC 								:= CheckSum;InterfaceL{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}R//Returns CRC16 checksum for input bufferЉ//byte 24 and 25 are not taken in account, they hold the crc16 itself(METHOD getCRC : WORDVAR_INPUT‚	abyBuf			: ARRAY [0..(ParamList.MONARCO_STRUCT_SIZE-1)] OF BYTE;END_VAR VAR!&	uiSizeTx 		: UINT;"*	udiCRCLen 		: UDINT;#<	pByteTx  		: POINTER TO BYTE;$&	CheckSum		: WORD; РРРE
РР	
­'ЪР-
РР	
­(ЪР-РР	
­)ЪР-РР	
­*ЪР-РР	
­+ЪР-РР	
­7ЪР-РР	
­,ЪР-РР	
­-ЪР-РР	
­.ЪР-РР	
­/ЪР-РР	
­0ЪР-РР	
­1ЪР-РР	
­ЪР-РРE
РР	
­ЪР-РР	
­6ЪР-РР	
­ ЪР-РР	
­4ЪР-РР	
­2ЪР-РР	
­3ЪР-РР	
­!ЪР- РР	
­"ЪР-!РР	
­#ЪР-"РР	
­$ЪР-#РР	
­%ЪР-$РР	
­&ЪР-РР	
­ЪР-