# Visual Basic > Visual Basic .NET > VS 2019 Knowing the address of a read value from Modbus

## Vizier87

Hi everyone,

First question:
Do values read from the modbus correspond to the tabulated address in a device's manual? Eg the device I'm trying to read has a modbus communication table address table which begins with the initial address 0x0300, and then progresses to 0x0396 for a certain segment. Here's a snapshot:


So if I read using ModC.ReadHoldingRegisters(0,0), am I getting the value from 0x0300 first?

Second question:
May I know if there is a way to know the value of the address I'm getting the values from in Modbus-TCB via EasyModbus?

I can technically read the values if I'm entering let's say, 0 in the lower and 10 in upper values for ModC.ReadHoldingRegisters. 

However, it would be much better for me to be able to read the addresses as well. 

Here's my code:


```
Imports EasyModbus


Public Class Form1

    Dim ModC As New ModbusClient

    Private Sub ButtonConnect_Click(sender As Object, e As EventArgs) Handles ButtonConnect.Click



        Try
            ModC.IPAddress = TextBoxIP.Text
            ModC.Port = TextBoxPort.Text
            ModC.Connect()

            If ModC.Connected Then
                LabelStatus.Text = "Connected"
                MsgBox("Success!")
            End If
        Catch ex As Exception
            LabelStatus.Text = "Error connecting"
            'MsgBox("Error")
        End Try



        'TimerRead.Start()
    End Sub

    Private Sub BtnDisconnect_Click(sender As Object, e As EventArgs) Handles BtnDisconnect.Click


        ModC.Disconnect()

    End Sub



    Private Sub ButtonRead_Click(sender As Object, e As EventArgs) Handles ButtonRead.Click

        Try
            Dim regvals As Integer()
            regvals = ModC.ReadHoldingRegisters(TextBoxStartReg.Text, TextBoxLengthReg.Text)


            If regvals.Length > 0 Then
                ListBoxRegValues.Items.Clear()

                For Each value As Integer In regvals
                    ListBoxRegValues.Items.Add(value)

                Next

            End If

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

    End Sub




End Class
```

Thanks guys!
Vizier87

----------


## Vizier87

Bumping... anyone?

----------


## schoemr

Hi Vizier,

Regarding your first question.

In the Modbus function *ReadHoldingRegisters* - the first argument specifies the address of the device, and the second argument specifies the starting address of the registers you want to read. So, if you call ReadHoldingRegisters(0,0), you are specifying that you want to read from device with address 0, starting at register address 0.

To read from the registers (in the device's manual) that have addresses starting at 0x0300, you would need to specify the starting address as 4864 (0x0300 in hexadecimal is equivalent to 4864 in decimal).

eg. to read the first 10 registers starting at 0x0300, you would call ReadHoldingRegisters(0,4864).

Aslo, the addresses used in the Modbus function calls are decimal (not hexadecimal) You must convert the hexadecimal addresses in the manual to decimal before using them in your Modbus function calls.

----------

