150
10.
HDL protocol integration in Logic Machine 3
Note!
Please contact Embedded Systems team to receive a special package to integrate HDL
support into your LM2. Once you have the file, add it in
Network configuration -> System ->
Packages
.
10.1.
HDL function
Add HDL script in
Scripting -> Tools -> User function library
1.
HDL
={
2.
-- destination ip
3.
dstip
=
'192.168.1.7'
,
4.
-- packet constant data
5.
magic
=
'HDLMIRACLE'
,
6.
lcode
=
string.char
(
0xAA, 0xAA
)
,
7.
-- source device settings
8.
srcsubnet
=
1
,
9.
srcdevice
=
254
,
10.
devicetype
=
0xFFFE,
11.
-- command types
12.
cmd
={
13.
chanreg
=
0x0031,
-- single channel regulate
14.
chanregreply
=
0x0032,
-- single channel regulate answerback
15.
chanstat
=
0x0033,
-- read status of single channel targets
16.
chanstatreply
=
0x0034,
-- single channel targets status answerback
17.
}
18.
}
19.
20.
HDL.init
=
function
()
21.
require
(
'json'
)
22.
require
(
'crc16'
)
23.
require
(
'socket'
)
24.
25.
local
ip, chunk, chunks, data
26.
-- read interface data
27.
data
=
json.pdecode
(
io
.readproc
(
'if-json'
))
28.
29.
ifnot
data
ornot
data.eth0
then
30.
error
(
'cannot get interface data'
)
31.
end
32.
33.
-- ip header
34.
HDL.iphdr
=
''
35.
-- broadcast address
36.
HDL.bcast
=
data.eth0.bcast
37.
Summary of Contents for LogicMachine3 Re:actor
Page 10: ...10 Terminal connection schemes KNX TP...
Page 12: ...12 24V power supply...
Page 13: ...13 Analog inputs e g reed contact...
Page 14: ...14 Analog inputs 0 10V...
Page 15: ...15 Digital output...
Page 16: ...16 Resistive sensor input...
Page 17: ...17 Analog output...
Page 26: ...26 Make sure that bus status is Online press button in ETS...
Page 35: ...35 o Then minimize side bar by pressing on left arrow icon to make the map more visible...
Page 83: ...83 66 if err then 67 alert FTP upload failed s err 68 end...
Page 107: ...107...
Page 108: ...108 1 14 Help Documentation for scripting syntaxes is displayed in Help tab...
Page 126: ...126 Datapoints can be shown also in a way of table which can be later exported as CSV file...
Page 141: ...141...