﻿Option Strict Off
Option Explicit On
Imports System.Runtime.InteropServices

Module MODBURTU
    '============================================================-
    ' MODBUSRTU.VB
    ' Headder file for CONTEC
    '                                              CONTEC.Co.,Ltd.
    '============================================================-

    '-------------------------------------------------------------
    'Function Prototype
    '-------------------------------------------------------------
    'ModbusRTU Function
    <DllImport("modbus.dll", CallingConvention:=CallingConvention.Cdecl)>
    Public Function modbus_new_rtu(device As String, baud As Integer, parity As Char, data_bit As Integer, stop_bit As Integer) As IntPtr
    End Function

    ' ----------------------------------------
    ' Parameters
    ' ----------------------------------------
    ' ----------------------------------------
    ' TCP MODBUS ADU
    ' ----------------------------------------
    ' 253 bytes + MBAP (7 bytes) = 260 bytes
    Public Const MODBUS_TCP_MAX_ADU_LENGTH As Integer = 256

End Module
