26.12.2018, 11:30
Hi.
Have done a simple script with the Fbeditor but I can´t get it to work so I am doing something wrong.
I have a LUX value and have used the Hysteresis tp create limits when to tuirn on my outdoor lighting.
The problem is that the output value is a 0 when it has gone below a certain LUX value but I need it to be a 1 and vice versa.
Have used an Xor to invert the value but I get the same output from the Xor regardless of my setting.
I also get the same output from my Xor from Output and from Output Not, always.
Any Ideas?
Have done a simple script with the Fbeditor but I can´t get it to work so I am doing something wrong.
I have a LUX value and have used the Hysteresis tp create limits when to tuirn on my outdoor lighting.
The problem is that the output value is a 0 when it has gone below a certain LUX value but I need it to be a 1 and vice versa.
Have used an Xor to invert the value but I get the same output from the Xor regardless of my setting.
I also get the same output from my Xor from Output and from Output Not, always.
Any Ideas?
Code:
FB Resident (sleep 5)
require('custom.fbeditor20.Control')
Input = grp.getvalue('2/1/1')
Limit_1_ON = 110
Limit_1_OFF = 130
Limit_2_ON = nil
Limit_2_OFF = nil
Limit_3_ON = nil
Limit_3_OFF = nil
threshold1, threshold2, threshold3 = fbe_hysteresis_3_limits(Input, Limit_1_ON, Limit_1_OFF, Limit_2_ON, Limit_2_OFF, Limit_3_ON, Limit_3_OFF, 'fb__Ljus_ute__fbe_hysteresis_3_limits__id')
if threshold1 ~= nil then
grp.write('32/1/5', threshold1)
end
FB Resident (sleep 3)
require('custom.fbeditor20.Gate')
functions_Gate_json_fbe_XOR_input_1 = grp.getvalue('32/1/5')
functions_Gate_json_fbe_XOR_input_2 = 0
functions_Gate_json_fbe_XOR_input_3 = nil
functions_Gate_json_fbe_XOR_input_4 = nil
functions_Gate_json_fbe_XOR_input_5 = nil
functions_Gate_json_fbe_XOR_input_6 = nil
functions_Gate_json_fbe_XOR_input_7 = nil
functions_Gate_json_fbe_XOR_input_8 = nil
out, out_not = fbe_XOR(functions_Gate_json_fbe_XOR_input_1, functions_Gate_json_fbe_XOR_input_2, functions_Gate_json_fbe_XOR_input_3, functions_Gate_json_fbe_XOR_input_4, functions_Gate_json_fbe_XOR_input_5, functions_Gate_json_fbe_XOR_input_6, functions_Gate_json_fbe_XOR_input_7, functions_Gate_json_fbe_XOR_input_8, 'fb__Ljus_ute__fbe_XOR__id')
if out ~= nil then
grp.write('32/1/3', out)
end
if out_not ~= nil then
grp.write('32/1/4', out_not)
end