Jump to content
The simFlight Network Forums

Do I need a separate MACRO for each event?


Recommended Posts

Hi making progress on my MU-2 pedestal setup with the saitek throttles.  Thanks, to your help...I have my MU2 start buttons working great.

The MU2 has an RCS switch. It's a 3 position switch. With the Run and Crank and Stop.  What I am trying to do is to map one button, to turn on both L and R switches at the same time.

I have read the advance manual several times. One of the examples used was n=<name>
n.1=action1
 then below that you had your numbering and Lvar.  

Since I have the start as 1 and 2 for for the MU2_START.mcro. I added 3 and named it MU2_RUN. Followed underneath, with 3.1=L:ENG1_RUN = SET,then 3.2= L:ENG2_RUN = SET

When I load up FSUIPC, select reload buttons, the only ones I see on the select control list, are my original starter macros. They work fine.

Obviously, I am misunderstanding how to format this macro. I ask, do I need to create a separate macro for each button I want to assign?

So, in the above example I would use: 1=MU2_RUN followed by 1.1= L:ENG1_RUN = SET, and then 1.2= L:ENG2_RUN = SET. So, that when I push on that one assigned button, BOTH the RUN

switches will switch on?   This is my ultimate goal.  I have other switches to have do the same. If I get one, I can figure out the rest.

 

My reference starts on page 36 bottom of the Advanced Manual.  Is this the wrong reference?

If I do indeed need a macro for each event, this question will be moot.   Can I just create 1 macro called MU2.mcro, and have all my Lvar included in that one macro.

Understand, if I need a separate for each event, then disregard above question.

OK is there something  wrong with this context?

[Macros]
1=L:ENG1_STOP=SET
2=L:ENG2_STOP=SET

I used the same context for the start macro. Both of those entries show.  On this macro, only the 1eng stop is showing. I don't see my eng 2 stop entry in FSUIPC.

Still can't even get the MU2_Run Macro to show up on the list as explained above.  List being control sent when button pressed. The macros show in the FSUIPC.ini file.

All the macros are placed in my FSUIPC directory, on my M: Drive. I do not have a modules folder in P3Dv5.

Any help appreciated.

David

Link to comment
Share on other sites

Ok since the above is fairly lengthy. I am starting this thread to show my macro creations, and the results within FSUIPC.

First off:

MU2_Start.mcro

[Macros]
1=L:C441_STARTER1=SET
2=L:C441_STARTER2=SET     This Macro works perfectly.

2. MU_Stop.mcro

[Macros]
1=L:ENG1_STOP=SET
2=L:ENG2_STOP=SET        Initially, the ENG2_STOP was not showing in FSUIPC dropdown, just ENG_1. However, for some reason ENG_2 finally did show on controls sent dropdown.

However, there is no animation of the switch. It appears as there is another L:var used called l/R_RCS_SW. Apparently this controls the animation of the switch. Not sure how I would utilize this in my macro.

Lastly:

MU2_Run.mcro(I followed the format on page 36-37 in the Advanced Guide. RE:Multiple actions in one macro control.) based on that I created this macro

[Macros]
1=MU2_Run
1.1=L:ENG1_RUN=SET
1.2=L:ENG2_RUN=SET    This does not show up in the FSUIPC dropdown list at all.   If I create the macro as the original starter macro format, I just see ENG_1 show. ENG_2 is missing.

This is all new stuff to me. I have read the manuals several times. Read threads here and elsewhere.   At this point, I don't understand why I see all,none or parts of macros.

Quite possibly my run macro is not correct. I just followed the example.    Also, trying to figure out why there is no animation on the switch.

Again, any Help insight appreciated.

Best,

David

FYI, I'm mainly trying to set this up because I want to fly my MU2 in VR. However, the accuracy in VR with the mouse is not too accurate. hence trying to set up my Saitek throttle quad with buttons.

 

Link to comment
Share on other sites

3 hours ago, dwbarnett said:

[Macros]
1=MU2_Run
1.1=L:ENG1_RUN=SET
1.2=L:ENG2_RUN=SET

This is not correct. Multi-line lvar macros have the following format (from p39 of Advanced User Guide):

Quote

The multi-line macro format can still be used with the Lvar macros, as follows:
N=L:name
N.1=action1
N.2=action2
...etc


However, unlike the usual multi-line macros, those using an L:Var cannot be mixed with any other parameter types or other L:Vars.
The single L:Var identifier is the actual macro name as well, so this prevents such complexity.

So lvar macros can only operate on one lvar.

However, you can overload your assignments by editing the ini file. So you would assign one button to one macro, then identify the line in your in. It will be something like:
   9=PT,10,CM4:1,1     -{Macro MU2_Start: L:C441_STARTER1 set}-

(although the numbers and button letters will of course be different)
To overload your button, you can copy and edit this line, so I would add
   10=PT,10,CM4:2,1     -{Macro MU2_Start: L:C441_STARTER2 set}-

(where '10' is the next free assignment index number, and 1 changed to 2 to activate the 2nd macro entry in the file).

Then, when pressing the button. both macros would be triggered.

Note however, when you overload a button press by editing the ini, when you go back to the FSUIPC assignments panel, you will see the controls greyed-out (which indicates an overloaded assignment).

3 hours ago, dwbarnett said:

However, there is no animation of the switch. It appears as there is another L:var used called l/R_RCS_SW. Apparently this controls the animation of the switch. Not sure how I would utilize this in my macro.

Sorry, can't help you with this. Maybe someone else who has this aircraft can help, otherwise try asking on the forum/support for the aircraft.

John

Link to comment
Share on other sites

David,
Was just about to delete the VC.mdl my friend sent me.. 😱
Anyway, looked at it. ( code below ) Using 1 button for both RCS switches may not work, look at the VC code, comments provided.
There are 3 logic L:Vars inside the VC coding that rely on the RCS switch L:Var (sw position), this may not be so easy.
The situation(s):
1) Engine 1 is started, engine 2 is not. You put the single, dual control, RCS switch into RUN. --> Engine 2 probably will not start. ( and vice versa )
2) The stop position of either switch,  a whole nother story, it controls both engines.
3) Using a .mcro to "toggle" the single, dual control, RCS switch from CRANK --> RUN & versly, from RUN  --> CRANK probably will not work as the needed values are 0 and -1. If it weren't these values the macro could of used with the command of "TOGGLE" along with 2 buttons. A .lua is an option.
Some options (?) :
1) (easy) Only if situation #1 above is NOT true, and, you want to go in only 1 direction (crank --> run) then you could use a simple gauge added to the VC to 1 way mirror the 2 switches. (below) The problem with this is that it will always be active. The master will be the left RCS sw so you could add this : 3=L:SWITCH_RCS_L=SET to the start .mcro, then use a parameter of -1 for a button. This will keep your FSUIPC key/buttons tab from being greyed out.
The gauge:

<Gauge Name="MU2_RCS_Match" Version="1.0">
	<Update>
		(L:SWITCH_RCS_L,bool) -1 == (L:SWITCH_RCS_R,bool) -1 != and if{ (L:SWITCH_RCS_L,bool) (>L:SWITCH_RCS_R,bool) } 
	</Update>
</Gauge>

2) (IMO best) Go to pure lua for everything, including the starter switches. Use 2 buttons for the RCS & 1 button for the Starters.
If both RCS switches are in CRANK, the starter button will control the left engine. Otherwise the starter switch will follow whatever RCS switch is in CRANK.
The button(s) for each RCS switch will toggle between CRANK & RUN unless.. Both RCS switches are in RUN, both engines are running, aircraft is on the ground, parking brake is set, (maybe 1 more "safety" requirement), only then will it go to STOP. OFC controlling both switches, keeping with the internal VC logic.

All of this is based on the following VC code. If you would like to discuss this more perhaps it would be good to PM me, would be happy to help.

<!-- ENGINE 1 -->

<!-- LEFT CLICK, RUN POSITION (-1) -->
(M:Event) 'LeftSingle' scmp 0 == if{ (L:SWITCH_RCS_L,bool) -- -1 max (>L:SWITCH_RCS_L,bool) 1 (>L:XMLSND61,enum) }

<!-- RIGHT CLICK, CRANK POSITION (0), IF ALREADY ON CRANK, TEMPORARILY GOES TO STOP (1), ON RELEASE GOES TO CRANK (0) -->
(M:Event) 'RightSingle' scmp 0 == if{ (L:SWITCH_RCS_L,bool) ++ 1 min (>L:SWITCH_RCS_L,bool) 1 (>L:XMLSND61,enum) }
(M:Event) 'RightRelease' scmp 0 == if{ (L:SWITCH_RCS_L,bool) -- 0 max (>L:SWITCH_RCS_L,bool) }

<!-- MIDDLE CLICK, STOP POSITION (1), ALSO STOPS ENGINE 2, ON RELEASE GOES TO CRANK (0) -->
(M:Event) 'MiddleSingle' scmp 0 == if{ 1 (>L:SWITCH_RCS_L,bool) 1 (>L:SWITCH_RCS_R,bool) 1 (>L:ENG2_STOP,bool) 1 (>L:XMLSND61,enum) }
(M:Event) 'MiddleRelease' scmp 0 == if{ 0 (>L:SWITCH_RCS_L,bool) 0 (>L:SWITCH_RCS_R,bool) 1 (>L:ENG2_CRANK,bool) 0 (>L:ENG2_RUN,bool) 0 (>L:ENG2_STOP,bool) }

<!-- INTERNAL VC LOGIC CODE BASED ON THE VAR (L:SWITCH_RCS_L,bool) -->
(L:SWITCH_RCS_L,bool) -1 == if{ 1 (>L:ENG1_RUN,bool) 0 (>L:ENG1_CRANK,bool) } <!-- THIS MAY GET BAD WITH A SINGLE RCS SW -->
(L:SWITCH_RCS_L,bool) 0 == if{ 1 (>L:ENG1_CRANK,bool) 0 (>L:ENG1_RUN,bool) 0 (>L:ENG1_STOP,bool) }
(L:SWITCH_RCS_L,bool) 1 == if{ 1 (>L:ENG1_STOP,bool) }    



<!-- ENGINE 2 -->

<!-- LEFT CLICK, RUN POSITION (-1) -->
(M:Event) 'LeftSingle'  scmp 0 == if{ (L:SWITCH_RCS_R,bool) -- -1 max (>L:SWITCH_RCS_R,bool) 1 (>L:XMLSND61,enum) } 

<!-- RIGHT CLICK, CRANK POSITION (0), IF ALREADY ON CRANK, TEMPORARILY GOES TO STOP (1), ON RELEASE GOES TO CRANK (0) -->
(M:Event) 'RightSingle' scmp 0 == if{ (L:SWITCH_RCS_R,bool) ++ 1 min (>L:SWITCH_RCS_R,bool) 1 (>L:XMLSND61,enum) }
(M:Event) 'RightRelease' scmp 0 == if{ (L:SWITCH_RCS_R,bool) -- 0 max (>L:SWITCH_RCS_R,bool) }

<!-- MIDDLE CLICK, STOP POSITION (1), ALSO STOPS ENGINE 1, ON RELEASE GOES TO CRANK (0) -->
(M:Event) 'MiddleSingle' scmp 0 == if{ 1 (>L:SWITCH_RCS_L,bool) 1 (>L:SWITCH_RCS_R,bool) 1 (>L:ENG1_STOP,bool) 1 (>L:XMLSND61,enum) }
(M:Event) 'MiddleRelease' scmp 0 == if{ 0 (>L:SWITCH_RCS_L,bool) 0 (>L:SWITCH_RCS_R,bool) 1 (>L:ENG1_CRANK,bool) 0 (>L:ENG1_RUN,bool) 0 (>L:ENG1_STOP,bool) }

<!-- INTERNAL VC LOGIC CODE BASED ON THE VAR (L:SWITCH_RCS_R,bool) -->
(L:SWITCH_RCS_R,bool) -1 == if{ 1 (>L:ENG2_RUN,bool) 0 (>L:ENG2_CRANK,bool) }  <!-- THIS MAY GET BAD WITH A SINGLE RCS SW -->
(L:SWITCH_RCS_R,bool) 0 == if{ 1 (>L:ENG2_CRANK,bool) 0 (>L:ENG2_RUN,bool) 0 (>L:ENG2_STOP,bool) }
(L:SWITCH_RCS_R,bool) 1 == if{ 1 (>L:ENG2_STOP,bool) }


Good luck!
Roman

Edited by spokes2112
poor formatting
Link to comment
Share on other sites

John, Thank You for the info.   I understand what you are conveying now.  based on Romans post, this looks a lot more complicated then first thought.

Hi Roman, Thank You for your explanation. This seemed like a fairly simple thing to do.  I was just trying to make one button, control 2 VC switches at the same time.

Based on your info....this has now gone above my paygrade.  My brain hurts from what I just read above. Right now the start and stop functions are working fine for me.

I just wanted to consoilidate, due to the amount of switches I had.   Rather than tie two switches to one button, could I do separate macros for each function?

There are some buttons I could leave alone(SRL sw come to mind) that will free up some buttons,

If that is possible, then  would I just add the RCS Lvar as part of the macro to get back the animation?

Thank You

David

Edited by dwbarnett
Ref one to two switches in query
Link to comment
Share on other sites

2 hours ago, dwbarnett said:

If that is possible, then  would I just add the RCS Lvar as part of the macro to get back the animation?

No.. What you are doing now is directing the logic yourself via the STOP, RUN, and/or CRANK L:Vars.
The way it was designed is that the animation L:Vars (SWITCH_RCS) control these. Once you bring back the animation all the vars you use will be overridden by the internal logic.
I can stop over at my friends place (need to anyway) and fire up the MU2 and try a few things. I still think lua is the way to go, it will work as the designers intended & also keep your buttons/keys tab in FSUIPC from being greyed out. Once that happens you will have to assign any other keys/buttons by editing the FSUIPC.ini manually. An added plus is that you would get the switch click sounds back too.

Looking at the model again I think I can do the following with just 4 buttons :
1) Left RCS
2) Right RCS
3) Starter(s), L & R logic separately controlled by the states of the above 2 RCS switches
4) SRL ( L & R combined into 1 )

Will work on something, just to try it.. ( like doing this stuff )

Roman 
 

Link to comment
Share on other sites

Thank You Roman. Much appreciated. I have also reached out to another individual that

might could help as well.  Like you, he is looking at LUA scripts too.  We recently talked on discord, and discussed exactly what I'm trying to accomplish.

I am always open to any ideas, to make things work.  I'll let you folks brainfry, and I'll stick to flying for a living. 🙂

Thank You again for your valuable time and help Roman.    Have Fun!

best,

David

Link to comment
Share on other sites

Hi David,
All done and fully tested. 
This includes all the center pedestal switches dealing with startup/shutdown, you can pick and choose what you really need.
For a full simulation, without the dummy SFE switches you would need 6 buttons total.
If your SOP includes getting the props locked on shutdown & you don't need the feather buttons, then you would need 5 joystick buttons total. 
(Ground Starter Select, SRL Toggles, Left RCS, RIGHT RCS, Starter)
All animations work along with sounds.

Attached.
Hope it works well for you.
Roman

FSW MU-2 Hardware Interface.zip

Link to comment
Share on other sites

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.