Hi Andrew,
It's clunky and inefficient, but problem (1) can be solved with an acalcout record. If AA=[0,1,2,3,4,5], and A=20, then the _expression_ "cat(cat(aa[0,2],a),aa[3,5])"
yields AVAL=[0,1,2,20,4,5]
Even more horrifying, problem (2) can also be solved with an acalcout record. If A==1, B==2, etc., up to H==8, then the _expression_ "aa:=a;k:=0;j:=until(aa:=cat(aa[0,k],@(k+1));k:=k+1;k==9);aa" yields AVAL=[1,2,3,4,5,6,7,8,0,...].
I'm sure there are better solutions, but sometimes it's ok to do something clunky for the moment, so you can move on to the next part of the problem.
Tim Mooney (mooney at anl.gov) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, March 29, 2021 10:55 PM
To: EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: Questions about arrays
All,
I have two questions pertaining to the array records in EPICS 3.15.
- Suppose I have an analog input array or waveform record of size 5 that contains the values 1, 2, 3, 4, 5. Suppose I want to replace with the fourth element. Based upon what I've read, it doesn't seem like subArray is a viable choice. I've also tried to
use caput but to no avail. Any recommendations other than using aSub?
- Suppose I have eight individual analog input records and I want to "concatenate their values" and store the result into an analog input array record. I'm thinking about using either aCalcout or an aub routine. Are those valid options and if not, what are
alternative options I should explore?
Thank you!
Andy
|