Jump to content
The simFlight Network Forums

Recommended Posts

Posted
Goodmorning everyone
any of you know if it is possible to use the MAJESTIC dash8 q400 variables with FSUIPC 5 for P3DV4?
thanks.
 

 

 

Posted
1 hour ago, toppe said:

any of you know if it is possible to use the MAJESTIC dash8 q400 variables with FSUIPC 5 for P3DV4?

What sort of "variables" are you talking about? If you mean L:Vars then I believe the LINDA add-on uses LVars for that aircraft. If you searched for answers you'd find this relevant thread:

You might also want to try Mouse Macros.

Pete

 

Posted
thanks for the answer Mr dowson
I was referring to the majestic Q400 variables, as I see PMDG also majestic has its variables, is it not possible to use them with FSUIPC? also they told me that macromouse are only for inputs and not for outputs, is it correct?
 
Posted
1 hour ago, toppe said:

I was referring to the majestic Q400 variables, as I see PMDG also majestic has its variables, is it not possible to use them with FSUIPC?

Sorry, I've no idea what your "Majestic Q400 variables" are!! PMDG has implemented a memory block sharable using SimConnect facilities to provide "variables" relating to settings, displays, values etc -- for cockpit builders -- but only for its Boeing series as far as I know. I've no idea if other add-on aircraft makers have done the same, but FSUIPC only supports this for the three Boeings from PMDG.

1 hour ago, toppe said:

macromouse are only for inputs and not for outputs, is it correct?

Yes, mouse Macros are used for inputs -- clicking buttons or changing dials on panels when no other commands are provided to do this.

If you explain yourself more clearly then maybe you get proper help.  I did ask you in my first reply what you were talking about. I still don't know -- all i now know is that you want some information OUT of the aircraft.. i've no idea what, or if they provide anything different than that already available in SimConnect and mapped to FSUIPC offsets.

Pete

 

Posted

You could try the log lvars.lua plugin (see the FSUIPC Lua Plug-Ins manual) which will list any lvars available for your aircraft. If any are listed, you can access these in lua and macro scripts.

John

 

Posted

Hi,

You can use the XML-Interface as documented by Majestic. It works in FSUIPC5 without any problem. So follow the documentation and you can access all variables.

Rgds
Reinhard

 

Posted

ok sorry pete
my problems are the outputs, i'm building a home cockpit of the DASH8 Q400 MAJESTIC, the variables have them all, the inputs I managed all of them, but I don't know how to do to be able to interface the outputs, (in practice all the leds of the airplane), my problem and only this, if you could help me somehow I would be grateful

Posted
14 minutes ago, toppe said:

if you could help me somehow I would be grateful

Looks like John and Reinhard have already both supplied excellent suggestions for you to follow. I don't think I can do better.

Pete

 

Posted
26 minutes ago, aua668 said:

Hi,

You can use the XML-Interface as documented by Majestic. It works in FSUIPC5 without any problem. So follow the documentation and you can access all variables.

Rgds
Reinhard 

 

 

thank you so much
in fact I have the list of XLM variables, but I don't know how to use them with fsuipc, in particular the output variables that are currently the most important, could you please explain in detail how can I use them with FSUIPC? which cards i can  use for the outputs, (I have output cards of the ULTIMARC PLACLED64) can I use those? if you can help me step by step I would be really grateful

Posted

Hi,

You need to write a small program in LUA to get values from the output variables. The best source to start is to check, how this was implemented in the Q400 module  of LINDA (great SW by the way - check AVSIM for it). There you will find a lot of source code, reading output values from the Q400.

LINDA Forum

In short words: You have to find out the hash value of the variable with the supplied tool. Then you set a specific Lvar with the hash value and you will get the return value in another specific Lvar. This procedure is documented in a ReadMe file supplied with the Q400.

Rgds
Reinhard

 

 

Posted
On 10/16/2019 at 1:22 PM, aua668 said:

Hi,

You need to write a small program in LUA to get values from the output variables. The best source to start is to check, how this was implemented in the Q400 module  of LINDA (great SW by the way - check AVSIM for it). There you will find a lot of source code, reading output values from the Q400.

LINDA Forum

In short words: You have to find out the hash value of the variable with the supplied tool. Then you set a specific Lvar with the hash value and you will get the return value in another specific Lvar. This procedure is documented in a ReadMe file supplied with the Q400.

Rgds
Reinhard

 

 

 

thanks  aua 668
my problem unfortunately is' WRITE A SMALL PROGRAM IN LUA, you know how I have to do to learn the necessary steps,  I have designed and built a cnc machine to be able to design and build all my aircraft panels, I am a pilot that has been flying for 30 years, I'm realizing that I have to become a programmer too
, if I want to see my dream come true, for me it's hard to be honest, it's my CRYPTONITE,... programs, variables, ofset etc, etc.
but thanks to you I realized that the LUA program is my necessary means to solve the problem, I ask you for the last advice (I don't want to monopolize your time) on how to create this program in LUA.
thank you so much
 
 

 

Posted

Hi,

In the included ZIP-File I added two files: One is a definition file for the XML-functions I use with my hardware. The numbers I got from the provided utility, which calculates the hash value for the specific variable.

The second file is a sample module, which toggles the TOGA button. For every button I have such a routine. In a master file, which is automatically started, I start all my modules for the Q400  with ipc.runlua("<<<modulename>>>")

For reading values from the XML interface I use one single module transferring all the necessary XML-Values into global variables, which later I can use in different modules. The core of the routine can be seen here:

-- initialize XML interface to HW

function readXMLIF ( pFunc )						-- function to read specific IF value

	local lMJC_readCode
	local lMJC_readValue
	local lCount = 0

	-- select function by hash code
	ipc.writeLvar("L:MJC_VAR_READ_CODE", pFunc)
	ipc.sleep(5)
	
	-- read results
	lMJC_readCode = ipc.readLvar("L:MJC_VAR_READ_CODE")
	
	-- wait if not ready
	while lMJC_readCode ~= 9991999 and lMJC_readCode ~= 9992999 and lCount < 20
	do
		lCount = lCount + 1
		ipc.sleep(10)
		lMJC_readCode = ipc.readLvar("L:MJC_VAR_READ_CODE")
	end

	if lMJC_readCode == 9991999 then
		lMJC_readValue = ipc.readLvar("L:MJC_VAR_READ_VALUE")	-- success
	else
		lMJC_readValue = 9992999								-- variable not found
		ipc.log("Error reading MJC interface for function "..pFunc)
	end
	
	return lMJC_readValue		-- return value or error

end


function readAllXMLValues()		-- synchronize global variables from Q400 values

	-- autopilot
	ipc.set ("Q400_YD_LIGHT" , readXMLIF ( 31461 ) )			-- AFCS_->outputs.YD_engaged
	ipc.set ("Q400_AP_LIGHT" , readXMLIF ( 31281 ) )			-- AFCS_->outputs.AP_engaged

	-- glare shield
	ipc.set ("Q400_CAUTION" , readXMLIF ( 143090 ) )			-- CautionWarning_->outs_.master_caution_light_blinking
	ipc.set ("Q400_WARNING" , readXMLIF ( 143112 ) )			-- CautionWarning_->outs_.master_warning_light_blinking

	-- fuel
	ipc.set ("Q400_AUX_FUEL" , readXMLIF ( 59590 ) )			-- Fuel_->systems[0].AuxFuelPumplight

	-- Autofeather
	ipc.set ("Q400_AUTO_FEATHER" , readXMLIF ( 41047 ) )		-- PCU_->AutofeatherSelectLight

	-- Hydraulic
	ipc.set ("Q400_HYDRAULIC" , readXMLIF ( 91735 ) )			-- Hydraulical_->outs_.stby_hydr_ON_indicator

end

while 0 < 1 do
	readAllXMLValues()
	ipc.sleep(50)
end

The reason, why I read all the values at once in one single module is, that the interface always fetches one single value at one time. If you would call it from several independent threads, the calls could interfere. This is a limitation of the current XML interface. The training edition will include a more sophisticated interface.

Luckily most of the values can be read directly out of Lvars and you can avoid the XML-Interface. So a simple ipc.readLvar("<<<variable name>>>") will provide you the value directly.

If you have no programming skills, it's hard. Maybe you find some student nearby, which helps you with that part. You can offer him later some simulator hours 😉

Rgds
Reinhard

 

Posted
15 hours ago, aua668 said:

Hi,

In the included ZIP-File I added two files: One is a definition file for the XML-functions I use with my hardware. The numbers I got from the provided utility, which calculates the hash value for the specific variable.

The second file is a sample module, which toggles the TOGA button. For every button I have such a routine. In a master file, which is automatically started, I start all my modules for the Q400  with ipc.runlua("<<<modulename>>>")

For reading values from the XML interface I use one single module transferring all the necessary XML-Values into global variables, which later I can use in different modules. The core of the routine can be seen here: 


-- initialize XML interface to HW

function readXMLIF ( pFunc )						-- function to read specific IF value

	local lMJC_readCode
	local lMJC_readValue
	local lCount = 0

	-- select function by hash code
	ipc.writeLvar("L:MJC_VAR_READ_CODE", pFunc)
	ipc.sleep(5)
	
	-- read results
	lMJC_readCode = ipc.readLvar("L:MJC_VAR_READ_CODE")
	
	-- wait if not ready
	while lMJC_readCode ~= 9991999 and lMJC_readCode ~= 9992999 and lCount < 20
	do
		lCount = lCount + 1
		ipc.sleep(10)
		lMJC_readCode = ipc.readLvar("L:MJC_VAR_READ_CODE")
	end

	if lMJC_readCode == 9991999 then
		lMJC_readValue = ipc.readLvar("L:MJC_VAR_READ_VALUE")	-- success
	else
		lMJC_readValue = 9992999								-- variable not found
		ipc.log("Error reading MJC interface for function "..pFunc)
	end
	
	return lMJC_readValue		-- return value or error

end


function readAllXMLValues()		-- synchronize global variables from Q400 values

	-- autopilot
	ipc.set ("Q400_YD_LIGHT" , readXMLIF ( 31461 ) )			-- AFCS_->outputs.YD_engaged
	ipc.set ("Q400_AP_LIGHT" , readXMLIF ( 31281 ) )			-- AFCS_->outputs.AP_engaged

	-- glare shield
	ipc.set ("Q400_CAUTION" , readXMLIF ( 143090 ) )			-- CautionWarning_->outs_.master_caution_light_blinking
	ipc.set ("Q400_WARNING" , readXMLIF ( 143112 ) )			-- CautionWarning_->outs_.master_warning_light_blinking

	-- fuel
	ipc.set ("Q400_AUX_FUEL" , readXMLIF ( 59590 ) )			-- Fuel_->systems[0].AuxFuelPumplight

	-- Autofeather
	ipc.set ("Q400_AUTO_FEATHER" , readXMLIF ( 41047 ) )		-- PCU_->AutofeatherSelectLight

	-- Hydraulic
	ipc.set ("Q400_HYDRAULIC" , readXMLIF ( 91735 ) )			-- Hydraulical_->outs_.stby_hydr_ON_indicator

end

while 0 < 1 do
	readAllXMLValues()
	ipc.sleep(50)
end

The reason, why I read all the values at once in one single module is, that the interface always fetches one single value at one time. If you would call it from several independent threads, the calls could interfere. This is a limitation of the current XML interface. The training edition will include a more sophisticated interface.

Luckily most of the values can be read directly out of Lvars and you can avoid the XML-Interface. So a simple ipc.readLvar("<<<variable name>>>") will provide you the value directly.

If you have no programming skills, it's hard. Maybe you find some student nearby, which helps you with that part. You can offer him later some simulator hours 😉

Rgds
Reinhard 

 

 

hahaha, you are absolutely right, I thank you for the availability, my problems are only the outputs, in all the rest I have configured it with SPAD.NEXT, but the outputs do not seem to work due to errors of values in the variables ouptut XLM from majestic. have you configured output variables and the LEDs light up regularly in sync with the simulator?
thanks.

 

 

 

 

Posted

Hi,

Yes - I have them in sync. Either they are readable from Lvars (you can react on changes with the event.Lvar trigger) or I collect them permanently via the XML interface. As the interface doesn't react very quickly, you have a latency of some msec.

Rgds
Reinhard

 

Posted
17 hours ago, aua668 said:

Hi,

Yes - I have them in sync. Either they are readable from Lvars (you can react on changes with the event.Lvar trigger) or I collect them permanently via the XML interface. As the interface doesn't react very quickly, you have a latency of some msec.

Rgds
Reinhard

 

 

I apologize, but I don't understand,
do you use the MAJESTIC DASH8 Q400 output variables (so all the LED lights) and work regularly and in sync with the MAJESTIC DASH8 Q400 flight simulator with FASUIPC ??

 

Posted

Hi,

As I wrote: Yes I use those output variables, which I need for my hardware. Most of the directly via Lvars and some of them via the XML-interface.

Rgds
Reinhard

 

Posted
1 hour ago, aua668 said:

Hi,

As I wrote: Yes I use those output variables, which I need for my hardware. Most of the directly via Lvars and some of them via the XML-interface.

Rgds
Reinhard 

 

ok, I realize to be ignorant, and I thank you for the help you are trying to give me, but I have to be honest, for me it's difficult, you should tell me step by step how to make it so that you get to have the final step to make it work the outputs, or try to contact us in another way, but I realize I ask you too much. unfortunately all my work becomes useless if I don't solve this problem.
I am attaching some of my works designed and built with my CNC, an excellent hardware job is coming, and I'm at the end of the panels, but I'm stuck for this problem.
greetings and thanks.

IMG-20190728-WA0011_resized_20190729_082229076.jpeg

IMG_20190422_195234_resized_20190426_105308566.jpg

korry 2.jpg

IMG_20190519_173355_resized_20190520_104420161.jpg

korry switch 1.jpg

Posted

Hi Toppe,

what a amazing job!

I'm a IT engineer so I should help you. I only need a short time to understand how LUA scripts work with FSUIPC and the Mcj Q400, then a little practice with them...

I think in the next weekend I'll have registered version of FSUIPC and so I'll start to make some experiments...

Let us keep in touch,

Alessandro

Posted
5 minutes ago, Alessandro Usai said:

Hi Toppe,

what a amazing job!

I'm a IT engineer so I should help you. I only need a short time to understand how LUA scripts work with FSUIPC and the Mcj Q400, then a little practice with them...

I think in the next weekend I'll have registered version of FSUIPC and so I'll start to make some experiments...

Let us keep in touch,

Alessandro 

penso di poter parlare in italiano con te, mi sembra tu sia di Ferrara se vedo bene (LIPF).

ti ringrazio tantissimo sia dei complimenti e soprattutto dell'aiuto che potrai darmi, come hai potuto leggere AUA668 è molto disponibile, ma cio' che per lui e per te magari e naturale per me e' CRIPTONITE, io uso SPAD.NEXT e schede LEO BODNAR per gli imput e ULTIMARC placled64 come hardware, con SPAD.NEXT mi trovo bene ma non so perche da un po di tempo gli output non mi funzionano piu, agiscono in ritardo i  led associati alle variabili output rispetto al programma di volo, o si accendo e spengono per conto loro, dai vari messaggi a spad. forum sembra che il problema siano le variabili majestic che hanno degli errori, ma prima quando avevo un altro pc con W7 funzionava tutto benissimo, e le variabili output della majestic sono praticamente le stesse, morale della favola mi ritrovo con questo problema insormontabile e se non lo risolvo non posso andare avanti con il lavoro. secondo AUA668 a lui funzionano con FSUIPC e non so con quale altro programma, se tu puoi davvero aiutarmi ti saro' veramente grato alessandro.

saluti.

Posted

Ciao,

ci proviamo. Non potrò metterci mani e testa prima del prossimo weekend. Come già scritto ho solo bisogno di capire come funziona l'interazione del linguaggio LUA con FSUIPC e come vengono restituiti i dati dalle variabili del Q400.

A presto,

Alessandro

Posted

Hi,

 

Thanks for sharing your work. Seeing that amount of outputs, it would be better to implement this with the upcoming training edition, which will include much more efficient interfaces for cockpit builders. Great work!

Rgds
Reinhard

PS: And don't ask me, when the training edition will be available 😉 

 

Posted
1 hour ago, Alessandro Usai said:

Ciao,

ci proviamo. Non potrò metterci mani e testa prima del prossimo weekend. Come già scritto ho solo bisogno di capire come funziona l'interazione del linguaggio LUA con FSUIPC e come vengono restituiti i dati dalle variabili del Q400.

A presto,

Alessandro

ciao alessandro ti ho risposto alla mail, non so se ti e' arrivata, perche' mi dava recipiente full, fammi sapere qui se ti e' correttamente arrivata la mia risposta, ciao.

Posted
1 hour ago, aua668 said:

Hi,

 

Thanks for sharing your work. Seeing that amount of outputs, it would be better to implement this with the upcoming training edition, which will include much more efficient interfaces for cockpit builders. Great work!

Rgds
Reinhard

PS: And don't ask me, when the training edition will be available 😉 

  

ok thanks a lot

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.