예제 #1
0
MotorTestWizardPage::MotorTestWizardPage(QWidget *parent)
    : OnOffWizardPage(parent),
      m_timer(new QTimer(this)),
      m_theta(0.0)
{
    memset(m_on, false, sizeof_array(m_on) * sizeof(bool));
    setTitle(tr("Motor Test"));
    connect(this, SIGNAL(on(quint16)), SLOT(motorOn(quint16)));
    connect(this, SIGNAL(off(quint16)), SLOT(motorOff(quint16)));
}
예제 #2
0
/* Move the motor to absolute encoder position. */
int moveMotor(char *mv){
	motorOn();


	strcpy(out, "CLR"); //read current
        if(!fnPerformaxComSendRecv(Handle, out, 64,64, in))
        {
                printf("Could not send\n");
                return -1;
        }
	
	
	char cmd[12] = "X";  //Setup the Axes to move, this is a single axis controlled so it will always be x

	strcat(cmd, mv);
        strcpy(out, cmd); //move the motor
                if(!fnPerformaxComSendRecv(Handle, out, 64,64, in))
                {
                        printf("Could not send\n");
                        return -1;
                 }      
	return 1;
}