Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 2
  • *Guests: 56
  • *Total: 58

Author Topic: Lua code help needed=Answered !  (Read 350 times)

Offline Stinger2k2

  • CockpitBuilder
  • *
  • Posts: 12
  • Aviation Enthusiast
  • First Name: Keith
  • Home Location: Bexhill , England
Lua code help needed=Answered !
« on: February 11, 2017, 08:09:20 AM »
Hi all,
 
Can a LUA expert have a look at this for me please to see what I am doing wrong...
 
The aircraft I am working with is the Carenado Phenom 300.
 
This is what I see in the LINDA tracer when right click the ALT SEL knob in the aircraft VC to switch between altitude increments of 100 or 1000.
******
Watching new LVar: H850XPAltWheelPUSHTOGGLE = 0
LVar: H850XPAltWheelPUSHTOGGLE = 1
LVar: H850XPAltWheelPUSHTOGGLE = 0
LVar: H850XPAltWheelPUSHTOGGLE = 1
********
This is the LUA function I wrote .....
********
function alt_incr_toggle_100 ()
     ipc.writeLvar("HP850XPAltwheelPUSHTOGGLE", 1)
end
function alt_incr_toggle_1000 ()
     ipc.writeLvar("HP850XPAltwheelPUSHTOGGLE", 0)
end
********
I then assigned this onto a button in LINDA using the fields ON PRESS and ON RELEASE.
 
However when I watch the same Lvar in the tracer while pushing and releasing the assigned button the tracer shows no change? LINDA sees the button as working (i.e when I push the button LINDA moves to assign button position 30)
 
This is similar code that I have written for other switch functions and they work ok.
 
Any ideas?
 
 
Regards
Stinger
« Last Edit: February 11, 2017, 10:34:59 AM by Stinger2k2 »

Offline Stinger2k2

  • CockpitBuilder
  • *
  • Posts: 12
  • Aviation Enthusiast
  • First Name: Keith
  • Home Location: Bexhill , England
Re: Lua code help needed--Answered
« Reply #1 on: February 11, 2017, 10:34:33 AM »
Ok, sorted myself out now thanks.

 

Recent Posts

Setting up PM Sounds
by Mach7
[Today at 08:26:42 AM]
TQ - Trim wheel dismounting help
by srisim
[Today at 06:09:04 AM]
Flight Illusion Comes through!
by RayS
[June 25, 2017, 01:22:03 AM]
220 visual totally fluid
by rprather
[June 24, 2017, 02:38:36 PM]
Prepar3D Version 4.0 Announced
by jfuenmayor
[June 24, 2017, 12:49:24 PM]
Real Boeing 737 yoke handle wiring
by mickc
[June 23, 2017, 07:31:49 PM]
Circuit Breaker Challenge- B737 or other type
by Trevor Hale
[June 23, 2017, 12:26:23 PM]
Looking for 110v 4" Fan motors for 737 eyeball ducts
by Flying_Fox
[June 22, 2017, 10:03:35 PM]
B737 Rudder adjusting crank unit
by tennyson
[June 22, 2017, 07:17:14 AM]
Oasis 737 Project
by mickc
[June 21, 2017, 08:06:28 PM]
Anyone have access to a Beech 1900D Cockpit?
by RayS
[June 21, 2017, 01:30:40 PM]
737 OEM Panels
by 737NGer
[June 21, 2017, 10:59:56 AM]
Simworld CDU Bay, Lower EICAS and CAN BUS For Sale
by srisim
[June 20, 2017, 05:30:13 AM]
Hello from Nashua, NH
by srisim
[June 20, 2017, 04:34:20 AM]
Help with choosing CDU
by willow
[June 19, 2017, 11:54:32 PM]
Boeing 737 Max
by Fabian
[June 19, 2017, 11:31:41 PM]
Flight Illusion Boeing Press Gauge for sale
by XOrionFE
[June 19, 2017, 10:27:30 PM]
P3D v4 Multi Channel
by tennyson
[June 19, 2017, 07:06:55 PM]
TQ motor recommendations
by Jabsher
[June 16, 2017, 04:01:16 PM]
TV Screens for Visual
by navymustang
[June 16, 2017, 03:22:16 PM]
how close is everyone to completion
by B747-400
[June 16, 2017, 09:37:37 AM]
WANTED: Full set of 737 Overhead Locking Toggle Switches.
by jackpilot
[June 15, 2017, 03:45:20 PM]
FlightControlReplay Professional v3.5 P3Dv4 compatible OUT NOW
by karijno
[June 15, 2017, 03:23:29 AM]
What size monitor ??
by jackpilot
[June 14, 2017, 10:14:15 PM]
let´s talk about pilot shoes
by bernard S
[June 14, 2017, 04:26:34 PM]
Calculating amp draw
by Mach7
[June 13, 2017, 08:54:58 AM]
Powering the sim
by jackpilot
[June 13, 2017, 08:19:06 AM]
Smart solution for 737 cockpit without side-space.
by kurt-olsson
[June 13, 2017, 01:33:16 AM]
3d printer
by Jabsher
[June 12, 2017, 06:03:48 PM]