From 1597dc34e02c61ffc60be61adb0a9a535cb4c0f5 Mon Sep 17 00:00:00 2001 From: smathis Date: Thu, 15 May 2025 12:25:08 +0200 Subject: [PATCH] Added default value for motorMessageText --- src/turboPmacAxis.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/turboPmacAxis.cpp b/src/turboPmacAxis.cpp index 436239a..6cabb95 100644 --- a/src/turboPmacAxis.cpp +++ b/src/turboPmacAxis.cpp @@ -71,6 +71,20 @@ turboPmacAxis::turboPmacAxis(turboPmacController *pC, int axisNo, exit(-1); } + // Even though this happens already in sinqAxis, a default value for + // motorMessageText is set here again, because apparently the sinqAxis + // constructor is not run before the string is accessed? + status = setStringParam(pC_->motorMessageText(), ""); + if (status != asynSuccess) { + asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, + "Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR " + "(setting a parameter value failed " + "with %s)\n. Terminating IOC", + pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__, + pC_->stringifyAsynStatus(status)); + exit(-1); + } + // turboPmac motors can always be disabled status = pC_->setIntegerParam(axisNo_, pC_->motorCanDisable(), 1); if (status != asynSuccess) {