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  <20122013  2014  2015  2016  2017  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  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [CSS] commas in TextUpdate
From: Pavel Masloff <[email protected]>
To: "Kasemir, Kay" <[email protected]>
Cc: EPICS Tech Talk <[email protected]>
Date: Thu, 31 May 2012 19:14:09 +0400
Hi Kay,

In case of the asub record, I will have sth like:

record(waveform, "$(P)$(R)DIRS") {
  field(DESC, "File structure")
  field(PINI, "YES")
  field(DTYP, "stream")
  field(NELM, "100")
  field(FTVL, "STRING")
  field(INP, "@devTPS20xx.proto DIRS $(PORT) $(A)")
  field(SCAN, "Passive")
  field(FLNK, "$(P)$(R)DIRS_sub")
}

record(aSub, "$(P)$(R)DIRS_sub") {
  field(DESC, "DIRS processing")
  field(INAM, "dirs_init")
  field(SNAM, "transform_dirs")
  field(INPA, "$(P)$(R)DIRS")
  field(FTA, "STRING")
  field(NOA, "100")
  field(FTVA, "STRING")
  field(NOVA, "100")
  field(INPB, "$(P)$(R)DIRS.NORD")
  field(FTB, "ULONG")
}

So my transformation routine will receive the address of the asub record structure:

static long transform_dirs(aSubRecord *precord) {
        char** data = "" /*              ????                          */
        char** output = (char**)precord->vala;                /*              ????                          */
        size_t size = *(unsigned long*)precord->b;                    
       
        for(int i=0;i<size;i++) {
                *output[i]=*char[i];       
        }

        *(unsigned long*)precord->NOVA=size;
}

My initial waveform of strings is an array of strings. How is it allocated (organized) in the memory?
As sequence of (char**) pointers? So it goes like:

pointer1 pointer2 ............ pointer($(P)$(R)DIRS.NELM=100)

Am I correct?

Pavel

On Thu, May 31, 2012 at 4:10 PM, Kasemir, Kay <[email protected]> wrote:
Hi:

You could either directly write what you want to a CHAR waveform instead of writing to an array of Strings.
Or you can add a subroutine (gensub, ..) record to your IOC to read the strings into a char waveform.

-Kay

From: Pavel Masloff <[email protected]<mailto:[email protected]>>
To: Kasemir Kay <[email protected]<mailto:[email protected]>>
Cc: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Subject: Re: [CSS] commas in TextUpdate

> But it might be better to work around this further down on the IOC:
> Create just one string with the text that you want.
> Since a stringin/stringout record is limited to 40 chars, use a waveform
> of CHAR for that custom text.

Kay, could you please elaborate on this?
How can I pass the actual waveform of STRINGS into a new waveform of CHAR?




--
Best regards,


Pavel Maslov, MS
Controls Engineer at Pulsed power Lab
Efremov Institute for Electro-Physical Apparatus
St. Petersburg, Russia

Mobile: +7 (951) 672 22 19
Landline: +7 (812) 461 01 01


References:
Re: [CSS] commas in TextUpdate Pavel Masloff
Re: [CSS] commas in TextUpdate Kasemir, Kay

Navigate by Date:
Prev: Re: Proposed change in asyn - request for comments Andrew Johnson
Next: Re: [StreamDevice] parsing rapid inputs Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: [CSS] commas in TextUpdate Kasemir, Kay
Next: RE: [CSS] commas in TextUpdate Chen, Xihui
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·