From owner-tigers-beastsign@router.xnet2.com Sun Sep  5 08:49:49 2004
Received: from router.xnet2.com (localhost.localdomain [127.0.0.1])
	by router.xnet2.com (8.12.8/8.12.8) with ESMTP id i85Dnnom006588;
	Sun, 5 Sep 2004 08:49:49 -0500
Received: (from majordom@localhost)
	by router.xnet2.com (8.12.8/8.12.8/Submit) id i85DnnQY006586;
	Sun, 5 Sep 2004 08:49:49 -0500
Received: from fallback-mx4.atl.registeredsite.com (fallback-mx4.atl.registeredsite.com [64.224.219.98])
	by router.xnet2.com (8.12.8/8.12.8) with ESMTP id i85Dnaom006537
	for <tigers@xnet2.com>; Sun, 5 Sep 2004 08:49:46 -0500
Received: from mail4.atl.registeredsite.com (mail4.atl.registeredsite.com [64.224.219.78])
	by fallback-mx4.atl.registeredsite.com (8.12.11/8.12.8) with ESMTP id i85B6vlv020872
	for <tigers@xnet2.com>; Sun, 5 Sep 2004 11:06:58 GMT
Received: from kgsystems.net ([66.223.126.72])
	by mail4.atl.registeredsite.com (8.12.11/8.12.8) with ESMTP id i85B5RlF012254
	for <tigers@xnet2.com>; Sun, 5 Sep 2004 11:05:27 GMT
Received: from smtp.tiscali.ch (smtp.tiscali.ch [212.40.5.52])
	by kgsystems.net (8.11.6/8.11.0) with ESMTP id i85B5QM25075
	for <tigers@kgsystems.com>; Sun, 5 Sep 2004 11:05:26 GMT
	(envelope-from bludin@lis.ch)
Received: from LIS-Beat-8500.lis.ch (adsl-96-135-zh1.tiscali.ch [212.254.96.135])
	by smtp.tiscali.ch (8.11.7/8.11.7) with ESMTP id i85B5JN27670
	for <tigers@kgsystems.com>; Sun, 5 Sep 2004 13:05:20 +0200
Message-Id: <6.0.0.22.2.20040905125851.05712c28@mail.syhosting.ch>
X-Sender: lis-3@mail.syhosting.ch
X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22
Date: Sun, 05 Sep 2004 13:05:01 +0200
To: tigers@kgsystems.com
From: Beat Ludin <bludin@lis.ch>
Subject: CALC_CRC
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed
Sender: owner-tigers@xnet2.com
Precedence: bulk
Reply-To: tigers@kgsystems.com


Hi Tiger-Folks

I'd like to have a Basic Tiger communicate with a device that use a 
checksum which, according to the manual, can be generated as follows

'*******************************
'* CRC-Checksum                *
'*******************************
Function Crc_(Msg() As Byte, ByVal n As Byte) As String
	Dim i, j As Byte
	Dim crc As Long
	Dim CRC_String As String
	crc = 65535
	For j = 0 To n
		crc = crc Xor Msg(j)
		For i = 1 To 8
			If (crc And 1) = 1 Then
				crc = Int(crc / 2) Xor 40961
			Else
				crc = Int(crc / 2)
			End If
		Next i
	Next j
	CRC_String = "000" + Hex(crc)
	Crc_ = Right(CRC_String, 2) & Right(Left(CRC_String, Len(CRC_String) - 2), 2)
End Function

Can anybody tell me whether the Tiger Basic function CALC_CRC can be used 
in this case and, if so, what the parameter values for START and STEP would 
have to be?

Cheers,  Beat


===> Contact mail-list administrator: ListMaster@IndustrialController.Com
===> Tiger info: http://www.industrialcontroller.com/
===> Unsubscribe or view archive: http://kgsystems.xnet2.com
===> Purchase Wilke Products (USA): 800-292-4303 or TigerSales@IndustrialController.Com

