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 that you accept these cookies being set.

RS232 - DAYTON AMP
#1
Hello guys, 

I'm trying to integrate Dayton amp with the LM5 through RS232, I don't know what's wrong. 

I have created a virtual point to send an on-off command  to zone 1, but it didn't work.
in the bellow picture of the registers of the amp.

this is the script that i have used 

require('serial')

device = '/dev/RS232'

port = serial.open(device, { baudrate = 9600, parity = 'none', databits = 8, stopbits = 1  })

-- get value of KNX object
value = event.getvalue()

if (value == true) then
  -- send power on command with returns to make them stick
  char = "<01PR01\r" 
  port:write(char)
else
  -- send power off command
  char = "<01PR00\r" 
  port:write(char)
end

-- close port
port:close()


       
Reply
#2
The code looks correct. Check the cables, maybe RX/TX has to be swapped?
Reply
#3
(16.09.2021, 07:33)admin Wrote: The code looks correct. Check the cables, maybe RX/TX has to be swapped

I did that and nothing change.
Reply
#4
(16.09.2021, 07:33)admin Wrote: The code looks correct. Check the cables, maybe RX/TX has to be swapped?

Hi, 
I have contacted the DAYTON technical support team about the problem however they gave me software to send the commands from it, and after sending the commands from their software it worked from the LM5  Smile
Please, in the pic below there's a guide, how to read the status of the AMP from the RS232.
   
1- write '?xx' (xx is the number of the zone) 
2- after I write  it, I will receive  a reply command that contains 23 characters 
 I want to take two characters from that string for example (12,13) and write that value in a 1byte virtual object ;
Could you help me to do that?
Reply
#5
Try this, the status type is not described so it's assumed to be a hexadecimal number which converted from a string via tonumber(). 24 characters are read: 23 data characters + CR.

Code:
port:write('?01\r')
resp = port:read(24, 1)

if resp and #resp == 24 then
  data = resp:sub(12, 13)
  data = tonumber(data, 16)

  grp.update('32/1/1', data)
end
Reply


Forum Jump: