@mike
I got more questions sorry
when I want to calibrate an axis in native USB, I type: axis0.requested_state = 3
Now I need to implement this in ascii with one character command. So:
else if (cmd[0] == 'q') { // encoder count, format: e axis# count
unsigned motor_number;
int numscan = sscanf(cmd, "e %u", &motor_number);
if (numscan < 1) {
respond(response_channel, use_checksum, "invalid command format");
} else if (motor_number >= AXIS_COUNT) {
respond(response_channel, use_checksum, "invalid motor %u", motor_number);
} else {
axes[motor_number]->requested_state = 3;
}
}
Well, it does not work. I am suspecting the last instruction is wrong. Also I am not sure that numscan < 1 is correct either. Any suggestions?
OR
If I want to change position for a trap trajectory by using: axis0.controller.input_pos = 10000
else if (cmd[0] == 'n') { // encoder count, format: e axis# count
unsigned motor_number;
int32_t value;
int numscan = sscanf(cmd, "e %u %i", &motor_number, &value);
if (numscan < 1) {
respond(response_channel, use_checksum, "invalid command format");
} else if (motor_number >= AXIS_COUNT) {
respond(response_channel, use_checksum, "invalid motor %u", motor_number);
} else {
//respond(response_channel, use_checksum, "%u %f", motor_number, value);
axes[motor_number]->controller_.input_pos_ = value;
}
}
This also does not work. It does not give errors, it just does not move the motor. It is receiving the correct motor# and value. (yes i did check to see if the motor work using USB)
Jamil