Hello All, i have some question about Utility routines written in C++.
I'm currently using C++ based User subroutine for VDLOAD, VEXTERNALDB, VUAMP etc.
Quite familiar with C++ based user subroutine, but not for the utility routine especially 'vGetSensorValue'.
How can i call 'vGetSensorValue' routine in C++ based subroutine code?
Here is the example of C++ based VUAMP which can compile easily but not with 'vGetSensorValue' routines
#include
#include
#include
#include
#include
#include
#include
extern "C" void vGetSensorValue(char* sensorNames, float* jSensorLookUpTable, float* sensorValues);
extern "C" void FOR_NAME(vuamp,VUAMP) (
char* ampName, float* time, float* ampValueOld, float* dt, float* nprops, float* props,
float* nSvars, float* svars, double* lFlagsInfo, int* nSensor, float* sensorValues,
char* sensorNames, float* jSensorLookUpTable, double* AmpValueNew, float* lFlagsDefine,
float* AmpDerivative, float* AmpSecDerivative, float* AmpIncIntegral){
float displacement=0;
std::size_t len = strnlen(ampName, 3);
std::string sname_str(ampName, len);
// Time Indices
const int iStepTime = 1;
const int iTotalTime = 2;
const int nTime = 2;
// Flags passed in for information
const int iInitialization = 1;
const int iRegularInc = 2;
const int ikStep = 3;
const int nFlagsInfo = 3;
// Optional flags to be defined
const int iComputeDeriv = 1;
const int iComputeSecDeriv = 2;
const int iComputeInteg = 3;
const int iStopAnalysis = 4;
const int iConcludeStep = 5;
const int nFlagsDefine = 5;
// std::cout << "sname_str=" << sname_str << std::endl;
vGetSensorValue(sensorNames, jSensorLookUpTable, sensorValues);
if (ampName == "AAA") {
AmpValueNew = 0;
}
}
