Dataref with ZIBO

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
Stef26
Posts: 11
Joined: Sat Aug 22, 2020 7:01 am

Dataref with ZIBO

#1 Post by Stef26 »

Hi,

I made an mcp panel for the zibo.

I can't program the push buttons like "VOR LOC" for example.

Code: Select all

xpl_command("laminar/B738/autopilot/vorloc_press")
when I execute the command, the VOR LOC key light is active but it does not stay on. It works well in the simulator.

Can someone help me ?

Thank you

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Dataref with ZIBO

#2 Post by Keith Baxter »

Stef26 wrote: Wed Sep 16, 2020 8:20 am Hi,

I made an mcp panel for the zibo.

I can't program the push buttons like "VOR LOC" for example.

Code: Select all

xpl_command("laminar/B738/autopilot/vorloc_press")
when I execute the command, the VOR LOC key light is active but it does not stay on. It works well in the simulator.

Can someone help me ?

Thank you
Hi,

Did you look at the MCP that Gilles did? It is in the store.

I had a quick look at his code.
This code is what activates the button.

Code: Select all

function press_vor_loc(position)	-- VOR LOC button function
	xpl_command("laminar/B738/autopilot/vorloc_press")
end
And this is the dataref that indicates the status.

Code: Select all

xpl_dataref_subscribe("laminar/B738/autopilot/vorloc_status","INT",	vorloc_chg)
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Stef26
Posts: 11
Joined: Sat Aug 22, 2020 7:01 am

Re: Dataref with ZIBO

#3 Post by Stef26 »

Yes i saw, thank for your help

I specify that it is for a hardware panel

I think i need to use :

Code: Select all

xpl_command("laminar/B738/autopilot/vorloc_press", var)
and check the actual state with :

Code: Select all

xpl_dataref_subscribe("laminar/B738/autopilot/vorloc_status","INT", vorloc_chg)
I try to find the best way

User avatar
Ralph
Posts: 7932
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Dataref with ZIBO

#4 Post by Ralph »

For the switch you would indeed need to subscribe to the dataref and set the switch light with that.

baranismen
Posts: 193
Joined: Sun Jun 02, 2019 6:26 pm

Re: Dataref with ZIBO

#5 Post by baranismen »

I'll write you the exact code you need tomorrow.

Post Reply