This sample application VB for monitoring Diris A20 power meter vendor by SOCOMEC,I use Modbus RTU protocol to communication between Diris A20 and VB.
first make Vb interface below:
write The source code below:
Dim CRCTable(0 To 511) As Byte
Dim CRC_Low, CRC_High As Byte
Private Sub CRC_16(ByVal Data As String, Length As Integer)
Dim i As Integer
Dim Index As Byte
CRC_Low = &HFF
CRC_High = &HFF
For i = 1 To Length