Changed default for motorConnected and updated manual
Some checks failed
Test And Build / Lint (push) Failing after 3s
Test And Build / Build (push) Failing after 5s

This commit is contained in:
2026-01-20 11:43:26 +01:00
parent 7e7b8f486c
commit 5efb94f83e
6 changed files with 28 additions and 8 deletions

View File

@@ -10,6 +10,7 @@ ARCH_FILTER=RHEL%
motorBase_VERSION=7.2.2
# These headers allow to depend on this library for derived drivers.
HEADERS += src/masterMacsIPPort.h
HEADERS += src/masterMacsAxis.h
HEADERS += src/masterMacsController.h
@@ -17,6 +18,7 @@ HEADERS += src/masterMacsController.h
SOURCES += sinqMotor/src/msgPrintControl.cpp
SOURCES += sinqMotor/src/sinqAxis.cpp
SOURCES += sinqMotor/src/sinqController.cpp
SOURCES += src/masterMacsAsynIPPort.c
SOURCES += src/masterMacsAxis.cpp
SOURCES += src/masterMacsController.cpp
@@ -30,7 +32,8 @@ DBDS += sinqMotor/src/sinqMotor.dbd
DBDS += src/masterMacs.dbd
USR_CFLAGS += -Wall -Wextra -Wunused-result -Wextra -Werror
USR_CXXFLAGS += -Wall -Wextra -Wunused-result
# These flags define the expected firmware version. See README.md, section
# "Firmware version checking" for details.
USR_CXXFLAGS += -DFIRMWARE_MAJOR_VERSION=2 -DFIRMWARE_MINOR_VERSION=2 -Wall -Wextra -Weffc++ -Wunused-result -Wextra
USR_CXXFLAGS += -DFIRMWARE_MAJOR_VERSION=2 -DFIRMWARE_MINOR_VERSION=2

Binary file not shown.

View File

@@ -42,7 +42,7 @@ To use these scripts on Windows, prefix the Python 3 executable:
C:/path/to/python3.exe C:/path/to/mastermacs_repo/utils/decodeStatus.py 1234
```
### Usage in IOC shell
### IOC startup script
masterMacs exposes the following IOC shell functions:
- `masterMacsController`: Create a new controller object.
@@ -50,13 +50,17 @@ masterMacs exposes the following IOC shell functions:
The full masterMacsX.cmd file looks like this:
```
```bash
# Define the name of the controller and the corresponding port
epicsEnvSet("NAME","mcu")
epicsEnvSet("ASYN_PORT","p$(NAME)")
# Create the TCP/IP socket used to talk with the controller. The socket can be adressed from within the IOC shell via the port name
drvAsynIPPortConfigure("$(ASYN_PORT)","172.28.101.24:1025")
# Create the TCP/IP socket used to talk with the controller. The socket can be
# adressed from within the IOC shell via the port name
# We do not use the standard asyn port driver here, but a PMAC-specific one
# which enables the usage of StreamDevices for
# communicating with the controller directly.
masterMacsAsynIPPortConfigure("$(ASYN_PORT)","172.28.101.24:1025")
# Create the controller object with the defined name and connect it to the socket via the port name.
# The other parameters are as follows:

View File

@@ -5,3 +5,13 @@ record(longout, "$(INSTR)$(M):NodeReset") {
field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) NODE_RESET")
field(PINI, "NO")
}
# Overrides the default value for the "Connected" record provided by sinqMotor.
record(longin, "$(INSTR)$(M):Connected")
{
field(DTYP, "asynInt32")
field(INP, "@asyn($(CONTROLLER),$(AXIS)) MOTOR_CONNECTED")
field(SCAN, "I/O Intr")
field(PINI, "NO")
field(VAL, "0")
}

View File

@@ -215,6 +215,10 @@ asynStatus masterMacsAxis::init() {
}
}
// Initially assume that the axis is disconnected. It will be set to
// connected after the first communication attempted succeeded.
setAxisParamChecked(this, motorConnected, false);
// Read out the current position
pl_status = pC_->read(axisNo_, 12, response);
if (pl_status != asynSuccess) {
@@ -329,7 +333,8 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
// Does the axis need to be initialized?
if (needInit()) {
// Perform the rest of the poll, but remember if sth. failed in the init.
// Perform the rest of the poll, but remember if sth. failed in the
// init.
poll_status = init();
}

View File

@@ -429,8 +429,6 @@ asynStatus masterMacsController::parseResponse(
getAxisParamChecked(axis, motorConnected, &prevConnected);
}
// We don't use strlen here since the C string terminator 0x00
// occurs in the middle of the char array.
for (uint32_t i = 0; i < MAXBUF_; i++) {
if (fullResponse[i] == '\x19') {
responseStart = i;