AM 4.0.2 si_variable_subscribe bug
Posted: Sat Jul 03, 2021 10:30 am
As the Subject suggested this is to report an issue with si_variable_subscribe() in the latest AM4 release version. When subscribing to an array type the correct values are not received. This code prints "Array contains 3 items. Data on first position is: 0.0".
Additionally the subscribe callback is called continuously even when data is not changing.
Additionally the subscribe callback is called continuously even when data is not changing.
Code: Select all
var1 =si_variable_create("my_variable", "FLOAT[3]", {0.2, 0.3, 0.4})
function new_data_callback(data1)
-- #data1 would give the array length
-- data[1] would give the first object in the array
print("Array contains " .. #data1.. " items. Data on first position is: " .. data1[1])
end
-- subscribe to the variable
si_variable_subscribe("my_variable", "FLOAT[3]", new_data_callback)