whamil77

Making a FSUIPC Macro (Tutorial)

Recommended Posts

FSUIPC is a powerful tool for programming hardware controls in FSX and Prepar3D.  All of the control variables present in the simulator are directly accessible through FSUIPC and it provides more flexibility than the control settings resident in the simulator.  FSUIPC can also be used to access local panel variables (LVARS) that were introduced by the developer of the particular add-on aircraft.  Since the developer determines the nomenclature of the panel variables Mr. Dowson (FSUIPC developer) of course couldn't predict what those names would be.  So....he provided us with a way to identify developer panel variables and access/control them through FSUIPC Macros.  This tutorial is presented in a very elementary style that will be greatly oversimplified for many of the simmers that visit AVSIM.  If so, just roll your eyes and remember that some folks are just beginners. 

This tutorial will take you through setting the control for the Lift Dump on the Carenado Premier 1A.  If you don't have the Premier....no matter.  The steps are the same for every aircraft and every LVAR.  I will show how it's done using a keystroke, a button, a switch, and a lever (axis).  So, let's get started.


1.  Identify the variable you want to control.  In this case, we want to control the Lift Dump function, but we don't know what variable controls it.  Use the following procedure to identify the variable.  
    
    a.  Start the simulator and get the subject aircraft running.
    b.  Using the mouse, activate the control in question.  In this case, unlock and deploy the Lift Dump.

iqbY0NK.jpg

c.  Open the FSUIPC window. Select the "Buttons + Switches" tab. Check the "Profile specific?" option.  Press the joystick button you want to use to find the Lift Dump variable.  (This can be a temporary assigment because you will not normally use this when flying.  The assignment can be cancelled later and                   returned to its previous function.)

ycotouO.jpg
d.  In this case the button I pushed was the Joystick #0, Button #25.  On the right of the FSUIPC box, check "Select for FS control".  In the pull-down menu under "Control sent when button pressed", select "List Local Panel Vars". Click "OK" to close the FSUIPC window.

e.  Un-pause the simulator.  Press the button you just selected to list the panel variables.  Exit the simulator.
f.  Go to the "Modules" folder in your simulator directory and open the file "FSUIPC4.log" in notepad.  

niOTOkk.jpg

AVrtIe8.jpg
g.  At this point you still don't know exactly what you are looking for.  You must look through the log for something that looks like what you want.  You can use the "find" function in notepad to help.  In this case, I entered "Dump" in the find function.   
h.  In this case, the find function returned something called "L:ASD_390_LEVER_LIFT_DUMP = 1.00".  Looks pretty promising.  Remember that we deployed the Lift Dump with the mouse prior to scanning for the panel variables.  The "=1.00" suggests that this "L:ASD_390_LEVER_LIFT_DUMP" has been deployed.  We would expect to see "=0.00" for something that hasn't been actuated.  We're feeling pretty good that this is the variable that we want.

    Note:  If you want to save this log for future reference you must rename it to something else.  Each time you exit the simulator FSUIPC will overwrite the "FSUIPC4.log" file and it will not contain LVARS unless you push the "List local Panel Vars" button.

2.  Now that we have likely identified the variable we want, it's time to build a FSUIPC macro that will allow us to control it.

         a.  On the start menu, open "Computer" and select "Organize" and "Folder and Search Options"

A7DGeax.jpg

       b.  Select the "View" tab and scroll down until you see "Hide extensions for known file types". This should NOT be checked.

       c.  Go to the desktop and right-click.  Select "New" and "Text Document".

ncRnih7.jpg

       d.  You should now have a file on your desktop entitled "New Text Document.txt".  Rename it "390_Dump_Toggle.mcro".  The computer will object to changing the file extension with a warning.  Click "yes".  The title should be as short and descriptive as possible because, as you will see later in the tutorial, not all of         the macro will show when you are selecting it in FSUIPC.  The "390" identifies the airplane, the "Dump" identifies the function, and the "Toggle" identifies how it will be used.

L30u1zb.jpg

whx7nzG.jpg

       e.  Open the new .mcro file.  Type "[Macros]" in the first line.  In the second line type "1=L:ASD_390_LEVER_LIFT_DUMP=Toggle".  Save the file.

    Note:  The number will always be "1" because FSUIPC allows only one macro per LVAR macro file.  The LVAR we are trying is "L:ASD_390_LEVER_LIFT_DUMP".  The options for the command of execution are "Set", "Toggle", "Inc", "Dec", "Sbits", "Cbits", and "Cyclic".  If you can read "genius", a fuller explanation of these can be found in a pdf file included in your FSUIPC Documents folder entitled "FSUIPC4 for Advanced Users" on page 42.  For the purposes of this tutorial, we will only address "Set" and "Toggle". Set works well if you are going to use a switch or axis for control and toggle works best for buttons or keypresses.

RZSfMea.jpg


3.  Place the new macro into the Modules folder in your base simulator directory (the same folder that contains "FSUIPC4.dll").

kOezfge.jpg

4.  Start the simulator and get the Premier 1A running.  Open FSUIPC from the "Add-Ons" menu.

KEYPRESS

1.  Select the "Key Presses" tab in the FSUIPC window.  Check the "Profile specific" box and press the "Set" option on the left side of the window.  

m2bG8pB.jpg


2.  Press the key you want to use to toggle the Lift Dump.  I used "D" in the example. Press the down arrow to the right of the "Control sent when keys pressed" section.  A pop-up menu should emerge with "390_Dump_Toggle:L:ASD 390 LEVER LIFT DUMP....." as an option.  Notice that you can't see the entire macro and you can't see whether the command was set or toggle or whatever.  That's why you name the macro descriptively.  Select that and click "OK".  With the toggle function there is no need to set a parameter.

0CV9McW.jpg

3.  Un-pause the simulator and try your new macro.  Press "D" and the Lift Dump should deploy.  Press "D" again and it should retract.  If it works...you're done. 

rJUUrAr.jpg

rATb1Nh.jpg

4.  If it doesn't work, there could be several causes.  One, you may not have identified the correct variable.  Sometimes they have goofy names and it's difficult to sort them out.  You also may have mis-formatted the macro itself.  It is very strict and must be formatted exactly right.

BUTTON TOGGLE

1.  The idea is exactly the same as using the keypress except it's programmed in the "Buttons + Switches" tab of FSUIPC.  Check the "Profile specific" box, check the "Select for FS control" box, select the down arrow button in the "Control sent when button pressed" and select "390 Dump Toggle:L:ASD....." as before.  Click OK and try the button in the simulator.

i9caVg8.jpg

SWITCH SET

1.  Make a copy of your macro and rename it "390_Dump_Set.mcro".  Open the file and change "Toggle" to "Set".
2.  Restart the simulator.  Macros are only loaded into FSUIPC during simulator startup.  Any changes made while the simulator is running will not be loaded.     
3.  With the sim running select FSUIPC from the "Add-Ons" menu.  
4.  Selecting a switch is very similar to selecting a button.  Check the "Profile specific?" box.  Actuate the switch to be used.  In the example I used Joystick #0, Switch #19.  Check the "Select for FS control" box and select "390 Dump Set:L:ASD....." in both the "Control sent when button pressed" box and the "Control sent when button released" box.

D6XIJAr.jpg

5.  Enter "1" in the parameter that you want to deploy the Lift Dump and enter "0" into the parameter that you want to retract it.  Either parameter will work.  The choice of parameter placement governs the direction of the switch.  Sometimes it's trial and error (developers occasionally get the commands backwards as well).  Click OK and give it a try.

USING AN AXIS

This is my preferred method because it most closely resembles levers typically used for spoilers and lift dumps.  I have two propeller levers and two mixture levers going unused in most jets so I like to use them for spoilers and lift dumps.  

1.  Get the sim and the airplane running as before.
2.  Open FSUIPC from the "Add-Ons" menu.
3.  Click on the "Axis Assignment" tab.

4.  Move the lever you want to use for the lift dump.  I use the #2 propeller lever.  If you have used FSUIPC before you know that you may have to monkey with the "Rescan" or "Ignore Axis" buttons to get to the lever you want.
5.  Once you are sure that the desired lever is the one selected, check the "Send to FS as normal axis" bullseye.
6.  On the right side of the FSUIPC window you will see a section that says "Set up to 10 ranges for action".  Pull the lever half way back and select the "To" button.  Pull the lever all the way back and select the "From" button.  Check the "Up" and "Down" boxes.  You should see something like this.

fuEbV2q.jpg

7.  Just like we did with the switch, select "390 Dump Set:L:ASD....." on both the "Control sent when range entered" and "Control set when range exited" boxes.  Set parameter "1" for range entered and parameter "0" for range exited.  Click OK and give it a try. 

DJPFaOX.jpg

This should get you going with FSUIPC Macros.  As I said earlier, more detailed information can be found in your FSUICP Documents folder.

Happy Simming!

 

  • Upvote 5

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Guest
This topic is now closed to further replies.