Rudder & Elevator Boost Levers - Cannot set a control

Post any technical issues here. This forum gets priority from our staff.
new reply
User avatar
WB_FlashOver
Technical Sergeant
Posts: 946
Joined: 10 Jun 2012, 18:23
Location: (S05) U.S.A.
Contact:

Rudder & Elevator Boost Levers - Cannot set a control

Post by WB_FlashOver »

I was just wondering if anyone has been able to set controls to activate the Rudder & Elevator Hydraulic Boost levers. I use FSUIPC5 5.113 (paid version) and LINDA 3.0.2. I have written the controls in LINDA and the levers make the sound of moving with LINDA tracer showing the functions for both have changed but the levers will only move to the OFF position. Pressing the control again and the Rudder lever twitches but does not move to ON position with the Elevator not even twitching. My display text is showing them in the correct position, but visually the levers have not moved. It takes two mouse clicks on each lever to get them to move after using the control below.

This is the code I'm using;

Code: Select all

function L049_Hyd_Boost_Tgl ()
    if ipc.readLvar("L:ElevatorBoostLever") == 0 then
    ipc.writeLvar("L:ElevatorBoostLever", 1)
    _sleep(150, 300)
    ipc.writeLvar("L:RudderBoostLever", 1)
            ipc.writeSTR(0x3380, "HYDRAULIC BOOST LEVERS ON")
            ipc.writeSW(0x32FA, 7)
    else ipc.writeLvar("L:ElevatorBoostLever", 0)
    _sleep(150, 300)
    ipc.writeLvar("L:RudderBoostLever", 0)
            ipc.writeSTR(0x3380, "HYDRAULIC BOOST LEVERS OFF")
            ipc.writeSW(0x32FA, 7)
    end
end
Maybe this control is not written into the code of the L049 for us to use. Perhaps something for a future update to the Connie? :mrgreen:

Thanks
Roger
-- Fly Well, Be Nice, Have Fun ! ! !

Z390 FTW | i9 9900K @ 5.2 | 32GB 3333 CL14 | 3080 Ti FE
970 Pro 512GB (OS)| 970 Evo 1TB | 850 Evo 500GBx2 Raid0
3TB HDD | Define S2 | EKWB Dual Loop


P51civ - T6 - P40 - B17 - B377 - L049 - Comanche - Spit - Bonanza

Gypsy Baron
A2A Master Mechanic
Posts: 3396
Joined: 02 Aug 2008, 17:04
Location: San Francisco

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by Gypsy Baron »

Looking at the code, those 'lever' variables are in percent so if you want to engage them the parameter needs to be '100'

I see them being initialized to '1' but that is a one time thing to insure a non-null state. I do not see anyplace that they are controlled so the code for that must be in the model.

I do see code that detects when one of them is changed, which triggers a 'switch sound' which you are hearing but that will occur when either variable changes from 1 to 0 or 0 to 1, The levers need to be 'moved' to 100 percent or 0 percent.

So just try setting them to 0 or 100.

Your MCRO file should have them with a function of SET as opposed to TOGGLE

Paul

Image

User avatar
WB_FlashOver
Technical Sergeant
Posts: 946
Joined: 10 Jun 2012, 18:23
Location: (S05) U.S.A.
Contact:

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by WB_FlashOver »

Gypsy Baron wrote:Looking at the code, those 'lever' variables are in percent so if you want to engage them the parameter needs to be '100'

I see them being initialized to '1' but that is a one time thing to insure a non-null state. I do not see anyplace that they are controlled so the code for that must be in the model.

I do see code that detects when one of them is changed, which triggers a 'switch sound' which you are hearing but that will occur when either variable changes from 1 to 0 or 0 to 1, The levers need to be 'moved' to 100 percent or 0 percent.

So just try setting them to 0 or 100.

Your MCRO file should have them with a function of SET as opposed to TOGGLE

Paul

Image
Hello Paul and thanks for the reply. I knew that if anyone would know how to do this it would be you :idea:


I use LINDA tracer and all I could find in it was the on/off switch of 0 and 1. I was able to find the 0 to 100 percent via a "List Local Panel Vars" command and search the log file. This is not my first troublesome command sense I have MUCH to learn about this, but alas, with each difficult command comes a little more knowledge.

Is there an easier way to find these than through LINDA tracer or searching the log file after running list local panel vars?

My command is simply a function in the LINDA user.lua and not within a MCRO (which I have not delved in to yet). The toggle seems to work perfectly with 0 & 100 and I thank you much Sir.

Always appreciative
Roger
-- Fly Well, Be Nice, Have Fun ! ! !

Z390 FTW | i9 9900K @ 5.2 | 32GB 3333 CL14 | 3080 Ti FE
970 Pro 512GB (OS)| 970 Evo 1TB | 850 Evo 500GBx2 Raid0
3TB HDD | Define S2 | EKWB Dual Loop


P51civ - T6 - P40 - B17 - B377 - L049 - Comanche - Spit - Bonanza

Gypsy Baron
A2A Master Mechanic
Posts: 3396
Joined: 02 Aug 2008, 17:04
Location: San Francisco

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by Gypsy Baron »

Rodger,

I'm not intimately familiar with the structure and operation of LINDA so all my L:Vars are defined in a MCRO file which is nothing more than a text file that 'declares' L:Vars and the type of operation to be used when assigned to a control/switch/key. The file is saved with the extension of .MCRO and lives
in the Modules folder.

I have such files for all my aircraft and for the A2A birds I name them 'A2A_C172.MCRO' or 'A2A_B17G.MCRO' etc. They then appear at or near the top oc\f the assignable controls drop down menus in FSUIPC as those lists are alphabetical.

If you have discovered a method in LINDA to send the 0 and 100 percent values then you are 'there' and good to go. I suspect that it may have just been a change to the Lua script.

In any case, there isn't a real simple way of discovering the L:Vars and what action/parameter is needed. I typically 'List local panel variables' whenever I install a new aircraft. I then scan that listing after editing out all the FSUIPC log data and the time stamps, leaving just the L:vars and their current setting.

To find out what is needed I will add the L:Var in question to the A/Cs MCRO file and then assign it to a switch or axis and find the required parameters empirically. I often make 2 or 3 entries for the same L:Var with the different possibilities - TOGGLE, CYCLIC, SET. Then I can easily test various parameters until I determine the one needed. (Keep in mind that I am a old, retired engineer that wrote code in 'machine language' and 'assembly language' back in the 70's and 80's so this stuff is pretty straight forward for me)

Some L:Vars actions are obvious from the name and generally 'lever' will use a percentage parameter while 'switch" may be Boolean, 0/1, (TOGGLE) or in the case of multi-position switches SET or CYCLIC to values like 0,1,2,3 depending upon the number of switch positions.

Things like the B-17G Gear and Flap switches that have a 'neutral' or 'off' position use 0, 1, 2 with '1' being the neutral position.

Once I determine the requirements for a given L:Var I assign it as needed and then update the MCRO file to only have an entry for that L:Var that pertains to the need...TOGGLE, CYCLIC, SET.

Here is a sample of part of my A2A_L049.MCRO file:

[MACROS]
1=L:WingflapWarningLampTestSwitch=TOGGLE
2=L:FireTestSwitch=SET
3=L:CarbHeat1Switch=TOGGLE
4=L:CarbHeat2Switch=TOGGLE
5=L:CarbHeat3Switch=TOGGLE
6=L:CarbHeat4Switch=TOGGLE
7=L:InverterSwitch=TOGGLE
8=L:Eng1_FuelTankCutOffLever=TOGGLE
9=L:Eng2_FuelTankCutOffLever=TOGGLE
10=L:Eng3_FuelTankCutOffLever=TOGGLE
11=L:Eng4_FuelTankCutOffLever=TOGGLE
12=L:Propeller1SwitchRPM=SET
13=L:Propeller2SwitchRPM=SET
14=L:Propeller3SwitchRPM=SET
15=L:Propeller4SwitchRPM=SET
16=L:PropellerMasterSwitchRPM=SET
17=L:Feather1Switch=SET
18=L:Feather2Switch=SET
19=L:Feather3Switch=SET
20=L:Feather4Switch=SET

I have 159 L:vars defined for the Connie and I don't 'control' all the possible functions. The L:var list for the Connie is over 2400 entries! That list will contain any L:Vars for addon gauges that may exist. In my case I have several gauges I add to all my aircraft...a radar gauge, the GPS500 and numerous others.

A2A does supply some detailed info on L:Vars in the forum for Cockpit/Simpit builders. I think those may be in the 'sticky' sections.

Paul

Image

User avatar
WB_FlashOver
Technical Sergeant
Posts: 946
Joined: 10 Jun 2012, 18:23
Location: (S05) U.S.A.
Contact:

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by WB_FlashOver »

Hello Paul,
I've thought of looking into the MCRO file setup. But I do have a question about it. In LINDA I can have one un-shifted control set and two shifted control sets which actually triples my button availability. I only use un-shifted and one shift state as I have not had the need for the third shift state yet.

So far LINDA has been great for me. I can edit controls mid-flight without issue and even without pausing the game. I have so much to learn about this but work keeps me too busy to dive into it much and still keep my sanity :?

I appreciate your help and knowledge on editing controls.

Roger
-- Fly Well, Be Nice, Have Fun ! ! !

Z390 FTW | i9 9900K @ 5.2 | 32GB 3333 CL14 | 3080 Ti FE
970 Pro 512GB (OS)| 970 Evo 1TB | 850 Evo 500GBx2 Raid0
3TB HDD | Define S2 | EKWB Dual Loop


P51civ - T6 - P40 - B17 - B377 - L049 - Comanche - Spit - Bonanza

Gypsy Baron
A2A Master Mechanic
Posts: 3396
Joined: 02 Aug 2008, 17:04
Location: San Francisco

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by Gypsy Baron »

Roger,

The reason I use the MCRO approach and manually editing the INI file is that in my setup, A Saitek X-45, Pro Yoke and dual throttle quads I have all the controls for my aircraft mapped to 10 switches on the throttle quads, some 'common' stuff on the X-45 stick and throttle plus some extra 'views' on a gamepad.

In most of my A2A aircraft I have anywhere from 6 to 13 'control sets' or 'modes' using one user-defined offset (8-bit 0x66D0) that holds the current set/mode. I use 2 of my throttle quad 12 switches to change the set./mode up and down. In theory I can have 256 sets/modes using this method but I have yet to exceed 13 :)

On the Connie, after I had mapped all the various controls and functions to the remaining 10 switches on the throttle quads using 13 sets/modes I looked at the layout Iand decided to consolidate some of those by using a further conditional qualifier, the 'pinkie switch' on my X-45 stick. Thus for several sets I have 20 functions assigned.

I have a small Lua display that pops up for a couple of seconds when I change the set/mode that displays the assignments for that set/mode, initially in 2 lines...the upper 5 switch assignments and the lower 5 switch assignments.

When I added the pinkie switch qualifier I changed the Lua display for those consolidated sets/modes to a 4 line display upper/lower un-shifted and upper/lower shifted. This saves me having to remember all the assignments or use a 'cheat sheet' :)

Another thing I do is in many cases map multiple functions/controls to the same switch. For instance in the B-17G when I select an engine to start, that same switch also sets the primer to the engine as well as the fire extinguisher.

All told or 'tolled' my INI file is over 7000 lines long :)

Here is a sample of my Connie sets 0 and 1, un-shifted and shifted.

Code: Select all

[Buttons.Lockheed Constellation L049]
-{============================================================}-
!1=-{CONTROL SET 0 - WINDOWS, APU - AP COMTROLS - PANELS SHIFTED}-
0=B66C0=0 CP(-C,6)D,14,CM25:43,100 	-{Macro A2A_L049: L:WindowSliding1Lever set}-
1=B66C0=0 CP(-C,6)D,14,CM25:44,100 	-{Macro A2A_L049: L:WindowSliding2Lever set}-
2=B66C0=0 CP(-C,6)D,15,CM25:43,0 	-{Macro A2A_L049: L:WindowSliding1Lever set}-
3=B66C0=0 CP(-C,6)D,15,CM25:44,0 	-{Macro A2A_L049: L:WindowSliding2Lever set}-
4=B66C0=0 CP(-C,6)D,16,CM25:21,0 	-{Macro A2A_L049: L:ApuStarterGenSwitch tgl}-
5=B66C0=0 CP(-C,6)D,17,CM25:47,2 	-{Macro A2A_L049: L:ApuStarterGenSwitch set}-
6=B66C0=0 CR(-C,6)D,18,CM25:122,100 	-{Macro A2A_L049: L:ApAileronControl inc}-
7=B66C0=0 CR(-C,6)D,19,CM25:123,-100 	-{Macro A2A_L049: L:ApAileronControl dec}-
8=B66C0=0 CR(-C,6)A,0,CM25:120,100 	-{Macro A2A_L049: L:ApElevatorControl inc}-
9=B66C0=0 CR(-C,6)A,1,CM25:121,-100 	-{Macro A2A_L049: L:ApElevatorControl dec}-
10=B66C0=0 CR(-C,6)A,2,C65879,0 	-{HEADING_BUG_INC}-
11=B66C0=0 CR(-C,6)A,3,C65880,0 	-{HEADING_BUG_DEC}-
-{============================================================}-
!2=-{CONTROL SET 1 - AVIONICS - BATTERY - CARB HEAT - CARB AIR SHIFTED}-
18=B66C0=1 CP(-C,6)D,14,C66363,0 	-{TOGGLE_ALTERNATOR1}-
19=B66C0=1 CP(-C,6)D,16,C66364,0 	-{TOGGLE_ALTERNATOR2}-
20=B66C0=1 CP(-C,6)D,18,C66365,0 	-{TOGGLE_ALTERNATOR3}-
21=B66C0=1 CP(-C,6)A,0,C66366,0 	-{TOGGLE_ALTERNATOR4}-
22=B66C0=1 CP(-C,6)A,2,C66241,0 	-{TOGGLE_MASTER_BATTERY}-
23=B66C0=1 CP(-C,6)D,15,CM25:3,0 	-{Macro A2A_L049: L:CarbHeat1Switch tgl}-
24=B66C0=1 CP(-C,6)D,17,CM25:4,0 	-{Macro A2A_L049: L:CarbHeat2Switch tgl}-
25=B66C0=1 CP(-C,6)D,19,CM25:5,0 	-{Macro A2A_L049: L:CarbHeat3Switch tgl}-
26=B66C0=1 CP(-C,6)A,1,CM25:6,0 	-{Macro A2A_L049: L:CarbHeat4Switch tgl}-
27=B66C0=1 CP(-C,6)A,3,C66293,0 	-{TOGGLE_AVIONICS_MASTER}-
-{=========================================================}-
-{=========================================================}-
!37=-{CONTROL SET 0 SHIFTED - PANELS - AP SERVOS}-
370=B66C0=0 CP(+C,6)D,14,C66506,14992 	-{PANEL_ID_TOGGLE}-
371=B66C0=0 CP(+C,6)D,15,C66506,440 	-{PANEL_ID_TOGGLE}-
372=B66C0=0 CP(+C,6)D,16,C66506,1064 	-{PANEL_ID_TOGGLE}-
373=B66C0=0 CP(+C,6)D,17,C66506,225 	-{PANEL_ID_TOGGLE}-
374=B66C0=0 CP(+C,6)D,18,CM25:110,1 	-{Macro A2A_L049: L:ApAileronServoOn set}-
375=B66C0=0 CP(+C,6)D,19,CM25:110,0 	-{Macro A2A_L049: L:ApAileronServoOn set}-
376=B66C0=0 CP(+C,6)A,0,CM25:111,1 	-{Macro A2A_L049: L:ApElevatorServoOn set}-
377=B66C0=0 CP(+C,6)A,1,CM25:111,0 	-{Macro A2A_L049: L:ApElevatorServoOn set}-
378=B66C0=0 CP(+C,6)A,2,CM25:112,1 	-{Macro A2A_L049: L:ApRudderServoOn set}-
379=B66C0=0 CP(+C,6)A,3,CM25:112,0 	-{Macro A2A_L049: L:ApRudderServoOn set}-
-{============================================================}-
!2=-{CONTROL SET 1 - SHIFTED - CARB AIR AXIS - MASTER IGN - PITOT}-
385=B66C0=1 CR(+C,6)D,14,CM25:102,99 	-{Macro A2A_L049: L:Eng1_CarbAirLever inc}-
386=B66C0=1 CR(+C,6)D,16,CM25:103,99 	-{Macro A2A_L049: L:Eng2_CarbAirLever inc}-
387=B66C0=1 CR(+C,6)D,18,CM25:104,99 	-{Macro A2A_L049: L:Eng3_CarbAirLever inc}-
388=B66C0=1 CR(+C,6)A,0,CM25:105,99 	-{Macro A2A_L049: L:Eng4_CarbAirLever inc}-
389=B66C0=1 CR(+C,6)D,15,CM25:106,0 	-{Macro A2A_L049: L:Eng1_CarbAirLever dec}-
390=B66C0=1 CR(+C,6)D,17,CM25:107,0 	-{Macro A2A_L049: L:Eng2_CarbAirLever dec}-
391=B66C0=1 CR(+C,6)D,19,CM25:108,0 	-{Macro A2A_L049: L:Eng3_CarbAirLever dec}-
392=B66C0=1 CR(+C,6)A,1,CM25:109,0 	-{Macro A2A_L049: L:Eng4_CarbAirLever dec}-
393=B66C0=1 CR(+C,6)A,2,C66535,0 	-{TOGGLE_MASTER_IGNITION_SWITCH}-
394=B66C0=1 CR(+C,6)A,3,C65858,0 	-{PITOT_HEAT_TOGGLE}-
{============================================================}-

And this is what my Lua display would look like when I select each of those two sets or hit CTL+F10 which displays the current set without having to cycle the 'change' switches.

Code: Select all

  WIND OPEN  _ APU RUN  _ AP AIL INC _ AP ELE INC  _ AP HDG INC
  WIND CLOSE _ APU ON  _ AP AIL DEC  _ AP ELE DEC  _ AP HDG DEC 
  -----  
  AP CHART   _ DUAL DME _ AP ASRV ON  _ AP ESRV ON  _ AP HSRV ON
  ANR-75     _ GPS 500  _ AP ASRV OFF _ AP ESRV OFF _ AP HSRV OFF
  
Control Set = "..conset, 10)  <------- This would display "0" for 10 seconds

  GENERATOR    1 _ 2 _ 3 _ 4 _ BATTERY
  CARB HEAT    1 _ 2 _ 3 _ 4 _ AV MASTER  
  ----- 
  CARB AIR INC 1 _ 2 _ 3 _ 4 _ MASTER IGN 
  CARB AIR DEC 1 _ 2 _ 3 _ 4 _ PITOT HEAT 
  
Control Set = "..conset, 10)  <------- This would display "1" for 10 seconds
So you see my scheme is rather like your use of LINDA with the additional quaalifiers. I jus took mine to the extreme :)

Paul

Image

User avatar
WB_FlashOver
Technical Sergeant
Posts: 946
Joined: 10 Jun 2012, 18:23
Location: (S05) U.S.A.
Contact:

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by WB_FlashOver »

:shock: Makes my head hurt looking at the code :shock:
Hehe, it does start to make some sense after studying it for a bit. I used to think that I was going to need many controls but to be honest, I find that in some aircraft I run out of controls to set before I run out of buttons to assign.

I do plan on building a generic switch panel at some point so I can have a separate switch for each starter, alternator, primer, light, AP, etc. But alas, time and money are the factors that have held up this project.

Cheers
Roger

Oh, not to pester you but would you know how to make an axis lua to do the steering wheel in the Connie. I tried the code that I use to slide the windows in the Connie, run the turbo/windows/heater/intercoolers in the B-17, adjust the vent in the P-51, run the cowl flaps in the P-40, etc. I need a code that goes from 100 to 0 to -100 or maybe 16384 to 0 to -16384. I'm currently using the Connie Input configurator but the small thumb-wheel on my X52 Pro is not centered on the detent. With thumb wheel on detent it centers at -6 when logging "L:SteerWheel", or -1000 when logging "L:Steer_Set". This is right of the steer tires being centered and it is a constant battle to taxi her. I also get lots of twitching in the axis unless I run it through an lua.

Here is what I'm currently trying. I get full left turn to center. Nothing to the right. I've also tried "L:Steer_Set". I'm quite certain it's in the formula. They both from 100 to 0 or 16384 to 0. Oh yeah, :roll: math, another one of my week points.

Code: Select all

function Steer(offset, input)

  Steer_in = ipc.readSW(0x66C0)

 Steer_out  = (Steer_in + 16383)/327.67    

 ipc.writeLvar("L:SteerWheel", Steer_out)
 ipc.writeLvar("L:SteerWheel", Steer_out)
end

event.offset(0x66C0,"SW","Steer")
-- Fly Well, Be Nice, Have Fun ! ! !

Z390 FTW | i9 9900K @ 5.2 | 32GB 3333 CL14 | 3080 Ti FE
970 Pro 512GB (OS)| 970 Evo 1TB | 850 Evo 500GBx2 Raid0
3TB HDD | Define S2 | EKWB Dual Loop


P51civ - T6 - P40 - B17 - B377 - L049 - Comanche - Spit - Bonanza

Gypsy Baron
A2A Master Mechanic
Posts: 3396
Joined: 02 Aug 2008, 17:04
Location: San Francisco

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by Gypsy Baron »

I'm getting ready to fly home early Tuesday morning so I can have a look at this sometime towrds the end of the week, before I take off on my next trip on the 13th.

Paul

Gypsy Baron
A2A Master Mechanic
Posts: 3396
Joined: 02 Aug 2008, 17:04
Location: San Francisco

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by Gypsy Baron »

OK Roger,

I had a look at my L049 main Lua and found that I have a function for the steering wheel. In
looking at that code I see where yours went wrong. When you added 16384 to the input value
you created a positive number for all inputs from -16383 to +16384, thus you only got deflection
in one direction.

Here is my lua script section for the steering wheel plus the 'round integer' fuction.

Code: Select all

  ipc.setowndisplay("L049", 60 , 5, 45, 10)     -- Comment out if Lua display not used

function Steer_Wheel(control,Dummy)

   if Wheel_last == nil then Wheel_last = 0 end

    raw_in = ipc.readSW(0x66C0)

    Wheel = (round(raw_in/163.83))

	 if (Wheel > (Wheel_last + 0.35)) or (Wheel < (Wheel_last - 0.35)) then

	 ipc.writeLvar("L:SteerWheel", Wheel)

       ipc.display("Nose Wheel Pos = "..Wheel, 1)    -- Display steering wheel percent comment out if not wanted

	 end

	Wheel_last = Wheel

end

-- rounds the integer

  function round(num)
	num = tonumber(num)
	if num == nil then return 0 end
    if num >= 0 then return math.floor(num+.5)
    else return math.ceil(num-.5) end
  end

event.offset(0x66C0,"SW","Steer_Wheel")
You can comment out the ipc.display line once you are sure your script is working.

The aircraft needs to be moving for the nose wjeels to deflect. Also you will want to keep
the speed down to less than 15 mph I find.

Paul

User avatar
WB_FlashOver
Technical Sergeant
Posts: 946
Joined: 10 Jun 2012, 18:23
Location: (S05) U.S.A.
Contact:

Re: Rudder & Elevator Boost Levers - Cannot set a control

Post by WB_FlashOver »

Thank you Paul! It works fantastic. I've studied it a bit and understand most of it. Some day I'll have time to sit down and learn this stuff better. I do enjoy working through these and learning from them. The learning part just comes all too slowly sometimes.

I'm anxious to actually try it out during a flight but that may not happen for a bit. I have too much work this weekend.

Thanks again and happy travels Sir.

Roger
-- Fly Well, Be Nice, Have Fun ! ! !

Z390 FTW | i9 9900K @ 5.2 | 32GB 3333 CL14 | 3080 Ti FE
970 Pro 512GB (OS)| 970 Evo 1TB | 850 Evo 500GBx2 Raid0
3TB HDD | Define S2 | EKWB Dual Loop


P51civ - T6 - P40 - B17 - B377 - L049 - Comanche - Spit - Bonanza

new reply

Return to “Lockheed Model 049 Tech Support”

Who is online

Users browsing this forum: No registered users and 7 guests