EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: How to ignore ACK character in response (motor-6-9, asyn-4-30)
From: David Vine <[email protected]>
To: Torsten Bögershausen <[email protected]>
Cc: [email protected]
Date: Fri, 7 Apr 2017 21:25:38 -0700
Hi Torsten,

thanks for your help.

I was implementing this and I found this problem is already addressed in omsMAXnet.cpp line 291-293:
// cut off a leading CR, NL, /006
outString = localBuffer;
while ((*outString == 6)||(*outString == 13)||(*outString == 10)) ++outString;

I need to investigate further why this isn't working in my case.
Thanks again,
David

On Wed, Apr 5, 2017 at 10:45 PM, Torsten Bögershausen <[email protected]> wrote:
I don't think it is possible in asyn.

(But it may be added, if someone does it ;-)

Something like this may do the trick:

diff --git a/axisApp/OmsAsynSrc/omsBaseController.cpp b/axisApp/OmsAsynSrc/omsBaseController.cpp
index 28c79289..443bb6dd 100644
--- a/axisApp/OmsAsynSrc/omsBaseController.cpp
+++ b/axisApp/OmsAsynSrc/omsBaseController.cpp
@@ -432,6 +432,10 @@ asynStatus omsBaseController::getFirmwareVersion()
         count++;
         errlogPrintf("OMS Firmware Version: %s\n", inputBuffer);
     }
+
+    if (inputBuffer[0] == '\006')
+      memmove(&inputBuffer[1], &inputBuffer[0], sizeof(inputBuffer)-1);
+
     //beta versions have a B as first letter

On 06/04/17 00:28, David Vine wrote:
Hi all,

i'm using asyn-4-30 & motor-6-9 to talk to an OMA MAXnet over ethernet.

How do I configure asyn to ignore the first character i get in the response
(which is ACK \006)? For example, the command "WY;" gets the model and serial
number:

2017/04/05 15:24:34.634 MAXnet:asyn:: nwrite=3, status=0, nawt=3
WY;
2017/04/05 15:24:34.637 MAXnet:asyn:: inlen=40, status=0, ninp=40
MAXn-A000 ver:1.49, s/n:000375, FPGA:AA
2017/04/05 15:24:34.637 MAXnet:asyn:: inlen=40, nbytesTransfered=40, ntranslate=46

Thanks in advance,
David


Relevant part of st.cmd:
# MAXnet IP
drvAsynIPPortConfigure("MAXNET","10.40.30.60:23 <http://10.40.30.60:23>",0,0,0)
# MAXnet Serial
#drvAsynSerialPortConfigure("MAXNET","/dev/ttyUSB0",0,0,0)
#asynSetOption("MAXNET",0,"baud","115200")
#asynSetOption("MAXNET",0,"bits","8")
#asynSetOption("MAXNET",0,"parity","none")
#asynSetOption("MAXNET",0,"crtscts","Y")
dbLoadRecords("$(ASYN)/db/asynRecord.db","P=MAXnet:,R=asyn:,PORT=MAXNET,ADDR=0,OMAX=0,IMAX=0")
asynSetTraceMask("MAXNET", 0, 0x23)
asynSetTraceIOMask("MAXNET", 0, 1)
#dbLoadRecords("$(TOP)/stxmApp/Db/MAXnet.db",
"PORT=MAXNET,P=MAXnet:,R=meta:,Q=io:")

asynOctetSetInputEos("MAXNET",0,"\n")
asynOctetSetOutputEos("MAXNET",0,"\n")

# omsMAXnetConfig(portName,              /* MAXnet Motor Asyn Port name */
#                 numAxes,               /* Number of axes this controller
supports */
#                  serialPortName,       /* MAXnet Serial Asyn Port name */
#                  movingPollPeriod,     /* Time to poll (msec) when an axis is
in motion */
#                  idlePollPeriod,       /* Time to poll (msec) when an axis is
idle. 0 for no polling */
#                  initString)           /* Init String sent to card */
omsMAXnetConfig("MAXNET1" , 10, "MAXNET", 100, 60000, "")




References:
How to ignore ACK character in response (motor-6-9, asyn-4-30) David Vine
Re: How to ignore ACK character in response (motor-6-9, asyn-4-30) Torsten Bögershausen

Navigate by Date:
Prev: Python CaChannel related modules Wang Xiaoqiang (PSI)
Next: Re: Dynamic alarm server John . Holt
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: How to ignore ACK character in response (motor-6-9, asyn-4-30) Torsten Bögershausen
Next: Additional RELEASE file checks Hugo Slepicka
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024