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  <20162017  2018  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  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Packed Data Message Formats With Fixed-Length Strings
From: "Mooney, Tim M." <[email protected]>
To: Iain Marcuson <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 8 Nov 2016 17:12:26 +0000
Hi Iain,

I think I would do this with an aSub record: read the input into a waveform record; configure an aSub record input to be an array of char, and point the input link at the waveform record's VAL field; and write an aSub routine to parse it.

Tim Mooney ([email protected]) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


________________________________________
From: [email protected] [[email protected]] on behalf of Iain Marcuson [[email protected]]
Sent: Tuesday, November 08, 2016 10:46 AM
To: [email protected]
Subject: Packed Data Message Formats With Fixed-Length Strings

I am writing EPICS code to interface with a custom device.  The device protocol is fixed-length messages.  I can read and write the message parameters with Stream Device, and have done so successfully except for the fixed-length string, which I have had to bypass in assorted ways.

The output command message has the Python struct format "ii128s12i".  The input message has the Python struct format "128s12ii".  The "12i" refers to 12 parameters, passed or returned.

My two questions are:

1) How can I parse the fixed-length string?  The normal string-handling routines fail either because of terminator characters in the string or because the string is two long.
2) I handle the parameters by having a PV for each parameter, and a separate "group" of PVs for each command.  Is this best practice?

Thank you,

Iain Marcuson.



Replies:
RE: Packed Data Message Formats With Fixed-Length Strings Iain Marcuson
References:
Packed Data Message Formats With Fixed-Length Strings Iain Marcuson

Navigate by Date:
Prev: Packed Data Message Formats With Fixed-Length Strings Iain Marcuson
Next: RE: processCallbacks() never called in areaDetector plugin Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Packed Data Message Formats With Fixed-Length Strings Iain Marcuson
Next: RE: Packed Data Message Formats With Fixed-Length Strings Iain Marcuson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 09 Nov 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·