Step III_2 (In User-defined Program)

 

If using this step, the user has to close RecurDyn model before starting the simulation.

 

Library files: <Install Dir>/Toolkits/Controls/General10/CoSimRD.lib, CoSimRD.dll

 

Interface Function

RunRecurDyn:

     char* chDirectory

     char* chmodelname

     double controltimestep

     double endtime

     int plotStep

     int staticanalysis

     int RecurDynShow

     int RecurDynAni

     int* errorcode

 

This function must be called only one before interfacing.

 

Parameter Name

Unit

Input/Output

Type

Description

chDirectory

[-]

Input

char*

Is the RecurDyn program installed directory.

chmodelname

[-]

Input

char*

Is the RecurDyn model name

controltimestep

[-]

Input

double

Is the interface step

endtime

[-]

Input

double

Is the simulation end time

plotStep

[-]

Input

int

Is the RecurDyn request step

staticanalysis

[-]

Input

int

0: dynamic analysis

1: static analysis

RecurDynShow

[-]

Input

int

0: no 

1: show the RecurDyn program

RecurDynAni

[-]

Input

int

0: no 

1: show the animation

errorcode

[-]

Output

int

0: no error

1: The model can’t be simulated.

2: RecurDyn can’t be executed.

 

CommunicateRecurDyn:

     double sim_time

     int iNPin

     int iNPout

     double *dPIN

     double *dPOUT

     double *rd_time

     int *errorcode

 

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 code

[-]

Output

int

0: no error

1: The model is abnormally stopped

2: The RecurDyn don't respond.

3: Interface time don’t match.

 

CloseRecurDyn();

This function must be called only one after interfacing.