EPICS Controls Argonne National Laboratory

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  2017  2018  2019  <20202021  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  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Reading multiple parameters from an incoming message.
From: "Li, Ji via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 24 Dec 2020 17:04:45 +0000
Hi,

I'm working on an EPICS package for a Harvard Pump 33 DDS syringe pump using streamdevice protocols. I need to read several parameters from an incoming message that combines the status of two axes/syringes, which has the following format:

RATEA TIMEA VOLA STATUSA
RATEB TIMEB VOLB STATUSB

RATEA/B, TIMEA/B and VOLA/B are integers, and STATUSA/B are 6-character strings with each character indicating a specific status.

I'm trying to parse the message using multiple protocols and records. For RATEA, only grab the first integer:

Protocol:
=======================
getStatusRateAxA {
    out "status";
    in "%d %*d %*d %*c%*c%*c%*c%*c%*c\n%*d %*d %*d %*c%*c%*c%*c%*c%*c\n" $ax_status;
}
=======================

Record:
=======================
record(ai, "$(P){$(Q)-Ax:A}:RATE:RBV") {
  field(DESC, "Axis A rate readback")
  field(DTYP, "stream")
  field(INP, "@pump33dds.proto getStatusRateAxA($(P), $(Q), $(CMD)) $(PORT)")
  field(PREC, "0")
}
=======================

The .substitutions file referring to this record was loaded without errors. When I tried to retrieve status information, the IOC shell printed the following information without errors:

=======================
epics> 2020/12/24 11:29:06.797 /dev/ttyUSB0 write 8
status\r\n
2020/12/24 11:29:06.833 /dev/ttyUSB0 read 71
50000000000 0 22307784 w...I.\n83333333330 24723 2055394602192 i...I.\n::
=======================

"::" in the incoming message should be parsed by "$ax_status" in the protocol and it worked for other messages.

The PV was showing INVALID(UDF_ALARM). Since the IOC didn't throw errors, I suppose the message was parsed correctly. How could this alarm have been caused?

Best,

-Ji Li


Replies:
Re: Reading multiple parameters from an incoming message. Mark Rivers via Tech-talk

Navigate by Date:
Prev: RE: EPICS for Building a SCADA System for Energy Grids; Interface to NI VeriStand Baker, Kathryn (STFC, RAL, ISIS) via Tech-talk
Next: Re: Reading multiple parameters from an incoming message. Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Los Alamos National Lab Job Ad: Software Controls Team Leader @ LANSCE Pieck, Martin via Tech-talk
Next: Re: Reading multiple parameters from an incoming message. Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 24 Dec 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·