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

Subject: Re: seq pvPut to a waveform
From: Ben Franksen <[email protected]>
To: [email protected]
Date: Sat, 2 Oct 2010 04:03:19 +0200
On Samstag, 2. Oktober 2010, Dayle Kotturi wrote:
> I'd be grateful for code snippets showing how to put a waveform of
> values to a PV. I am able to successfully pvPut other data types, but
> just not waveforms. I've tried to match the sytax of caput -a where
> the first arg is NELM (or NORD) and then the array is appended after
> that.  

No, this is just caput command line syntax. Just pvPut the array of 
values.

> I've also tried just puttting the array of NELM values. 
> Neither worked.  

It should. But see below for a possible reason why your program does not 
work.

> No error messages on the console with +d option set. 
> Recompiling seq-R2-0-11 with DEBUG defined caused a segmentation
> fault. I didn't investigate the reason for that.

Not necessary, I already fixed this a while ago in the development 
version. Seems nobody tried to compile with DEBUG for a long time...

> Versions: epics3.14.8.2 and seq-R2-0-11
> Platform: linux-x86
>
> Details: I have a waveform of 21 shorts that I want to put to a PV of
> FTVL USHORT with NELM 21.
>
> [cdlx08] /afs/slac/g/lcls/tools/script>caget KLYS:LI20:95:RULE0
> KLYS:LI20:95:RULE0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
>
> On the (soft) ioc:
> epics> dbpr("KLYS:LI20:95:RULE0",4)
> ACKS: NO_ALARM      ACKT: YES           ASG:                ASP:
> 0x00000000 BKPT: 0x00          BPTR: 0x483eef09    BUSY: 0           
>  DESC: Rule DISA: 0             DISP: 0             DISS: NO_ALARM   
>   DISV: 1 DPVT: 0x00000000    DSET: 0xfc578000    DTYP: Soft Channel 
> EGU: tick EVNT: 0             FLNK:CONSTANT 0     FTVL: USHORT       
> HOPR: 0 INP:CONSTANT        LCNT: 0             LOPR: 0            
> LSET: 0xc06cf309 MLIS: 0x98adf80988a9f80902000000        MLOK:
> 0x303eef09
> NAME: KLYS:LI20:95:RULE0                NELM: 21            NORD: 21
> NSEV: NO_ALARM      NSTA: NO_ALARM      PACT: 0             PHAS: 0
> PINI: YES           PPN: 0x00000000     PPNR: 0x00000000    PREC: 0
> PRIO: LOW           PROC: 0             PUTF: 0             RARM: 0
> RDES: 0x20a6e009    RPRO: 0             RSET: 0x203ed800    SCAN:
> Passive SDIS:CONSTANT       SEVR: NO_ALARM      SIML:CONSTANT      
> SIMM: NO SIMS: NO_ALARM      SIOL:CONSTANT       SPVT: 0x00000000   
> STAT: NO_ALARM TIME: 0x0cd6072760513f19                TPRO: 0       
>      TSE: 0 TSEL:CONSTANT       UDF: 0              VAL: 0x00000000
>
> at top before start of state set:
> option -a; /* sync op. wait for pvGet/pvPut to complete */
> option -c; /* no wait for db connections */
> option +d; /* Turn on runtime debug messages */
> option +w; /* Display SNC warnings */
>
> #define PDU_RULE_PUT_WF_SIZE 22 /* includes 1 for the NELM */
>
> /* Tempory variable re-used to hold the trigger rule copied from an
>     updated global rule and assigned to an RTEMS IOC trigger rule
> that uses it */ short myTriggerRule[PDU_RULE_PUT_WF_SIZE];
> assign myTriggerRule to ""; /* MUST do this to get this var into DB
> Block per Kuhkee Kim 2010/09/30 */
>
> /* Inside a state */
>              pvAssign(myTriggerRule,"KLYS:LI20:95:RULE0");
>              pvMonitor(myTriggerRule);

At this point, i.e. before calling pvPut, you must first ensure that 
myTriggerRule has connected to the assigned PV: connecting to a PV is 
an asynchronous operation. This can be done by jumping to an additional 
state:

state wait_connect_myTriggerRule {
  when (pvConnected(myTriggerRule)) {
    pvPut(myTriggerRule);
    ... etc. ...
  }
}

>              /* Update the definition of the trigger rule to match
> the global rule it is assigned to */
>              pvPut(myTriggerRule);
>              pvFlush();
>              printf("sncpdu: contents of SNL var now put into EPICS
> PV\n");
>
>              sprintf(pvNORD, "%s.NORD",triggerRuleStrings[nn]);
>              pvAssign(myTriggerRuleNORD,pvNORD);

It is not necessary nor makes sense to write to NORD, as this field is 
updated by the record support put_array_info method which is called 
whenever VAL gets written to (e.g. via CA).

Cheers
Ben

References:
seq pvPut to a waveform Dayle Kotturi

Navigate by Date:
Prev: seq pvPut to a waveform Dayle Kotturi
Next: Re: MOXA ARM computer and streamDevice Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: seq pvPut to a waveform Dayle Kotturi
Next: EPICS Collaboration Meeting - arrival instructions Dalesio, Leo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 05 Oct 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·