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 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
<== Date ==> <== Thread ==>

Subject: RE: waveform arrays within SNL
From: Al Honey <ahoney@keck.hawaii.edu>
To: 'Mark Rivers' <rivers@cars.uchicago.edu>, "'tech-talk@aps.anl.gov'" <tech-talk@aps.anl.gov>
Date: Tue, 20 Jun 2017 21:42:08 +0000

Thx Mark

That works for integer arrays. Not sure why I was previously unsuccessful as I tried various combinations.

 

But the other waveform record holds an array of strings - field(FTVL,"STRING") – and continues to thwart me.

 

caput k1:osiris:ss1:posnames "one two three four"

caget k1:osiris:ss1:posnames

k1:osiris:ss1:posnames 4 one two three four 

 

Trrying what I think is correct in SNL, I get compilation errors:

 

#define MAX_ENTRIES 100

 

string posnames[MAX_ENTRIES];

assign posnames to "{tel}{instr}:{mech}:posnames";  // this is the ‘string’ waveform record 

 

local variable is:

string names[4] = { "0.100", "0.050", "0.035", "0,020” };

 

state STARTUP {

entry {

        for (idx=0; idx<4; idx++ ) posnames[idx] = names[idx];

        pvPut( posnames );

}

.

.

.

}

 

error: incompatible types when assigning to type string from type char *

           posnames[idx] = names[idx];

                            

Thx,

Al

 

 

From: Mark Rivers [mailto:rivers@cars.uchicago.edu]
Sent: Tuesday, June 20, 2017 9:28 AM
To: Al Honey; 'tech-talk@aps.anl.gov'
Subject: RE: waveform arrays within SNL

 

You need to change it to:

 

#define MAX_LOCATIONS 1000

int locations[MAX_LOCATIONS];

assign locations to "{tel}{instr}:{mech}:locations";  // where locations is a waveform record with an integer array.

 

Do you mean a waveform record of type CHAR that is used to hold a long string?  I think you just declare it as

 

char waveform[MAX_SIZE];

 

Mark

 

 

From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Al Honey
Sent: Tuesday, June 20, 2017 2:22 PM
To: 'tech-talk@aps.anl.gov'
Subject: waveform arrays within SNL

 

Hi

I cannot find an explicit example in regards to accessing the element values in a waveform array from within an SNL sequencer.

Does anybody have experience doing so?

 

Can’t seem to do this:

 

int locations;

assign locations to "{tel}{instr}:{mech}:locations";  // where locations is a waveform record with an integer array.

int locs[4] = {0,300,600,900};

 

        pvGet( locations );

        locs = locations;               // is the declaration for locations (above) correct?

 

error: incompatible types when assigning to type int[4] from type int *

         locs = locations;

 

This fails too:

         locs[0] = locations[0];

 

I guess I’m ignorant in regards to accessing the array values in the record.

 

Also, is it necessary to escape to C in order to update the elements in a waveform string record?

 

Thanks for any advice you have

Al

 


Replies:
Re: waveform arrays within SNL Benjamin Franksen
References:
waveform arrays within SNL Al Honey
RE: waveform arrays within SNL Mark Rivers

Navigate by Date:
Prev: Re: EPICS build system DESTDIR support J. Lewis Muir
Next: areaDetector developers meeting in Aix on Provence Mark Rivers
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
Navigate by Thread:
Prev: RE: waveform arrays within SNL Mark Rivers
Next: Re: waveform arrays within SNL Benjamin Franksen
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
ANJ, 22 Jun 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·