18.05.2018, 11:01
(18.05.2018, 10:46)admin Wrote: It might be that array input order is not defined. Try this instead:
Code:ports = {}
for _, p in ipairs(data.result.ports) do
ports[ p.port ] = p.state
end
grp.checkwrite('1/1/1', ports['ext1.input1'])
grp.checkwrite('1/1/2', ports['ext1.input2'])
it did work, i just didn`t change the port number.
it was on 1 and 2 and i didn`t change it. so when changing to 4 and 7 it worked perfectly.
the reason why it worked on 2 is becouse relay 1 is linked to ext.input 1 in the getface.
[1] led_secured
[2] relay1
[3] output1
[4] input1
[5] ext1.relay1
[6] ext1.relay2
[7] ext1.input1
[8] ext1.input2
Thanks, for all the help!
BR Even.