News:

  • May 15, 2025, 03:51:15 PM

Login with username, password and session length

Poll

Need to know why I'm getting a timed out exception

Modbus
0 (0%)
Serial testing
0 (0%)

Total Members Voted: 0

Author Topic: Modbus DLL Serial Communication w/ DL205  (Read 3333 times)

bhubb

  • Newbie
  • *
  • Posts: 1
Modbus DLL Serial Communication w/ DL205
« on: April 06, 2010, 01:31:15 PM »
I'm trying to communicate with the serial port on a dl205. My Ethernet communication works fine,
however, I'm getting a timeout exception with serial. I'm trying to access a memory location (v2000)
and read the status numeric value. I have already trimmed off the first character and converted it to
decimal. I've done some testing and the port is open, but times out. I'll provide my directserialconnect
block of code written in VB.NET. Any suggestions would be appreciated.

Private ControlDirectEthernet As ModbusTcpMaster
    Private DirectSerialCommunication As ModbusSerialMaster

Private Function DirectSerialConnect() As Boolean
        Dim DirectSerialPort As System.IO.Ports.SerialPort  

        DirectSerialPort = New System.IO.Ports.SerialPort()
        DirectSerialPort.PortName = "COM1"
        DirectSerialPort.BaudRate = 9600
        DirectSerialPort.Parity = IO.Ports.Parity.Odd
        DirectSerialPort.DataBits = 8
        DirectSerialPort.StopBits = IO.Ports.StopBits.One
        DirectSerialPort.ReadTimeout = 2000
        DirectSerialPort.Open()

        Try
            DirectSerialCommunication = Modbus.Device.ModbusSerialMaster.CreateAscii(DirectSerialPort)

            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function


There are no comments for this topic. Do you want to be the first?