raywing Posted August 11, 2015 Share Posted August 11, 2015 When I studied the UDP protocol of AM, I found a tricky usage of AM. AirManager use port 55557 for communicating with the FSXplugin , and 55556 with xplane plugin. when you use xpl_command("string_with_value"), you can receive a string include "string_with_value" on FSX machine @port 55556. In this case, you can write a LUA script in your FSX/P3D module directory which is created by FSUIPC, and establish a UDP socket to receive the string, and trigger your ipc.writeXXXX functions!!! -- FSX UDP data transfer program local socket = require "socket" local udp = socket.udp() local port = 55556 -- Use this port to receive data from AirManager udp:settimeout(0) udp:setsockname('*', port) --Make the machine with the port for receiving flight data from AM local data, msg_or_ip, port_or_nil local running = true while running do data, msg_or_ip, port_or_nil = udp:receivefrom() -- get data from Air Manager if string.sub(data, "string") == "string" then ipc.writeLvar("Lvar name", value) -- e.g. ipc.writeDBL (offset, value) -- e.g. end elseif msg_or_ip ~= 'timeout' then print("Unknown network error: "..tostring(msg_or_ip)) end socket.sleep(0.050) -- pause for 50ms end I successfully use this trick to write a Instrument (actually is a UI) for Flight Plan control panel and show some flight data. Link to comment Share on other sites More sharing options...
raywing Posted August 14, 2015 Author Share Posted August 14, 2015 P.S. - Now, the flight control panel is running on my win8 pad and wireless control my cockpit so cool!! Link to comment Share on other sites More sharing options...
LNRalph Posted August 15, 2015 Share Posted August 15, 2015 We're are researching LVAR's and offsets at the moment, and we'll probably come up with our own system. Might be with release 2.2 but there's a small chance it will be sooner. Link to comment Share on other sites More sharing options...
Guest sikorsky77 Posted September 27, 2015 Share Posted September 27, 2015 Hi Raywing That means we could also read Offset or Lvar with Ipc.read..(....) and send them to Air Manager ??? for example turn a button in cockpit and interact with element of an Air manager gauge Best regards Thierry Link to comment Share on other sites More sharing options...
Corjan Posted October 2, 2015 Share Posted October 2, 2015 Hi, We have the plan to include LVAR support in the next AM 2.1.1 release. I have the system working, but it still needs tweaking to get it working with all the versions of FSX. Subscribing to a LVAR is exactly the same as subscribing to a normal SimConnect variable: Example: function callback(value) print("value = " .. tostring(value)) end fsx_variable_subscribe("L:AirspeedIndicatedNeedle", "NUMBER", callback) This way you can also mix and match SimConnect and LVAR's. All within the same callback function. Kind regards, Corjan Link to comment Share on other sites More sharing options...
raywing Posted October 12, 2015 Author Share Posted October 12, 2015 Hi Raywing That means we could also read Offset or Lvar with Ipc.read..(....) and send them to Air Manager ??? for example turn a button in cockpit and interact with element of an Air manager gauge Best regards Thierry No, AM does not announce the UDP port for receiving data, and also the format of the data, so you can not send data to AM. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.