Experimental Physics and Industrial Control System
Touchard Dominique wrote:
I am quiet beginner on Epics and I have started to try to use waveform
records (specialy Asyn/modbustcp waveform records)
I didn't find howto set or read just one value (per example the second)
on a waveform record.
May somebody advise me or point out a technical document which explain
howto do this ?
Thank's for your help.
Dominique Touchard.
You can read just one element with the subarray record
(see http://www.aps.anl.gov/epics/wiki/index.php/RRM_3-13_SubArray)
I don't know if the subarray record can set a single element of an
array, but I don't think so.
You can do both with the aCalcout (array calc out) record, but note
that this record is not in base; it's an add-on, supplied by the calc
module.
(See http://www.aps.anl.gov/aod/bcda/synApps/calc/R2-6-3/aCalcoutRecord.html)
The doc describes how to access a single element, but it doesn't
mention setting an element. I'll describe both, after some background:
The aCalcout record has scalar input fields A, B, C..., array input
fields AA, BB, ..., and an array output field AVAL.
Let's assume the AA field has the value[0,1,2,3,...]
You can select the 4th element with the following calc expression:
aa[3,3]
(Numbering starts at zero.) This will actually return the result
[3,0,0,0,0,...]
You can get a subarray in its original place with the following expression:
aa{3,5}
(-1 means the last element.) This will return the result
[0,0,0,3,4,5,0,0,...]
Armed with this, and with the ARR() command (arr(6) = [6,6,6,6....]), you
can set element 'a' of the array 'aa' to the value of 'b' with the following
expression:
aa[0,a-1] + aa{a+1,-1} + (arr(b)[0,0]>>a)
If aa = [0,1,2,3,4,...], a = 3, and b = 20, the first term yields
[0,1,2,0,0,0...]
The second term yields
[0,0,0,0,4,5,...]
The third term yields
[0,0,0,20,0,0,...]
and the sum is
[0,1,2,20,4,5,...]
Note that this is not an efficient way to do the job. It's good
for unanticipated needs, because you can program it at run time, but
if I were planning to do this routinely, I would write a custom routine
for the genSub record.
(See http://www.observatorysciences.co.uk/images/genSubManual.pdf)
--
Tim Mooney ([email protected]) (630)252-5417
Beamline Controls & Data Acquisition Group
Advanced Photon Source, Argonne National Lab.
- Navigate by Date:
- Prev:
Fedora 6 kernel-xen-2.6.20-1.2948 bug + NTFS mounting + openmotif Adams, Billy R. (LARC-D401B)[RAYTHEON TECHNICAL SERVICES CO]
- Next:
I need driver of vme-gpib for vxworks5.4 xuglei
- 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
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Fedora 6 kernel-xen-2.6.20-1.2948 bug + NTFS mounting + openmotif Adams, Billy R. (LARC-D401B)[RAYTHEON TECHNICAL SERVICES CO]
- Next:
I need driver of vme-gpib for vxworks5.4 xuglei
- 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
2021
2022
2023
2024