This are the (new) Support Forums for FSUIPC and related products.

These forums replace the old support forums which have been running for 20+ years. The old forums contain a wealth of information on all FSUIPC products, and are still available (until the end of the year) for read-only here.

At the moment these new forums are quite empty – I will be updating the FAQ section and copying across the User Contributions from the old forums in the next few months.

Please note that you will need to Register and Login to post for support, and also to download attachments. You can view these forums without registering.

Support is also available via Discord. Please use the following invite link to join the FSUIPC Discord server:
                           https://discord.gg/zjwUTrxmmE

Notifications
Clear all

Log only specific L:Vars in a display window for gauge debugging

(@fsuipc-support)
Posts: 86
Moderator
Topic starter
 

I have always wanted to have a "quick and dirty" way to monitor specific L:VARs without installing a new gauge and trying to find the ones needed by scrolling etc. Perfect for things like programming sub-systems and such.

 

It's a 3 step process.

  • Run "LVARS_2_TXT.lua" to get the full list (output = "ALL LVARS.txt") of L:VARs currently loaded by the selected aircraft. It's a "run once" lua but, one can use it multiple times if multiple aircraft projects are being done as it appends to the file. (creates a master list) -OR- Run the FSUIPC command "List local panel variables" to do the same and written to the FSUIPC log (Formatting necessary!) , without using  "LVARS_2_TXT.lua" - The former provides a pre-formatted, easy to use output.
  • Pick the LVARs needed to monitor and copy them over into the array in "LVAR_SPECIFIC.lua". NOTE - The output in "ALL LVARS.txt" are pre-formatted for an easy copy --> paste. See notes in lua. Note - The lua display will truncate anything after 1023 characters so if this starts happening reorder your list in priority order.
  • Run  "LVAR_SPECIFIC.lua" to monitor your selected L:VARs.

LVARS_2_TXT.lua

-- "LVARS_2_TXT" Loaded LVARs writer, by Roman Stoviak, September 2015
 
-- Open an exisitng "All LVARS.txt" file to append to, or create it if it doesn't exist.
-- It will go into the Modules folder because I've not included a full path (like "C:\....")
-- By using "assert" you get an error message if this fails
 
f = assert(io.open("ALL LVARS.txt","a+"))
 
-- get aircraft name and air file name
air, title = ipc.readStruct(0x3C00, "256STR", "256STR")
air = air:gsub('%z','')
title = title:gsub('%z','')
 
-- write the text headings
f:write("_______________________________________________________________\nTITLE,      AIR FILE\n" .. title .. ",      " .. air .. "\n_______________________________________________________________\n")
 
i = 0
while i < 65536 do     
name = ipc.getLvarName(i) 
if name ~= nil then
f:write("\"" .. name .. "\",\n")
i = i + 1
else 
break
end
 
end
 
-- tidy up at end ...
f:write("\n____________________   END OF LIST   ____________________\n\n")
f:close()
 
ipc.display("A pre-formatted L:VARs list has been created as FSX/Modules/ALL LVARS.txt", 0, 3)
ipc.sleep(3000)
 
-- end of program

 

LVAR_SPECIFIC.lua

Note - The lua below has the array preloaded with L:VARs "test1" thru "test4" as an example. 

-- "MONITOR SPECIFIC LVARS" fsuipc display, by Roman Stoviak, September 2015

--[[
NOTES -
Enter each L:VAR to monitor by getting the "preformated" list provided by "LVARS_2_TXT.lua". Each L:VAR name MUST be surrounded in quotes and followed by a comma for each the array entry(s). One could use a single line for each L:VAR -or- Place all the L:VARs inline.

EX. separate lines
"test1",
"test2",
"test3",
"test4",

EX. same line
"test1","test2","test3","test4",

PLACE THE L:VAR LISTING IN THE ARRAY BELOW BETWEEN THE 2 COMMENTS CONTAINING "!!!!!"

END NOTES   
]]


local monitor = { 
-- COMMENT   !!!!! START ARRAY ON NEXT LINE !!!!!
"test1",
"test2",
"test3",
"test4",
-- COMMENT   !!!!! END ARRAY !!!!!
		   }

local size = table.getn(monitor)

while 1 do
local i = 1
local out = ""
local disp = ""
	repeat
		out = ipc.readLvar(monitor[i])
		if out == nil then  -- NEW SECTION TO KEEP LUA ALIVE IN CERTAIN SITUATIONS
			out = "no value"
		end
		disp = disp .. monitor[i] .. " = " .. out .. "\n"
		i = i + 1            
	until i == size + 1
	ipc.display(disp)		 
ipc.sleep(50)
end

 

Follow-up:  Last night I decided to automate it a little more..

  1. If I am going to run LVARS_2_TXT.lua doesn't it mean I want to see the output ALL LVARS.txt instantly?
  2. If I am going to read the output ALL LVARS.txt it doesn't it mean I want to modify LVAR_SPECIFIC.lua to include new Lvars to monitor?
  3. Why not open them up right away instead of navigating to them?

Below is the last section of  LVARS_2_TXT.lua to make this happen.. Remember to change paths/programs to suit what's needed!

-- tidy up at end ...
f:write("\n____________________   END OF LIST   ____________________\n\n")
f:close()

ipc.display("A pre-formatted L:VARs list has been created as FSX/Modules/ALL LVARS.txt", 0, 1)
ipc.sleep(1000) 

-- CHANGE PATHS/PROGRAMS TO SUIT !!!!!!!
handle, error = ext.runif("E:/Notepad++/notepad++.exe","G:/FSX/Modules/ALL LVARS.txt")
handle2, error2 = ext.runif("E:/Notepad++/notepad++.exe","G:/FSX/Modules/LVAR_SPECIFIC.lua")

-- UNCOMMENT BELOW IF TEXT PROGRAMS DO NOT START - GET WINDOWS ERROR CODES
-- ipc.display(handle .. error .. "\n" .. handle2 .. error2, 0, 5)
-- ipc.sleep(5000)

-- end of program

 

[Originally contributed in old SimMarket support forums by Roman Stoviak / spokes2112]


This topic was modified 20 hours ago by FSUIPC Support
 
Posted : November 12, 2025 1:41 pm