Inter-instrument communicaton not working?

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
Detlef
Posts: 304
Joined: Mon Nov 16, 2020 9:43 am
Location: Bavaria

Inter-instrument communicaton not working?

#1 Post by Detlef »

Hello,

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)
 
I get this result:
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

Detlef
Posts: 304
Joined: Mon Nov 16, 2020 9:43 am
Location: Bavaria

Re: Inter-instrument communicaton not working?

#2 Post by Detlef »

Hi again,

I spent two hours or so yesterday trying to get my instruments with inter-instrument communication working. Then with my previous post I thought I just try the example from the documentation, and as stated that also did not work here.

BUT... just now I saw, as soon as there is a connection to the simulator (FS2020 in my case), si_variable_create, _write and _subscribe do work! Oh boy.

Thank you
Detlef

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Inter-instrument communicaton not working?

#3 Post by Sling »

Hi Detlef,

The Inter instrument API functions require the plug-in to be running. Meaning the sim needs to be running. Basically instruments communicate through the plug-in. You are not the first and certainly will not be the last to be caught by this.

Post Reply