I am trying to use si_variable functions. Somehow nothing works. Even if I try the example from the API documentation:
With this instrument code:
Code: Select all
-- Create the variable
var1 = si_variable_create("my_variable", "FLOAT", 5.0)
-- This function will be called when new data is available from another instrument
function new_data_callback(data1)
print("New data1: " .. data1)
end
-- Subscribe to the global variable
si_variable_subscribe("my_variable", "FLOAT", new_data_callback)
si_variable_write(var1, 6.0)
INFO - New data1: 0.0
What I expect is:
INFO - New data1: 5.0
INFO - New data1: 6.0
Am I forgetting something or is it a bug?
Thank you
Detlef