# Variable airfoils using the MulTabLoc USER function

**URL:** <https://forums.nlr.gov/t/variable-airfoils-using-the-multabloc-user-function/1006>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [October 1, 2014, 9:18am UTC](https://forums.nlr.gov/t/variable-airfoils-using-the-multabloc-user-function/1006 "2014-10-01T09:18:11Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Xiao.Sun](https://avatars.discourse-cdn.com/v4/letter/x/82dd89/32.png) [@Xiao.Sun](https://forums.nlr.gov/u/Xiao.Sun)\
**Post date:** [December 30, 2015, 9:47pm UTC](https://forums.nlr.gov/t/variable-airfoils-using-the-multabloc-user-function/1006/9 "2015-12-30T21:47:37Z")

</div>

Hello Bonnie,

Thanks for the helpful discussion here.  
I tested the MulTabLoc feature with a hard coded Table location and it works.  
However, not like Niklas, I plan to use the simulink +FAST\_Sfunc to control my flap angle, similar to Keshan did in this poster  
[url][Instructions for Compiling FAST - #121 by Keshan.He](http://forums.nlr.gov/t/instructions-for-compiling-fast/514/121)]

I have one question regarding to the “NumAdditionalInputs” parameter.  
I have total three additional inputs, corresponding to the flap angle of each flap of each blade.  
So I expect I should set NumAdditionalInputs to 3.  
And I change the FAST\_library code like this:

```auto
subroutine FAST_SetExternalInputs(NumInputs_c, InputAry, m_FAST)

   USE, INTRINSIC :: ISO_C_Binding
   USE FAST_Types
! USE FAST_Data, only: NumFixedInputs
   
   IMPLICIT NONE

   INTEGER(C_INT), INTENT(IN ) :: NumInputs_c      
   REAL(C_DOUBLE), INTENT(IN ) :: InputAry(NumInputs_c) ! Inputs from Simulink
   TYPE(FAST_MiscVarType), INTENT(INOUT) :: m_FAST ! Miscellaneous variables
   
         ! set the inputs from external code here...
         ! transfer inputs from Simulink to FAST
      IF ( NumInputs_c < NumFixedInputs ) RETURN ! This is an error
          
           
      m_FAST%ExternInput%GenTrq = InputAry(1)
      m_FAST%ExternInput%ElecPwr = InputAry(2)
      m_FAST%ExternInput%YawPosCom = InputAry(3)
      m_FAST%ExternInput%YawRateCom = InputAry(4)
      m_FAST%ExternInput%BlPitchCom = InputAry(5:7)
      m_FAST%ExternInput%HSSBrFrac = InputAry(8)
      
     
            
      IF ( NumInputs_c > NumFixedInputs ) THEN ! NumFixedInputs is the fixed number of inputs
         IF ( NumInputs_c == NumFixedInputs + 3 ) &
             !Xiao Sun: Set NumAdditionalInput to 3
             ! Pass three flap angle input to AeroDyn
             m_FAST%ExternInput%FlapCtrl = InputAry(9:11)
             m_FAST%ExternInput%LidarFocus = InputAry(9:11)
      END IF   
      
end subroutine FAST_SetExternalInputs
```

However, in your reply to Keshan, you said the NumAdditionalInputs can be set to [3, COM11\_STU].  
What does that mean? Does that mean InputAry(1) can be a array that contains three flap angle values?

---

_[View the full topic](https://forums.nlr.gov/t/variable-airfoils-using-the-multabloc-user-function/1006)._
