Main Content

ssGetElapseTimeCounterDtype

Get the data type of the elapse time counter associated with the S-function

Since R2023b

Syntax

void ssGetElapseTimeCounterDtype(SimStruct *S, int *dtype)

Arguments

S

SimStruct that represents an S-Function block.

dtype

The location of variable where the data type of the elapse time counter is to be stored

Description

Use to get the data type of the elapse time counter associated with the S-function. ssGetElapseTimeCounterDtype writes the data type of the elapse time counter to the location specified by the variable dtype.

Languages

C, C++

Examples

The following code snippet of the mdlOutputs callback for an s-function accesses the value of the elapse time counter according to its data type.

int    y_dtype;
ssGetElapseTimeCounterDtype(S, &y_dtype);

 switch(y_dtype) {
  case SS_DOUBLE_UINT32: 
      {
          uint32_T dataPtr[2];
          ssGetElapseTimeCounter(S, dataPtr);
      } 
      break;
  case SS_UINT32:
      {
         uint32_T dataPtr[1]; 
         ssGetElapseTimeCounter(S, dataPtr);
     }
      break;
  case SS_UINT16:
     {
          uint16_T dataPtr[1]; 
          ssGetElapseTimeCounter(S, dataPtr);
     }
      break;
  case SS_UINT8:
     {
         uint8_T dataPtr[1];
         ssGetElapseTimeCounter(S, dataPtr);
    }
     break;
  case SS_DOUBLE:
      {
         real_T dataPtr[1]; 
         ssGetElapseTimeCounter(S, dataPtr);
     }
      break;
  default:
    ssSetErrorStatus(S, "Invalid data type for elaspe time
        counter");
    break;
}
           
    
    
}

Version History

Introduced in R2023b