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  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: gensub to asub
From: emmanuel_mayssat@lynceantech.com
To: EPICS tech-talk <tech-talk@aps.anl.gov>
Date: Fri, 21 Jan 2011 18:55:37 -0800
I am about to move my gensub to asub.
So I experimented on a simple asub (ascii to double conversion).

../funcMiToAi.c[41] --> DDS8M_funcMiToAi (DDS8M:1:FrqncyMltplrGS)
../funcMiToAi.c[48] >8< --> AI (8)
../funcMiToAi.c[58] <-- DDS8M_funcMiToAi (75)


Log output seem ok, but the pv doesn't change.

I have:

dbpr DDS8M:1:FrqncyMltplrGS
ASG:                DESC: Move motor    DISA: 0             DISP: 0             
DISV: 1             NAME: DDS8M:1:FrqncyMltplrGS            SEVR: NO_ALARM      
STAT: NO_ALARM      TPRO: 0             VAL: 317            
cls1dev:6114>dbpr DDS8M:1:FrqncyMltplrGS 3
A: 0x9e84580        ACKS: NO_ALARM      ACKT: YES           ASG:                
B: 0x9e85880        BKPT: 00            BRSV: NO_ALARM      C: 0x9e85890        
D: 0x9e858a0        DESC: Move motor    DISA: 0             DISP: 0             
DISS: NO_ALARM      DISV: 1             DTYP: <nil>         E: 0x9e858b0        
EFLG: ON CHANGE     EVNT: 0             F: 0x9e858c0        FLNK:CONSTANT 0     
FTA: STRING         FTB: DOUBLE         FTC: DOUBLE         FTD: DOUBLE         
FTE: DOUBLE         FTF: DOUBLE         FTG: DOUBLE         FTH: DOUBLE         
FTI: DOUBLE         FTJ: DOUBLE         FTK: DOUBLE         FTL: DOUBLE         
FTM: DOUBLE         FTN: DOUBLE         FTO: DOUBLE         FTP: DOUBLE         
FTQ: DOUBLE         FTR: DOUBLE         FTS: DOUBLE         FTT: DOUBLE         
FTU: LONG           FTVA: DOUBLE        FTVB: DOUBLE        FTVC: DOUBLE        
FTVD: DOUBLE        FTVE: DOUBLE        FTVF: DOUBLE        FTVG: DOUBLE        
FTVH: DOUBLE        FTVI: DOUBLE        FTVJ: DOUBLE        FTVK: DOUBLE        
FTVL: DOUBLE        FTVM: DOUBLE        FTVN: DOUBLE        FTVO: DOUBLE        
FTVP: DOUBLE        FTVQ: DOUBLE        FTVR: DOUBLE        FTVS: DOUBLE        
FTVT: DOUBLE        FTVU: DOUBLE        G: 0x9e858d0        H: 0x9e858e0        
I: 0x9e858f0        INAM:               
INPA:DB_LINK DDS8M:1:FrqncyMltplrMI NPP NMS                 INPB:CONSTANT       
INPC:CONSTANT       INPD:CONSTANT       INPE:CONSTANT       INPF:CONSTANT       
INPG:CONSTANT       INPH:CONSTANT       INPI:CONSTANT       INPJ:CONSTANT       
INPK:CONSTANT       INPL:CONSTANT       INPM:CONSTANT       INPN:CONSTANT       
INPO:CONSTANT       INPP:CONSTANT       INPQ:CONSTANT       INPR:CONSTANT       
INPS:CONSTANT       INPT:CONSTANT       
INPU:DB_LINK DDS8M:1:FrqncyMltplrGS NPP NMS                 J: 0x9e85900        
K: 0x9e85910        L: 0x9e85920        LCNT: 0             LFLG: IGNORE        
M: 0x9e85930        N: 0x9e85940        NAME: DDS8M:1:FrqncyMltplrGS            
NEA: 1              NEB: 1              NEC: 1              NED: 1              
NEE: 1              NEF: 1              NEG: 1              NEH: 1              
NEI: 1              NEJ: 1              NEK: 1              NEL: 1              
NEM: 1              NEN: 1              NEO: 1              NEP: 1              
NEQ: 1              NER: 1              NES: 1              NET: 1              
NEU: 1              NEVA: 1             NEVB: 1             NEVC: 1             
NEVD: 1             NEVE: 1             NEVF: 1             NEVG: 1             
NEVH: 1             NEVI: 1             NEVJ: 1             NEVK: 1             
NEVL: 1             NEVM: 1             NEVN: 1             NEVO: 1             
NEVP: 1             NEVQ: 1             NEVR: 1             NEVS: 1             
NEVT: 1             NEVU: 1             NOA: 1              NOB: 1              
NOC: 1              NOD: 1              NOE: 1              NOF: 1              
NOG: 1              NOH: 1              NOI: 1              NOJ: 1              
NOK: 1              NOL: 1              NOM: 1              NON: 1              
NOO: 1              NOP: 1              NOQ: 1              NOR: 1              
NOS: 1              NOT: 1              NOU: 1              NOVA: 1             
NOVB: 1             NOVC: 1             NOVD: 1             NOVE: 1             
NOVF: 1             NOVG: 1             NOVH: 1             NOVI: 1             
NOVJ: 1             NOVK: 1             NOVL: 1             NOVM: 1             
NOVN: 1             NOVO: 1             NOVP: 1             NOVQ: 1             
NOVR: 1             NOVS: 1             NOVT: 1             NOVU: 1             
NSEV: NO_ALARM      NSTA: NO_ALARM      O: 0x9e85950        ONAM:               
OUTA:DB_LINK DDS8M:1:FrqncyMltplrAI PP NMS                  OUTB:CONSTANT       
OUTC:CONSTANT       OUTD:CONSTANT       OUTE:CONSTANT       OUTF:CONSTANT       
OUTG:CONSTANT       OUTH:CONSTANT       OUTI:CONSTANT       OUTJ:CONSTANT       
OUTK:CONSTANT       OUTL:CONSTANT       OUTM:CONSTANT       OUTN:CONSTANT       
OUTO:CONSTANT       OUTP:CONSTANT       OUTQ:CONSTANT       OUTR:CONSTANT       
OUTS:CONSTANT       OUTT:CONSTANT       OUTU:CONSTANT       OVAL: 336           
P: 0x9e85960        PACT: 0             PHAS: 0             PINI: NO            
PREC: 0             PRIO: LOW           PROC: 0             PUTF: 0             
Q: 0x9e85970        R: 0x9e85980        RPRO: 0             S: 0x9e85990        
SADR: 0x8051ea0     SCAN: .1 second     SDIS:CONSTANT       SEVR: NO_ALARM      
SNAM: DDS8M_funcMiToAi                  STAT: NO_ALARM      SUBL:CONSTANT       
T: 0x9e859a0        TIME: 2011-01-21 19:25:01.858643714     TPRO: 0             
TSE: 0              TSEL:CONSTANT       U: 0x9e859b0        UDF: 0              
VAL: 336            VALA: 0x9e859c0     VALB: 0x9e859e0     VALC: 0x9e85a00     
VALD: 0x9e85a20     VALE: 0x9e85a40     VALF: 0x9e85a60     VALG: 0x9e85a80     
VALH: 0x9e85aa0     VALI: 0x9e85ac0     VALJ: 0x9e85ae0     VALK: 0x9e85b00     
VALL: 0x9e85b20     VALM: 0x9e85b40     VALN: 0x9e85b60     VALO: 0x9e85b80     
VALP: 0x9e85ba0     VALQ: 0x9e85bc0     VALR: 0x9e85be0     VALS: 0x9e85c00     
VALT: 0x9e85c20     VALU: 0x9e85c40     

cls1dev:6114>dbpr DDS8M:1:FrqncyMltplrAI 2
ACKS: NO_ALARM      ACKT: YES           ADEL: 0             AOFF: 0             
ASG:                ASLO: 1             BKPT: 00            
DESC: Frequency Multiplier              DISA: 0             DISP: 0             
DISS: NO_ALARM      DISV: 1             DTYP: Soft Channel  EGU:                
EGUF: 0             EGUL: 0             EOFF: 0             ESLO: 1             
EVNT: 0             FLNK:CONSTANT 0     HHSV: NO_ALARM      HIGH: 0             
HIHI: 0             HOPR: 0             HSV: NO_ALARM       HYST: 0             
INP:CONSTANT        LCNT: 0             LINR: NO CONVERSION LLSV: NO_ALARM      
LOLO: 0             LOPR: 0             LOW: 0              LSV: NO_ALARM       
MDEL: 0             NAME: DDS8M:1:FrqncyMltplrAI            NSEV: NO_ALARM      
NSTA: NO_ALARM      PACT: 0             PHAS: 0             PINI: NO            
PREC: 1             PRIO: LOW           PUTF: 0             ROFF: 0             
RPRO: 0             RVAL: 0             SCAN: Passive       SDIS:CONSTANT       
SEVR: INVALID       SIML:CONSTANT       SIMM: NO            SIMS: NO_ALARM      
SIOL:CONSTANT       SMOO: 0             STAT: UDF           SVAL: 0             
TIME: <undefined>   TPRO: 0             TSE: 0              TSEL:CONSTANT       

SNAM code


static long DDS8M_funcMiToAi( struct aSubRecord *p_asub ) {
  long *p_counter;

  char p_stringMI[BUFLEN];
  double analogAI;

  funcLog( 3, __FILE__ "[%d] --> %s (%s)\n", 
          __LINE__, __func__, p_asub->name);

  strncpy(p_stringMI,(char *)p_asub->a, BUFLEN);

  analogAI=atof(p_stringMI);

  funcLog( 5, __FILE__ "[%d] >%s< --> AI (%lg)\n",
                        __LINE__, p_stringMI,analogAI);

  memcpy(p_asub->vala, &analogAI, sizeof(analogAI));


  /* counter */
  p_counter=(long *)p_asub->u;
  *p_counter=*p_counter+1;

  funcLog( 3, __FILE__ "[%d] <-- %s (%ld)\n", 
          __LINE__, __func__, *p_counter);

  return(*p_counter);
}


It seems that the memcpy doesn't work!!!!?!?!?!?

-- 
Emmanuel

Replies:
Re: gensub to asub Matthieu Bec

Navigate by Date:
Prev: Re: dynamic monitoring Patrick Thomas
Next: Re: gensub to asub Matthieu Bec
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: RE: dynamic monitoring Jeff Hill
Next: Re: gensub to asub Matthieu Bec
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
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 ·