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.

Comparator Error
#5
In the backup you sent me the second Grater than had no input selected but you have it on the photo above.

The problem you have here is as fallow. When linking output with a input you are using storage to transfer data. Originally you created the logic without the 8bit to 1byte and this logic is simply a script running in LM. When you use a storage the order is important as first you must create the storage and then you should read it. The way how block order works in FB is simply last block goes on the end of the script.  Here is the problem all 3 8bit to 1byte are on the end and in this block you crate the storage but Grater then are above and trying to read empty storage which never was created.  I eddied the script and moved the block higher.  No errors now.

Code:


require('custom.fbeditor20.Converter')

require('custom.fbeditor20.Comparator')

require('custom.fbeditor20.Select_switch')

require('custom.fbeditor20.Gate')



functions_Comparator_json_fbe_not_equal_input_1 = grp.getvalue('0/0/10')

functions_Comparator_json_fbe_not_equal_input_2 = 1

out, out_not = fbe_not_equal(functions_Comparator_json_fbe_not_equal_input_1, functions_Comparator_json_fbe_not_equal_input_2, 'fb__Ventilation__fbe_not_equal__id')

storage.set('fb__Ventilation__fbe_not_equal__out', out)



functions_Gate_json_fbe_OR_input_1 = storage.get('fb__Ventilation__fbe_greater__out')

functions_Gate_json_fbe_OR_input_2 = grp.getvalue('4/1/2')

functions_Gate_json_fbe_OR_input_3 = nil

functions_Gate_json_fbe_OR_input_4 = nil

functions_Gate_json_fbe_OR_input_5 = nil

functions_Gate_json_fbe_OR_input_6 = nil

functions_Gate_json_fbe_OR_input_7 = nil

functions_Gate_json_fbe_OR_input_8 = nil

out, out_not = fbe_OR(functions_Gate_json_fbe_OR_input_1, functions_Gate_json_fbe_OR_input_2, functions_Gate_json_fbe_OR_input_3, functions_Gate_json_fbe_OR_input_4, functions_Gate_json_fbe_OR_input_5, functions_Gate_json_fbe_OR_input_6, functions_Gate_json_fbe_OR_input_7, functions_Gate_json_fbe_OR_input_8, 'fb__Ventilation__fbe_OR__id')

if out ~= nil then

   grp.write('3/5/50', out)

end





functions_Converter_json_fbe_8bit_to_byte_input_1 = grp.getvalue('1/1/6')

functions_Converter_json_fbe_8bit_to_byte_input_2 = 0

functions_Converter_json_fbe_8bit_to_byte_input_3 = 0

functions_Converter_json_fbe_8bit_to_byte_input_4 = 0

functions_Converter_json_fbe_8bit_to_byte_input_5 = 0

functions_Converter_json_fbe_8bit_to_byte_input_6 = 0

functions_Converter_json_fbe_8bit_to_byte_input_7 = 0

functions_Converter_json_fbe_8bit_to_byte_input_8 = 0

out = fbe_8bit_to_byte(functions_Converter_json_fbe_8bit_to_byte_input_1, functions_Converter_json_fbe_8bit_to_byte_input_2, functions_Converter_json_fbe_8bit_to_byte_input_3, functions_Converter_json_fbe_8bit_to_byte_input_4, functions_Converter_json_fbe_8bit_to_byte_input_5, functions_Converter_json_fbe_8bit_to_byte_input_6, functions_Converter_json_fbe_8bit_to_byte_input_7, functions_Converter_json_fbe_8bit_to_byte_input_8, 'fb__Ventilation__fbe_8bit_to_byte__id')

storage.set('fb__Ventilation__fbe_8bit_to_byte__out__2', out)



functions_Converter_json_fbe_8bit_to_byte_input_1 = grp.getvalue('1/1/7')

functions_Converter_json_fbe_8bit_to_byte_input_2 = nil

functions_Converter_json_fbe_8bit_to_byte_input_3 = nil

functions_Converter_json_fbe_8bit_to_byte_input_4 = nil

functions_Converter_json_fbe_8bit_to_byte_input_5 = nil

functions_Converter_json_fbe_8bit_to_byte_input_6 = nil

functions_Converter_json_fbe_8bit_to_byte_input_7 = nil

functions_Converter_json_fbe_8bit_to_byte_input_8 = nil

out = fbe_8bit_to_byte(functions_Converter_json_fbe_8bit_to_byte_input_1, functions_Converter_json_fbe_8bit_to_byte_input_2, functions_Converter_json_fbe_8bit_to_byte_input_3, functions_Converter_json_fbe_8bit_to_byte_input_4, functions_Converter_json_fbe_8bit_to_byte_input_5, functions_Converter_json_fbe_8bit_to_byte_input_6, functions_Converter_json_fbe_8bit_to_byte_input_7, functions_Converter_json_fbe_8bit_to_byte_input_8, 'fb__Ventilation__fbe_8bit_to_byte__id__1')

storage.set('fb__Ventilation__fbe_8bit_to_byte__out', out)



functions_Converter_json_fbe_8bit_to_byte_input_1 = storage.get('fb__Ventilation__fbe_not_equal__out')

functions_Converter_json_fbe_8bit_to_byte_input_2 = 0

functions_Converter_json_fbe_8bit_to_byte_input_3 = 0

functions_Converter_json_fbe_8bit_to_byte_input_4 = 0

functions_Converter_json_fbe_8bit_to_byte_input_5 = 0

functions_Converter_json_fbe_8bit_to_byte_input_6 = 0

functions_Converter_json_fbe_8bit_to_byte_input_7 = 0

functions_Converter_json_fbe_8bit_to_byte_input_8 = 0

out = fbe_8bit_to_byte(functions_Converter_json_fbe_8bit_to_byte_input_1, functions_Converter_json_fbe_8bit_to_byte_input_2, functions_Converter_json_fbe_8bit_to_byte_input_3, functions_Converter_json_fbe_8bit_to_byte_input_4, functions_Converter_json_fbe_8bit_to_byte_input_5, functions_Converter_json_fbe_8bit_to_byte_input_6, functions_Converter_json_fbe_8bit_to_byte_input_7, functions_Converter_json_fbe_8bit_to_byte_input_8, 'fb__Ventilation__fbe_8bit_to_byte__id__2')

storage.set('fb__Ventilation__fbe_8bit_to_byte__out__1', out)







Selector = storage.get('fb__Ventilation__fbe_greater__out__1')

Input_1 = 0

Input_2 = 4

out = fbe_input_selection_switch(Selector, Input_1, Input_2, 'fb__Ventilation__fbe_input_selection_switch__id')

if out ~= nil then

   grp.write('3/6/7', out)

end



functions_Gate_json_fbe_OR_input_1 = grp.getvalue('3/5/61')

functions_Gate_json_fbe_OR_input_2 = grp.getvalue('3/5/62')

functions_Gate_json_fbe_OR_input_3 = grp.getvalue('3/5/63')

functions_Gate_json_fbe_OR_input_4 = grp.getvalue('3/5/64')

functions_Gate_json_fbe_OR_input_5 = grp.getvalue('3/5/65')

functions_Gate_json_fbe_OR_input_6 = grp.getvalue('3/5/66')

functions_Gate_json_fbe_OR_input_7 = nil

functions_Gate_json_fbe_OR_input_8 = nil

out, out_not = fbe_OR(functions_Gate_json_fbe_OR_input_1, functions_Gate_json_fbe_OR_input_2, functions_Gate_json_fbe_OR_input_3, functions_Gate_json_fbe_OR_input_4, functions_Gate_json_fbe_OR_input_5, functions_Gate_json_fbe_OR_input_6, functions_Gate_json_fbe_OR_input_7, functions_Gate_json_fbe_OR_input_8, 'fb__Ventilation__fbe_OR__id__1')

storage.set('fb__Ventilation__fbe_OR__out', out)



functions_Select_switch_json_fbe_input_selection_switch_input_1 = storage.get('fb__Ventilation__fbe_OR__out')

functions_Select_switch_json_fbe_input_selection_switch_input_2 = 3

functions_Select_switch_json_fbe_input_selection_switch_input_3 = 1

out = fbe_input_selection_switch(functions_Select_switch_json_fbe_input_selection_switch_input_1, functions_Select_switch_json_fbe_input_selection_switch_input_2, functions_Select_switch_json_fbe_input_selection_switch_input_3, 'fb__Ventilation__fbe_input_selection_switch__id__1')

if out ~= nil then

   grp.write('3/5/70', out)

end



functions_Comparator_json_fbe_greater_input_1 = storage.get('fb__Ventilation__fbe_8bit_to_byte__out')

functions_Comparator_json_fbe_greater_input_2 = storage.get('fb__Ventilation__fbe_8bit_to_byte__out__1')

out, out_not = fbe_greater(functions_Comparator_json_fbe_greater_input_1, functions_Comparator_json_fbe_greater_input_2, 'fb__Ventilation__fbe_greater__id')

storage.set('fb__Ventilation__fbe_greater__out', out)



functions_Comparator_json_fbe_greater_input_1 = nil

functions_Comparator_json_fbe_greater_input_2 = storage.get('fb__Ventilation__fbe_8bit_to_byte__out__2')

out, out_not = fbe_greater(functions_Comparator_json_fbe_greater_input_1, functions_Comparator_json_fbe_greater_input_2, 'fb__Ventilation__fbe_greater__id__1')

storage.set('fb__Ventilation__fbe_greater__out__1', out)
------------------------------
Ctrl+F5
Reply


Messages In This Thread
Comparator Error - by olegrz - 05.09.2022, 09:02
RE: Comparator Error - by Daniel - 05.09.2022, 09:31
RE: Comparator Error - by olegrz - 05.09.2022, 15:31
RE: Comparator Error - by Daniel - 05.09.2022, 15:37
RE: Comparator Error - by Daniel - 06.09.2022, 08:44
RE: Comparator Error - by olegrz - 06.09.2022, 16:45

Forum Jump: