当前位置: 首页>>代码示例>>C++>>正文


C++ Stage::EnableAmp方法代码示例

本文整理汇总了C++中Stage::EnableAmp方法的典型用法代码示例。如果您正苦于以下问题:C++ Stage::EnableAmp方法的具体用法?C++ Stage::EnableAmp怎么用?C++ Stage::EnableAmp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stage的用法示例。


在下文中一共展示了Stage::EnableAmp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TestPtToPtMotionInPCSCommand

int TestPtToPtMotionInPCSCommand()
{

//	NMCSERVO Servo;
	int iModules;
	int iError;
	long lPosition;
	double dXPosition,dYPosition,dZPosition;
	double dCmdXPosition,dCmdYPosition,dCmdZPosition;
	double dCmdXSpeed,dCmdYSpeed,dCmdZSpeed;
	double dCmdXAccel,dCmdYAccel,dCmdZAccel;
	double dVelocity;
	double dXHome, dYHome, dZHome;
	byte byAD;
	
	iModules=g_stage.Initialize("COM9:");

	SetScaling_3Axis();
	SetPIDGain_3Axis();

	g_stage.Rotate(180.0);

	g_stage.SetVel(3.0, 3.0, 3.0);
	g_stage.SetAccel(1.0, 1.0, 1.0);

	g_stage.EnableAmp();
	g_stage.ResetPos();
	
	g_stage.GetCmdVel(dCmdXSpeed, dCmdYSpeed, dCmdZSpeed);
	g_stage.GetSpeed(dCmdXSpeed, dCmdYSpeed, dCmdZSpeed);
	g_stage.GetCmdAccel(dCmdXAccel, dCmdYAccel, dCmdZAccel );

	millCmd millctrl;
	BOOL bMotion;

//	iError=g_stage.MoveTo(0.0, 0.0, 0.0, true);
//	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	stageMoveXYZ *stagemove1 = new stageMoveXYZ(g_stage, 0.0, 0.0, 0.0); 
	millctrl.SetCommand(stagemove1);

	stageGetPos *stagegetpos1 = new stageGetPos(g_stage);
	millctrl.SetCommand(stagegetpos1);

	double x,y,z;
//	x=0.5;y= 0.0;z= 0.0;
//	iError=g_stage.MoveTo(x,y,z, true);
//	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	stageMoveXYZ *stagemove2 = new stageMoveXYZ(g_stage,0.5, 0.0, 0.0); 
	millctrl.SetCommand(stagemove2);
	stageGetPos *stagegetpos2 = new stageGetPos(g_stage);
	millctrl.SetCommand(stagegetpos2);
	
//	x=0.0;y= 0.5;z= 0.0;
//	iError=g_stage.MoveTo(x,y,z, true);
//	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	stageMoveXYZ *stagemove3 = new stageMoveXYZ(g_stage,0.0, 0.5, 0.0); 
	millctrl.SetCommand(stagemove3);
	stageGetPos *stagegetpos3 = new stageGetPos(g_stage);
	millctrl.SetCommand(stagegetpos3);

//	x=-0.5;y= 0.0;z= 0.0;
//	iError=g_stage.MoveTo(x,y,z, true);
//	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	stageMoveXYZ *stagemove4 = new stageMoveXYZ(g_stage,-0.5, 0.0, 0.0); 
	millctrl.SetCommand(stagemove4);
	stageGetPos *stagegetpos4 = new stageGetPos(g_stage);
	millctrl.SetCommand(stagegetpos4);

//	x=0.0;y= -0.5;z= 0.0;
//	iError=g_stage.MoveTo(x,y,z, true);
//	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	stageMoveXYZ *stagemove5 = new stageMoveXYZ(g_stage,0.0, -0.5, 0.0); 
	millctrl.SetCommand(stagemove5);
	stageGetPos *stagegetpos5 = new stageGetPos(g_stage);
	millctrl.SetCommand(stagegetpos5);

//	x=0.5;y= 0.5;z= 0.0;
//	iError=g_stage.MoveTo(x,y,z, true);
//	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	stageMoveXYZ *stagemove6 = new stageMoveXYZ(g_stage,0.5, 0.5, 0.0); 
	millctrl.SetCommand(stagemove6);
	stageGetPos *stagegetpos6 = new stageGetPos(g_stage);
	millctrl.SetCommand(stagegetpos6);

//	x=-0.5;y= -0.5;z= 0.0;
//	iError=g_stage.MoveTo(x,y,z, true);
//	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	stageMoveXYZ *stagemove7 = new stageMoveXYZ(g_stage,-0.5, 0.5, 0.0); 
	millctrl.SetCommand(stagemove7);
	stageGetPos *stagegetpos7 = new stageGetPos(g_stage);
	millctrl.SetCommand(stagegetpos7);
	
//	x=0.5;y= -0.5;z= 0.0;
//	iError=g_stage.MoveTo(x,y,z, true);
//	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	stageMoveXYZ *stagemove8 = new stageMoveXYZ(g_stage,0.5, -0.5, 0.0); 
	millctrl.SetCommand(stagemove8);
	stageGetPos *stagegetpos8 = new stageGetPos(g_stage);
	millctrl.SetCommand(stagegetpos8);
	
//.........这里部分代码省略.........
开发者ID:duchiy,项目名称:CNCMillwithGCodeInterpreter,代码行数:101,代码来源:Motion.cpp

示例2: TestPtToPtMotionShort

int TestPtToPtMotionShort()
{

//	NMCSERVO Servo;
	int iModules;
	int iError;
	long lPosition;
	double XPos,YPos,ZPos;
	double CmXPos,CmdYPos,CmdZPos;
	double dCmdXSpeed,dCmdYSpeed,dCmdZSpeed;
	double dCmdXAccel,dCmdYAccel,dCmdZAccel;
	double dVelocity;
	double dXHome, dYHome, dZHome;
	byte byAD;

	iModules=g_stage.Initialize("COM4:");

	SetScaling_3Axis();
	SetPIDGain_3Axis();


	g_stage.SetVel(3.0, 3.0, 3.0);
	g_stage.SetAccel(6.0, 6.0, 6.0);

	g_stage.EnableAmp();
	g_stage.ResetPos();
	g_stage.GetHome( dXHome, dYHome, dZHome);

	BOOL bMotion;
	iError=g_stage.MoveRel(0.00, 0.00, 0.15, true);
	iError=g_stage.MoveRel(0.00, 0.00, 0.15, true);
	iError=g_stage.MoveRel(0.00, 0.00, 0.15, true);
	iError=g_stage.MoveRel(0.15, 0.00, 0.00, true);
	iError=g_stage.MoveRel(0.15, 0.00, 0.00, true);
	iError=g_stage.MoveRel(0.15, 0.00, 0.00, true);
	iError=g_stage.MoveRel(0.00, 0.15, 0.00, true);
	iError=g_stage.MoveRel(0.00, 0.15, 0.00, true);
	iError=g_stage.MoveRel(0.00, 0.15, 0.00, true);
	iError=g_stage.MoveTo(1.00, 1.000, 1.000, true);
	g_stage.GetPos(XPos, YPos, ZPos );
	if ( !((XPos < 1.02) && (XPos > 0.98)) && 
		 !((YPos < 1.02) && (YPos > 0.98)) &&
		 !((ZPos < 1.02) && (ZPos > 0.98))   )
		 MessageBox(NULL, "Error with Position","Error Dialog", 1);

	g_stage.GetHome( dXHome, dYHome, dZHome);

	g_stage.GetCmdAccel(dCmdXSpeed, dCmdYSpeed, dCmdZSpeed);
	g_stage.GetCmdAccel(dCmdXAccel, dCmdYAccel, dCmdZAccel );

	iError=g_stage.MoveTo(0.0, 0.0, 0.0, true);

	g_stage.GetPos(XPos, YPos, ZPos );
	if ( !((XPos < 0.02) && (XPos > -0.02)) && 
		 !((YPos < 0.02) && (YPos > -0.02)) &&
		 !((ZPos < 0.02) && (ZPos > -0.02))   )
		 MessageBox(NULL, "Error with Position","Error Dialog", 1);

	iError=g_stage.MoveTo(0.000, 0.000, 0.000, true);
	g_stage.GetPos(XPos, YPos, ZPos );

	g_stage.GetHome( dXHome, dYHome, dZHome);

	return 0;
}	
开发者ID:duchiy,项目名称:CNCMillwithGCodeInterpreter,代码行数:65,代码来源:Motion.cpp

示例3: TestPtToPtMotionInPCSWithStage

int TestPtToPtMotionInPCSWithStage()
{

//	NMCSERVO Servo;
	int iModules;
	int iError;
	long lPosition;
	double dXPosition,dYPosition,dZPosition;
	double dCmdXPosition,dCmdYPosition,dCmdZPosition;
	double dCmdXSpeed,dCmdYSpeed,dCmdZSpeed;
	double dCmdXAccel,dCmdYAccel,dCmdZAccel;
	double dVelocity;
	double dXHome, dYHome, dZHome;
	byte byAD;
	
	iModules=g_stage.Initialize("COM3:");

	SetScaling_3Axis();
	SetPIDGain_3Axis();

	g_stage.Rotate(180.0);

	g_stage.SetVel(3.0, 3.0, 3.0);
	g_stage.SetAccel(1.0, 1.0, 1.0);

	g_stage.EnableAmp();
	g_stage.ResetPos();
	
	g_stage.GetCmdVel(dCmdXSpeed, dCmdYSpeed, dCmdZSpeed);
	g_stage.GetSpeed(dCmdXSpeed, dCmdYSpeed, dCmdZSpeed);
	g_stage.GetCmdAccel(dCmdXAccel, dCmdYAccel, dCmdZAccel );

	
	BOOL bMotion;
	iError=g_stage.MoveTo(0.0, 0.0, 0.0, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );

	double x,y,z;
	x=0.5;y= 0.0;z= 0.0;
	iError=g_stage.MoveTo(x,y,z, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	
	x=0.0;y= 0.5;z= 0.0;
	iError=g_stage.MoveTo(x,y,z, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );

	x=-0.5;y= 0.0;z= 0.0;
	iError=g_stage.MoveTo(x,y,z, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );

	x=0.0;y= -0.5;z= 0.0;
	iError=g_stage.MoveTo(x,y,z, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );

	x=0.5;y= 0.5;z= 0.0;
	iError=g_stage.MoveTo(x,y,z, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );

	x=-0.5;y= -0.5;z= 0.0;
	iError=g_stage.MoveTo(x,y,z, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	
	x=0.5;y= -0.5;z= 0.0;
	iError=g_stage.MoveTo(x,y,z, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );
	
	x=-0.5;y= 0.5;z= 0.0;
	iError=g_stage.MoveTo(x,y,z, true);
	g_stage.GetPos(dXPosition, dYPosition, dZPosition );

//	iError=Servo.move(-8000,2);
//	do{
//		bMotion=Servo.IsInMotion();
//	}
//	while(bMotion);
//	g_stage.GetHome( dXHome, dYHome, dZHome);

	return 0;
}
开发者ID:duchiy,项目名称:CNCMillwithGCodeInterpreter,代码行数:79,代码来源:Motion.cpp


注:本文中的Stage::EnableAmp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。