0

so I am following the steps to create a C Call block function in Simulink as in the video linked here: C Caller Block – Integrate your C code into Simulink Models Here is the source code and header file:

       #ifndef HEADER_H_
       #define HEADER_H_
       // Global Variable

       extern double gVec[5];
       extern double sum;
       //Function
       extern void cumulativeAdder(void);
       #endif

//***************************************************************

      #include "header.h"
      double gVec[5];
      double sum = 0;
      void cumulativeAdder(void){
      int idx = 0, tmpSum = 0;

      for(; idx < 5, ++idx){
           tmpSum = tmpSum + gVec[idx);  // Function reads "gVec" as INPUT
       }
       sum = tmpSum; //Function writes to "sum" as OUTPUT
       }

and here is the Screenshot of the way how it looks like the port specifications of the block: enter image description here

so in the tutorial the port specifications recognise the Global variable but in my side nothing, it does not even recognise the c function "cumulativeAdder" from time to time! is it a synchronisation problem? I am using version 2019b