If the user wants to open and use User-defined Program and RecurDyn at the same time, RecurDyn recommends that the user uses the following step.
Library files: <Install Dir>/Toolkits/Controls/General10/CoSim_Operator.lib, CoSim_Operator.dll, CoSimGeneral.h
Interface Function
RunSimulation:
•wchar_t *ModelName
•double endtime
•int plotstep
•double interfacestep
This function must be called only one before interfacing.
|
Parameter Name |
Unit |
Input/Output |
Type |
Description |
|
ModelName |
[-] |
Input |
Wchar_t |
Is the RecurDyn model name |
|
endtime |
[-] |
Input |
double |
Is the simulation end time |
|
plotstep |
[-] |
Input |
int |
Is the RecurDyn request step |
|
interfacestep |
[-] |
Input |
double |
Is the sampling period |
CommunicateRecurDyn:
•double sim_time
•int iNPin
•int iNPout
•double *dPIN
•double *dPOUT
•double *rd_time
•int *error
This function must be called once at interface time step.
|
Parameter Name |
Unit |
Input/Output |
Type |
Description |
|
sim_time |
[-] |
Input |
double |
Is the simulation time |
|
iNPin |
[-] |
Input |
int |
Is the number of plant input |
|
iNPout |
[-] |
Input |
int |
Is the number of plant output |
|
dPIN |
[-] |
Input |
double |
Is the values of plant input |
|
dPOUT |
[-] |
Output |
double |
Is the values of plant output |
|
rd_time |
[-] |
Output |
double |
Is the RecurDyn simulation time |
|
error |
[-] |
Output |
int |
0: no error 1: The model is abnormally stopped 2: The RecurDyn don't respond. 3: Interface time don’t match. |
GetStatusRecurDyn:
•StatusRecurDyn* statusRD
•int* error
This function must be called once at interface time step.
|
Parameter Name |
Unit |
Input/Output |
Type |
Description |
|
statusRD |
[-] |
Output |
StatusRecurDyn* |
Returns the number of plant inputs and plant outputs. |
|
error |
[-] |
Output |
Int* |
error>0 : no error |
GetStringPlantInput:
•int seq
•char* chDirectory
•int* error
|
Parameter Name |
Unit |
Input/Output |
Type |
Description |
|
seq |
[-] |
Output |
int |
Returns the sequence of plant input. |
|
seq_input |
[-] |
Output |
char* |
Returns the string of plant input defined the seq. |
|
error |
[-] |
Output |
int* |
error>0 : fails to return. |
GetStringPlantOutput:
•int seq
•char* chDirectory
•int* error
|
Parameter Name |
Unit |
Input/Output |
Type |
Description |
|
seq |
[-] |
Output |
int |
Returns the sequence of plant output. |
|
seq_output |
[-] |
Output |
char* |
Returns the string of plant output defined the seq. |
|
error |
[-] |
Output |
int* |
error>0 : fails to return. |
CloseRecurDyn();
This function must be called only one after interfacing.
StopRecurDyn();
This function must be called only one after interfacing.