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

Subject: Re: streamdevice and input strings
From: Pierrick M Hanlet via Tech-talk <tech-talk at aps.anl.gov>
To: Zimoch Dirk <dirk.zimoch at psi.ch>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 17 Apr 2024 13:54:16 +0000
Many thanks Dirk,
That worked.  I was wondering why the example was only for waveforms.
Best wishes,
Pierrick


On 4/17/24 00:26, Zimoch Dirk wrote:
> [EXTERNAL] – This message is from an external sender
>
> Hello Pierrick,
>
> StreamDevice uses Separator only for array records (waveform, aai, aao). There, it reads alternating the format and the separator. But the format %s only stops at a space, not at your separator. Thus, the first %s gets the complete string and there is no separator left to read. Here, with redirections to multiple scalar records, the Separator is not used at all. Still the %s consumes as much as it can, that is everything.
> What you need is %[^,] instead of %s (that reads strings up to comma) and explicit commas in between:
> in  "%(\$1:G1Name)[^,],%(\$1:G2Name)[^,], %(\$1:G3Name)[^,],%(\$1:G4Name)[^,]";
>
> Also, one of the formats (I suggest the last) can be without redirection if the corresponding G*Name record (G4 in this case) is the one which calls this protocol.
>
> Best regards,
> Dirk
>
>> Am 17.04.2024 um 01:24 schrieb Pierrick M Hanlet via Tech-talk <tech-talk at aps.anl.gov>:
>>
>> Hi all,
>> I'm on a linux box with AL9.3, base 7.07, and StreamDevice 2.8.24.
>> I have a string input, which the controller gives as: A1,A2,B1,B2.
>> I want to read them individually as separate names, i.e. separate records.
>>
>> My protocol is:
>> get_names {
>>      separator=",";
>>      out "CID";
>>      in  "%(\$1:G1Name)s%(\$1:G2Name)s%(\$1:G3Name)s%(\$1:G4Name)s";
>> }
>>
>> although, I've also tried as:
>> get_names {
>>      separator=",";
>>      out "CID";
>>      in "%(\$1:G1Name)s,%(\$1:G2Name)s,%(\$1:G3Name)s,%(\$1:G4Name)s";
>> }
>>
>> or as:
>> get_names {
>>      out "CID";
>>      in "%(\$1:G1Name)s,%(\$1:G2Name)s,%(\$1:G3Name)s,%(\$1:G4Name)s";
>> }
>>
>> Of course, it works perfectly if I have:
>> get_names {
>>      out "CID";
>>      in "%(\$1:G1Name)2c,%(\$1:G2Name)2c,%(\$1:G3Name)2c,%(\$1:G4Name)2c";
>> }
>> However, the name can be up to 8 characters long.
>>
>> I don't understand why separator doesn't work as I'm using it.
>> Thank you,
>> Pierrick
>>
>>
>> --
>> Pierrick Hanlet
>> Fermi National Accelerator
>> Accelerator Front End Controls
>> +1-630-840-5555 -- lab
>> +1-312-687-4980 -- mobile
>>
>> "Whether you think you can or think you can't, you're right" -- Henry Ford
>>

-- 
Pierrick Hanlet
Fermi National Accelerator
Accelerator Front End Controls
+1-630-840-5555 -- lab
+1-312-687-4980 -- mobile

"Whether you think you can or think you can't, you're right" -- Henry Ford


References:
streamdevice and input strings Pierrick M Hanlet via Tech-talk
Re: streamdevice and input strings Zimoch Dirk via Tech-talk

Navigate by Date:
Prev: Re: streamdevice and input strings Maren Purves via Tech-talk
Next: Job opportunity at Facility for Rare Isotope Beams Bernal Ruiz, Enrique 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  2020  2021  2022  2023  <20242025 
Navigate by Thread:
Prev: Re: streamdevice and input strings Maren Purves via Tech-talk
Next: Job opportunity at Facility for Rare Isotope Beams Bernal Ruiz, Enrique 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  2020  2021  2022  2023  <20242025