This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Problem with rs485-3
#1
Hi all,

I have a LM5p2-KC and have a problem with the third rs485 port (rs485-3), it doesn't work. When i connect the modbus device to port rs485-2 does it works, so the modbus device en profile are OK.

I removed the genohm-scada-enocean package. But it doesn't make a difference.
Can somboddy help me whit this?

Regards Gijs
Reply
#2
Connect RS485-2 and RS485-3 A/B wires together and run this self test script. It will tell whether the port is working correctly or not:
Code:
require('serial')

port1 = serial.open('/dev/RS485-2', { duplex = 'half' })
port2 = serial.open('/dev/RS485-3', { duplex = 'half' })

str = '1234567890'
ok = true

function test(p1, p2)
  p1:flush()
  p2:flush()

  for i = 1, 100 do
    p1:write(str)
    local res = p2:read(#str, 1)
    ok = ok and res == str
    if not ok then
      break
    end
  end
end

test(port2, port1)
test(port1, port2)

alert('RS485 self test ' .. (ok and 'OK' or 'ERROR'))
Reply


Forum Jump: