CRC: ModBusCalculateRTUMessageCRCMBS

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

ModBusCalculateRTUMessageCRCMBS(data as string) as UInt16

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method Encryption and Hash MBS Util Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Calculates the RTU Message CRC string.
Example
dim m as new MemoryBlock(9)

m.UInt8Value(0) = 1 // start of package
m.UInt8Value(1) = 6 // command code
m.UInt8Value(2) = 0 // some data...
m.UInt8Value(3) = 0
m.UInt8Value(4) = 0
m.UInt8Value(5) = &h21
m.UInt8Value(6) = 0 // checksum comes here
m.UInt8Value(7) = 0
m.UInt8Value(8) = 4 // end of package

dim Data as string = m.StringValue(0,6)
dim CheckSum as Int16 = ModBusCalculateRTUMessageCRCMBS(data)

m.UInt16Value(6) = checksum

MsgBox EncodeHex(m)

The items on this page are in the following plugins: MBS Util Plugin.


💬 Ask a question or report a problem