Module modModbus
    '---------------------------
    '
    '---------------------------
    Public Const USERS232CLASS As Byte = 0
    Public Const USECOMMLIB As Byte = 1
    Public Const USESERIALPORTCONTROL As Byte = 2
    '---------------------------
    '
    '---------------------------
    Public Const MAX_RETRY_COUNT As Byte = 3
    '---------------------------
    'MODE
    '---------------------------
    Public Const ST_IDLE As Integer = 1
    Public Const ST_WAIT As Integer = 0

    '---------------------------
    'MODE
    '---------------------------

    '---------------------------
    'Define ASCII Value
    '---------------------------
    Public Const asciiNUL As Byte = &H0
    Public Const asciiSOH As Byte = &H1
    Public Const asciiSTX As Byte = &H2
    Public Const asciiETX As Byte = &H3
    Public Const asciiEOT As Byte = &H4
    Public Const asciiENQ As Byte = &H5
    Public Const asciiACK As Byte = &H6
    Public Const asciiBEL As Byte = &H7
    Public Const asciiBS As Byte = &H8
    Public Const asciiHT As Byte = &H9
    Public Const asciiLF As Byte = &HA
    Public Const asciiVT As Byte = &HB
    Public Const asciiFF As Byte = &HC
    Public Const asciiCR As Byte = &HD
    Public Const asciiSO As Byte = &HE
    Public Const asciiSI As Byte = &HF
    Public Const asciiDLE As Byte = &H10
    Public Const asciiDC1 As Byte = &H11
    Public Const asciiDC2 As Byte = &H12
    Public Const asciiDC3 As Byte = &H13
    Public Const asciiDC4 As Byte = &H14
    Public Const asciiNAK As Byte = &H15
    Public Const asciiSYN As Byte = &H16
    Public Const asciiETB As Byte = &H17
    Public Const asciiCAN As Byte = &H18
    Public Const asciiEM As Byte = &H19
    Public Const asciiSUB As Byte = &H1A
    Public Const asciiESC As Byte = &H1B
    Public Const asciiFS As Byte = &H1C
    Public Const asciiGS As Byte = &H1D
    Public Const asciiRS As Byte = &H1E
    Public Const asciiUS As Byte = &H1F
    Public Const asciiSPACE As Byte = &H20
    '----------------------------------------------------------
    Public Const FLAG_COMMAND As Byte = 255
    Public Const FLAG_NULL As Byte = asciiNUL
    Public Const FLAG_ACK As Byte = asciiACK
    Public Const FLAG_NAK As Byte = asciiNAK
    Public Const FLAG_US As Byte = asciiUS
    Public Const FLAG_RS As Byte = asciiRS
    Public Const FLAG_BEL As Byte = asciiBEL
    Public Const FLAG_ETB As Byte = asciiETB
End Module
