B4A Code Snippet ✅ Modbus CRC-16 / CRC16 checksum function - Peter Simpson    Dec 11, 2025   (11 reactions) SubName: Modbus CRC-16 is used to ensure data integrity in Modbus RTU (Remote Terminal Unit... bitwise operations to generate a 16-bit CRC checksum, and outputs the checksum value as a hexadecimal string. The following code calculates the Modbus RTU CRC-16 (LSB-first / little-endian), the standard CRC (Cyclic Redundancy Check) used for Modbus frames. Let's use 010107DE000A as an example to calculated it's Modbus CRC-16 checksum value, which is 43 DD. Dim BC As ByteConverter Dim... B4J Question Calculating CRC16-CCITT FCS to match C implementation [solved] - Didier9    Sep 2, 2020 I need to calculate a CRC on a block of data that matches a CRC calculation done in an 8 bit microcontroller (8051 using Keil C51 compiler).
The CRC is calculated on a block of 512 bytes according to... B4A Question Modbus CRC16 calculation - FreeWolF    Apr 10, 2014 Hello, I have to calculate the CRC16 of a MODBUS string. Unfortunately I have no idea how can I do... Function CRC(buf() As Byte, lbuf As Integer) As Integer
'... B4A Question CRC16A problrem - Theera    Jan 24, 2023 I would like the experts to help me about the code ,I have VB6.0 code is
Function CRC16A(buffer() As Byte) As Long
Dim i As Long
Dim Temp As Long
Dim crc As Long
Dim j As Integer
crc... B4R Question polynomial CRC8 - peacemaker    Apr 11, 2022 Hi, All
Some i2C sensor chips use such CRC check.
How to calculate such CRC ?
- initial value=0xFF, polynomial=(x8 + x5 + x4 + 1) ie 0x31 CRC = 1+X4+X5+X8
*/
/**************************************************************************/
bool AHTxx::_checkCRC8()
{
{
uint8_t crc = 0xFF;... 6; byteIndex ++) //6-bytes in data, {status, RH, RH, RH+T, T, T, CRC}
{
crc ^= _rawData;... B4A Question String CRC32 - KZero    Feb 14, 2015 Hi,
Sub Crc16(Txt As String) As String
Dim Crc As Int : Crc = 0xFFFF
Dim bytes() As Byte
bytes=Txt.GetBytes("UTF8")
For i = 0 To bytes.Length - 1
Crc = Bit.Xor... B4A Code Snippet Get CRC32 from File - wonder    Apr 30, 2019   (4 reactions) Libs: - Reflection - FastIO (ProBundle) - ByteConverter Sub CRC32(filename As String) As String Dim r As Reflector Dim io As FastIO Dim bc As ByteConverter Dim data() = io.ReadArray(filename, 1024) As Byte r.Target = r.CreateObject("java.util.zip.CRC32") r.RunMethod4("update", Array As Object(data), Array As String(" Dim CRCLong = r.RunMethod("getValue") As Long Dim CRCBytes() = bc.LongsToBytes(Array As Long(CRCLong)) As Byte... B4J Code Snippet CRC32 - emexes (first post)    Mar 15, 2026
it is not generating the correct values
I tried it with the 10-byte ASCII string ABCDE12345 and it has generated the same 32-bit CRC 2782edd3 as PKZIP generates, which is good enough for me.
Dim... B4A Question CRC-16 algorhitm checksum - Lello1964    Nov 16, 2019 I must calculate crc-16 checksum using a forward CRC-16 algorithm with the polynomial (X16 + X15 + X2 + 1) initialised using the seed 0xFFFF.
example :
0x90 0x01 0x11
crc= 0x26 0x03... Other CRC CCITT - udg    Jun 10, 2018 Hi all,
I found this snippet and it could be the right function for my case at hand.
Just one question: can you confirm that it will return, as the calculated CRC, a number between 0 and 65536, indipendetly of the given data, or will it extend to all the possible integer range, including negatives?
Row showing
CRC = Bit.And(CRC, 32767) * 2
let me believe it will top 65534. I ask here because... Page: 1   2   3   4   |