📄 motomandlg.cpp
字号:
{
k0=m_sAxis;
k1=m_lAxis;
k2=m_uAxis;
k3=m_bAxis;
k4=m_rAxis;
k5=m_tAxis;
Sleep (1);
BscIsLoc(nCid,1,rconf,GetPulse);
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_bAxis=GetPulse[3];
m_rAxis=GetPulse[4];
m_tAxis=GetPulse[5];
MSG msg;
while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
while(k0!=m_sAxis||k1!=m_lAxis||k2!=m_uAxis||k3!=m_bAxis||k4!=m_rAxis||k5!=m_tAxis);
}
void CMotomanDlg::OnUp()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=0;
SetPulse[2]=10;
SetPulse[3]=0;
SetPulse[4]=0;
SetPulse[5]=0;
BscMov(nCid,"IMOV","V",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
//Delay();
int zhi=BscJobWait(nCid,-1);
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnDown()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=0;
SetPulse[2]=-10;
SetPulse[3]=0;
SetPulse[4]=0;
SetPulse[5]=0;
BscMov(nCid,"IMOV","V",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnLeft()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=-10;
SetPulse[2]=0;
SetPulse[3]=0;
SetPulse[4]=0;
SetPulse[5]=0;
BscMov(nCid,"IMOV","V",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnRight()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=10;
SetPulse[2]=0;
SetPulse[3]=0;
SetPulse[4]=0;
SetPulse[5]=0;
BscMov(nCid,"IMOV","V",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnForword()
{
// TODO: Add your control notification handler code here
SetPulse[0]=10;
SetPulse[1]=0;
SetPulse[2]=0;
SetPulse[3]=0;
SetPulse[4]=0;
SetPulse[5]=0;
BscMov(nCid,"IMOV","V",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnBackword()
{
// TODO: Add your control notification handler code here
SetPulse[0]=-10;
SetPulse[1]=0;
SetPulse[2]=0;
SetPulse[3]=0;
SetPulse[4]=0;
SetPulse[5]=0;
BscMov(nCid,"IMOV","V",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnXturn()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=0;
SetPulse[2]=0;
SetPulse[3]=10;
SetPulse[4]=0;
SetPulse[5]=0;
BscMov(nCid,"IMOV","VR",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnXreturn()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=0;
SetPulse[2]=0;
SetPulse[3]=-10;
SetPulse[4]=0;
SetPulse[5]=0;
BscMov(nCid,"IMOV","VR",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnYturn()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=0;
SetPulse[2]=0;
SetPulse[3]=0;
SetPulse[4]=10;
SetPulse[5]=0;
BscMov(nCid,"IMOV","VR",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnYreturn()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=0;
SetPulse[2]=0;
SetPulse[3]=0;
SetPulse[4]=-10;
SetPulse[5]=0;
BscMov(nCid,"IMOV","VR",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnZturn()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=0;
SetPulse[2]=0;
SetPulse[3]=0;
SetPulse[4]=0;
SetPulse[5]=10;
BscMov(nCid,"IMOV","VR",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnZreturn()
{
// TODO: Add your control notification handler code here
SetPulse[0]=0;
SetPulse[1]=0;
SetPulse[2]=0;
SetPulse[3]=0;
SetPulse[4]=0;
SetPulse[5]=-10;
BscMov(nCid,"IMOV","VR",m_speed,"BASE",Form,0,SetPulse);
//判断机器人是否停止运动
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
//显示各轴脉冲
m_sAxis=GetPulse[0];
m_lAxis=GetPulse[1];
m_uAxis=GetPulse[2];
m_rAxis=GetPulse[3];
m_bAxis=GetPulse[4];
m_tAxis=GetPulse[5];
//获取机器人末端位姿
BscIsLoc(nCid,0,rconf,GetPos);
m_xEnd=GetPos[0];
m_yEnd=GetPos[1];
m_zEnd=GetPos[2];
m_rxEnd=GetPos[3];
m_ryEnd=GetPos[4];
m_rzEnd=GetPos[5];
UpdateData(FALSE);
}
void CMotomanDlg::OnSpulse()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
SetPulse[0]=m_sAxis-3000;
SetPulse[1]=m_lAxis;
SetPulse[2]=m_uAxis;
SetPulse[3]=m_rAxis;
SetPulse[4]=m_bAxis;
SetPulse[5]=m_tAxis;
BscPMovj(nCid,m_speed,0,SetPulse);
//判断机器人运动是否停止
Delay();
//获取机器人各轴脉冲
BscIsLoc(nCid,1,rconf,GetPulse);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -