User Tools

Site Tools

한국어

logicpython:cubloc_api:getcrc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

logicpython:cubloc_api:getcrc [2026/04/10 02:06] – created - external edit 127.0.0.1logicpython:cubloc_api:getcrc [2026/04/10 04:11] (current) – removed mfranklin
Line 1: Line 1:
-====== GetCrc ====== 
- 
-Calculate the MODBUS RTU CRC-16 of a byte array slice. 
- 
-===== Syntax ===== 
- 
-<code python> 
-from cubloc import GetCrc 
- 
-GetCrc(arrayName: bytes, byteLength: int) 
-</code> 
- 
-===== Parameters ===== 
- 
-  * **arrayName**: Source byte array. 
-  * **byteLength**: Number of bytes from the start of ''arrayName'' to include. 
- 
-===== Return Value ===== 
- 
-Returns the MODBUS RTU CRC-16 value for the requested byte slice. 
- 
-===== Exceptions ===== 
- 
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#TypeError|TypeError]]: ''arrayName'' is not bytes or ''byteLength'' is not an integer. 
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#ValueError|ValueError]]: ''byteLength'' is outside 1 to 65535 or larger than ''arrayName''. 
- 
-===== Example ===== 
- 
-<code python> 
-from cubloc import GetCrc 
- 
-# Example usage 
-result = GetCrc([1, 2, 3], 1) 
-print(result) 
-</code> 
- 
-===== Related APIs ===== 
- 
-  * [[logicpython:cubloc_api:bclr|BClr]] 
-  * [[logicpython:cubloc_api:bfree|BFree]] 
-  * [[logicpython:cubloc_api:blen|BLen]] 
-  * [[logicpython:cubloc_api:checkbf|CheckBf]] 
-  * [[logicpython:cubloc_api:get|Get]] 
  
logicpython/cubloc_api/getcrc.1775786798.txt.gz · Last modified: by 127.0.0.1