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  2020  <20212022  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  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: AW: combining long strings
From: "Sintschuk, Michael via Tech-talk" <tech-talk at aps.anl.gov>
To: "Lang, Keenan C." <klang at anl.gov>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 3 Feb 2021 14:05:49 +0000

Hi Keenan,

 

I like the luascript script solution. But unfortunately it won’t work for me. The record is always in SEVR: invalid mode and there is no input to the AA, BB … fields:

 

epics> dbpr Topo:FilePath 10

A: 0                AA:                 AADN:               ACKS: NO_ALARM     

ACKT: YES           ADSC:               ASG:                ASIZ: 0            

ASP: (nil)          ATYP: Int           AVAL: (nil)         B: 0               

BB:                 BBDN:               BDSC:               BKPT: 00           

C: 0                CALL: 0x88d4e0      CC:                 CCDN:              

CDSC:              

CODE: return table.pack(string.byte(AA..BB..CC..DD..EE..FF, 1, -1))            

D: 0                DD:                 DDDN:               DDSC:              

DESC:               DISA: 0             DISP: 0             DISS: NO_ALARM     

DISV: 1             DPVT: (nil)         DSET: 0x7f8e4c1d9f00                   

DTYP: Soft Channel  E: 0                EDSC:               EE:                

EEDN:               ERR: error in error handling            EVNT:              

F: 0                FDSC:               FF:                 FFDN:              

FLNK:CONSTANT 0     FRLD: 0             G: 0                GDSC:              

GG:                 GGDN:               H: 0                HDSC:              

HH:                 HHDN:               I: 0                IAAV: Local PV     

IBBV: Local PV      ICCV: Local PV      IDDV: Local PV      IDSC:              

IEEV: Local PV      IFFV: Ext PV OK     IGGV: Constant      IHHV: Constant     

II:                 IIDN:               IIIV: Constant      IJJV: Constant     

INAA:CA_LINK Topo:PathMenu.VAL CP NMS   INAV: Constant     

INBB:CA_LINK Topo:DateMenu.VAL CP NMS   INBV: Constant     

INCC:CA_LINK Topo:SampleMenu.VAL CP NMS INCV: Constant     

INDD:CA_LINK Topo:OrientationMenu.VAL CP NMS                INDV: Constant     

INEE:CA_LINK Topo:EnergyMenu.VAL CP NMS INEV: Constant     

INFF:CA_LINK PCO4000:TIFF1:FileNumber CP NMS                INFV: Constant     

INGG:CONSTANT       INGV: Constant      INHH:CONSTANT       INHV: Constant     

INII:CONSTANT       INIV: Constant      INJJ:CONSTANT       INJV: Constant     

INPA:CONSTANT       INPB:CONSTANT       INPC:CONSTANT       INPD:CONSTANT      

INPE:CONSTANT       INPF:CONSTANT       INPG:CONSTANT       INPH:CONSTANT      

INPI:CONSTANT       INPJ:CONSTANT       J: 0                JDSC:              

JJ:                 JJDN:               LCNT: 18            LSET: 0x88c750     

MDEL: 0            

MLIS: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00              

MLOK: 20 d4 88 00 00 00 00 00           NAME: Topo:FilePath NSEV: INVALID      

NSTA: LINK          OOPT: Every Time   

OUT:CA_LINK PCO4000:TIFF1:FilePath PP NMS                   OUTV: Constant     

PA: 0               PAA: 0x88d5c0       PACT: 1             PASZ: 0            

PATP: Int           PAVL: (nil)         PB: 0               PBB: 0x88d5f0      

PC: 0               PCC: 0x88d620       PCODE: 0x88d450     PD: 0              

PDD: 0x88d650       PE: 0               PEE: 0x88d680       PF: 0              

PFF: 0x88d6b0       PG: 0               PGG: 0x88d6e0       PH: 0              

PHAS: 0             PHH: 0x88d710       PI: 0               PII: 0x88d740      

PINI: NO            PJ: 0               PJJ: 0x88d770       PPN: (nil)         

PPNR: (nil)         PREC: 0             PRIO: LOW           PROC: 0             

PSVL:               PUTF: 0             PVAL: 0             RDES: 0x80c5f0     

RELO: Every New File                    RPRO: 0             RPVT: 0x88d570     

RSET: 0x7f8e4c1d9e40                    SCAN: Passive       SDIS:CONSTANT      

SEVR: INVALID       SPVT: (nil)         STAT: UDF           STATE: 0x88d7a8    

SVAL:               SYNC: Sync          TIME: <undefined>   TPRO: 0            

TSE: 0              TSEL:CONSTANT       UDF: 1              UDFS: INVALID      

VAL: 0              WAIT: NoWait       

epics>

 

Did I missed something with the record settings?  

 

Von: Lang, Keenan C. <klang at anl.gov>
Gesendet: Dienstag, 2. Februar 2021 04:40
An: tech-talk at aps.anl.gov; Sintschuk, Michael <michael.sintschuk at bam.de>
Betreff: Re: combining long strings

 

Hello Michael,

 

I believe that you could theoretically solve this with separate waveform records for each of the input values, then use an acalcout record to concatenate the arrays together.

 

Otherwise, I would also like to put forward the luascript record (https://github.com/epics-modules/lua). It works very similarly to the calc style records just with a full programming language behind it. I had to put in a commit because I wasn't previously pulling in enum data, but if you grab the master branch you could do this:

 

 

record(luascript,"$(exp):FilePath") {

  field(INAA,"$(exp):PathMenu.VAL CP")

  field(INBB,"$(exp):DateMenu.VAL CP")

  field(INCC,"$(exp):SampleMenu.VAL CP")

  field(INDD,"$(exp):OrientationMenu.VAL CP")

  field(INEE,"$(exp):EnergyMenu.VAL CP")

  field(INFF,"$(cam):$(format)1:FileNumber CP")

  field(CODE,"return table.pack(string.byte(AA..BB..CC..DD..EE..FF, 1, -1))")

  field(OUT,"$(cam):$(format)1:FilePath PP")

}

 

The CODE field there concatenates the strings, turns the resulting string into a set of bytes, then puts those bytes together into an array which the record can write out to a waveform.

 

 

Keenan


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Sintschuk, Michael via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, February 1, 2021 4:42 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: combining long strings

 

Hello EPICS-community,

 

I’m trying to find a solution for the following calculation:

 

record(scalcout,"$(exp):FilePath") {

  field(INAA,"$(exp):PathMenu.VAL CP")

  field(INBB,"$(exp):DateMenu.VAL CP")

  field(INCC,"$(exp):SampleMenu.VAL CP")

  field(INDD,"$(exp):OrientationMenu.VAL CP")

  field(INEE,"$(exp):EnergyMenu.VAL CP")

  field(INFF,"$(cam):$(format)1:FileNumber CP")

  field(CALC,"AA+BB+CC+DD+EE+FF")

  field(OUT,"$(cam):$(format)1:FilePath")

}

 

INAA to INFF are mbbo records that I want to use as dropdown-menus. Each time a dropdown-menu is changed by the user, the scalcout record recalculates the FilePath and puts the new path-string to the areaDetector FilePath record, which is a waveform. This would work fine, if there wasn’t the 40 character limitation for the scalcout-record, so the OUT field is cut. Each of the input fields is smaller then 40 character but combined (the actual path-string) is longer. Can anyone give me an example how to solve this, if possible? I searched the tech-talk but with no luck…

 

Regards

Michael  

 

Michael Sintschuk
Bundesanstalt für Materialforschung und –prüfung (BAM)
8.5 Mikro-ZfP

Unter den Eichen 87
12205 Berlin
GERMANY

P: +49 30 8104-5736 (BESSY, Adlershof)

P: +49 30 8104-4065 (BAM, Steglitz)
michael.sintschuk at bam.de

 


Replies:
Re: combining long strings Johnson, Andrew N. via Tech-talk
References:
combining long strings Sintschuk, Michael via Tech-talk
Re: combining long strings Lang, Keenan C. via Tech-talk

Navigate by Date:
Prev: RE: Questions about Bruker QM100 detector Abdalla Ahmad via Tech-talk
Next: Phoebus Strip tool and Databrowser Only Show Latest Point Smith, William 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  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: combining long strings Lang, Keenan C. via Tech-talk
Next: Re: combining long strings Johnson, Andrew N. 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  <20212022  2023  2024 
ANJ, 03 Feb 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·