Added stop and error reset function for masterMacs

This commit is contained in:
2025-03-19 15:06:45 +01:00
parent 631ee46a50
commit 16564011a6
4 changed files with 47 additions and 14 deletions

View File

@@ -162,12 +162,15 @@ asynStatus masterMacsController::writeRead(int axisNo, int tcpCmd,
return asynError;
}
// TODO: CR at the end
if (isRead) {
snprintf(fullCommand, MAXBUF_ - 1, "%dR%02d\x0D", axisNo, tcpCmd);
} else {
snprintf(fullCommand, MAXBUF_ - 1, "%dS%02d=%s\x0D", axisNo, tcpCmd,
payload);
if (strlen(payload) == 0) {
snprintf(fullCommand, MAXBUF_ - 1, "%dS%02d\x0D", axisNo, tcpCmd);
} else {
snprintf(fullCommand, MAXBUF_ - 1, "%dS%02d=%s\x0D", axisNo, tcpCmd,
payload);
}
}
// Calculate the command length