*SetCoupler() - single coupler with user subroutine
Sets the properties of a coupler with a user subroutine.
Syntax
*SetCoupler(coupler_name, USER, `expr`)
*SetLocalUserDLLFlag(coupler_name, TRUE|FALSE)
*SetLocalUserDLL(coupler_name, "string")
*SetLocalUserFuncname(coupler_name, FunctionName)
Arguments
- coupler_name
- The variable name of the coupler.
- USER
- Indicates the user-written subroutine used to model the coupler.
- expr
- The solver expression that sets the arguments for the user defined coupler.
Example
*BeginMDL(model, "The Model")
*Point(p_0, "Point 0")
*Point(p_1, "Point 1")
*Point(p_2, "Point 2")
*Point(p_3, "Point 3")
*SetPoint(p_0, 1, 2, 3)
*SetPoint(p_1, 4, 5, 6)
*SetPoint(p_2, 7, 8, 9)
*SetPoint(p_3, 10, 11, 12)
*Body(b_0, "Body 0", p_0)
*Body(b_1, "Body 1", p_1)
*Body(b_2, "Body 2", p_2)
*Body(b_3, "Body 3", p_3)
*RevJoint(j_0, "Rev Joint 0", b_0, b_1, p_0, V_Global_Y, ALLOW_COMPLIANCE)
*RevJoint(j_1, "Rev Joint 1", b_1, b_2, p_1, V_Global_Z, ALLOW_COMPLIANCE)
*RevJoint(j_2, "Rev Joint 2", b_2, b_3, p_2, V_Global_X, ALLOW_COMPLIANCE)
*Coupler(c_0, "Coupler 0", 2JOINT, j_0, j_1, ROT, ROT)
*SetCoupler(c_0, USER, `USER( 300, 1, 2)`)
*SetLocalUserDLLFlag(c_0, TRUE)
*SetLocalUserDLL(c_0, "C:/Test/MyCoupler.dll")
*SetLocalUserFuncname(c_0, "COUSUB")
*SetLocalUserFunction(c_0, DLL)
*EndMDL()
Context
Comments
Coupler properties can be defined using COUSUB, COUXXX, and COUXX2 user subroutines, which get compiled into a DLL.