Yesterday, 14:16
(This post was last modified: 9 hours ago by stonecroft.)
Hello.
I use this script to send UDP commands to a Pharos Designer LPC and it works fine.
Now I need to recieve status from the Pharos controler via UDP.
Seartch the forum but cant find any good start. Someone who has an example?
I use this script to send UDP commands to a Pharos Designer LPC and it works fine.
Now I need to recieve status from the Pharos controler via UDP.
Seartch the forum but cant find any good start. Someone who has an example?
Code:
value = event.getvalue()
if (value == 0) then
scen = 'fran'
elseif (value == 1) then
scen = 'scen01'
elseif (value == 2) then
scen = ' scen02'
elseif (value == 3) then
scen = ' scen03'
elseif (value == 4) then
scen = ' scen04'
elseif (value == 5) then
scen = ' scen05'
elseif (value == 6) then
scen = 'scen06'
elseif (value == 7) then
scen = ' scen07'
elseif (value == 8) then
scen = ' scen08'
elseif (value == 9) then
scen = ' scen09'
elseif (value == 10) then
scen = ' scen10'
elseif (value == 11) then
scen = ' scen11'
elseif (value == 12) then
scen = ' scen12'
elseif (value == 13) then
scen = ' scen13'
elseif (value == 14) then
scen = ' scen14'
elseif (value == 15) then
scen = ' scen15'
elseif (value == 16) then
scen = ' scen16'
elseif (value == 17) then
scen = ' scen17'
elseif (value == 18) then
scen = ' scen18'
elseif (value == 19) then
scen = ' scen19'
end
ip = '172.16.61.90'
port = 5000
local sock = require('socket').udp()
if sock then
sock:setoption('broadcast', true)
sock:sendto(scen, ip, port)
sock:settimeout(200)
data = sock:receive()
sock:close()
end
return data