Invert incoming? - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Invert incoming? (/showthread.php?tid=1811) |
Invert incoming? - kenjirosama - 26.12.2018 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) RE: Invert incoming? - admin - 26.12.2018 Second input for XOR must be 1, not 0. RE: Invert incoming? - kenjirosama - 26.12.2018 (26.12.2018, 13:01)admin Wrote: Second input for XOR must be 1, not 0.Yes that was what i thought. Unfortunately that doesn´t change the output. The output remains the same regardless. The output from Xor is 0 regardles of input value and/or value of second input. RE: Invert incoming? - Daniel - 27.12.2018 Use filter and you have not output. Or just add not to grp.write('1/1/1), not threshold1) RE: Invert incoming? - kenjirosama - 27.12.2018 (27.12.2018, 09:06)Daniel. Wrote: Use filter and you have not output. Or just add not to grp.write('1/1/1), not threshold1) Thank you very much for your reply. Unfortunately I don´t undestand what your saying. Where in the code should this be? Tried filters from the Fb editor but there are no filters that can invert an incoming signal. The filters are only active part of the time ie if a 1 comes in or a 0 but not both. Probably I have misunderstod something. As I am not accumstomed with the code I am working in the Fbeditor. Thx RE: Invert incoming? - Daniel - 28.12.2018 (27.12.2018, 17:59)kenjirosama Wrote:Filter on-on/off-off will invert input if you set output to output_not.(27.12.2018, 09:06)Daniel. Wrote: Use filter and you have not output. Or just add not to grp.write('1/1/1), not threshold1) If you want to do it in script then delete your xor and generate then open this script (in scripting tab) and change line 13 to Code: grp.write('32/1/5', not threshold1) RE: Invert incoming? - kenjirosama - 28.12.2018 (28.12.2018, 09:57)Daniel. Wrote:Thank you!!!(27.12.2018, 17:59)kenjirosama Wrote:Filter on-on/off-off will invert input if you set output to output_not.(27.12.2018, 09:06)Daniel. Wrote: Use filter and you have not output. Or just add not to grp.write('1/1/1), not threshold1) |