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.

Invert incoming?
#1
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?

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
Reply


Messages In This Thread
Invert incoming? - by kenjirosama - 26.12.2018, 11:30
RE: Invert incoming? - by admin - 26.12.2018, 13:01
RE: Invert incoming? - by kenjirosama - 26.12.2018, 13:35
RE: Invert incoming? - by Daniel - 27.12.2018, 09:06
RE: Invert incoming? - by kenjirosama - 27.12.2018, 17:59
RE: Invert incoming? - by Daniel - 28.12.2018, 09:57
RE: Invert incoming? - by kenjirosama - 28.12.2018, 11:46

Forum Jump: