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

Subject: Re: regarding CaChannel v1.6 handling of dynamic subarrays
From: "Martin L. Smith" <[email protected]>
To: Ritesh Sugandhi <[email protected]>
Cc: [email protected]
Date: Thu, 28 Apr 2011 07:45:22 -0500
In your subArray record set the MALM field to the same as the NELM field.
According to the record reference manual under the heading Array Parameters
the MALM field is used to allocate the memory for the array. It looks like
you are getting the 16 elements correctly but have zeros on elements 17 - 63
for each subArray.

See if this helps,
Marty

Ritesh Sugandhi wrote:
Dear sir

I am having a array of double consist of 64 elements and connected to 4 sub-arrays of size 16. I assigned the random numbers to main array . now when I take elements count for each subarray array and display its output. I got each sub-array is assigned with the 64 elements (instead of 16) and appended by 0 at the end elements .

The code output and database schema is included in mail. Please correct if my understanding is not correct.

Thanking you and Best regards,

Ritesh Sugandhi


*Output is as below::*
(64, [0.15680341096341543, …0.27939076994606538])

('subarrays = 1', 64, [0.15680341096341543,…, 0.6660663007380897,0.0,…. 0.0])

('subarrays = 2', 64, [0.87466558395868221,… 0.59892465207930756, 0.0, …., 0.0])

('subarrays = 3', 64, [0.20673443822330728,…., 0.34672371303892258, 0.0,… 0.0])

('subarrays = 4', 64, [0.47304895704158478,…, 0.27939076994606538, 0.0, ….0.0])

[sugandr@trunk pydev]$

*code is as below::*

from CaChannel import *
import random

driver = CaChannel()
driver.searchw('Py:wave_test')
sub1   = CaChannel()
sub1.searchw('Py:subArr1')
sub2   = CaChannel()
sub2.searchw('Py:subArr2')
sub3   = CaChannel()
sub3.searchw('Py:subArr3')
sub4   = CaChannel()
sub4.searchw('Py:subArr4')

#put randome number in driver
driver.putw([random.random() for x in range(64)])

print(driver.element_count(), driver.getw())

print('subarrays = 1', sub1.element_count(),sub1.getw())
print('subarrays = 2', sub1.element_count(),sub2.getw())
print('subarrays = 3', sub1.element_count(),sub3.getw())
print('subarrays = 4', sub1.element_count(),sub4.getw())

EPICS environment is 3.14.12 and RHEL 5.5 64 bit version using CaChannel v1.6 library

Data base schema is record(subArray, "$(P)subArr1") { field(NELM, "16")
  field(INP, "$(P)wave_test.VAL")
  field(INDX, "0")
  field(FTVL, "DOUBLE")
  field(MALM, "64")
}

record(subArray, "$(P)subArr2") { field(NELM, "16")
  field(INP, "$(P)wave_test.VAL")
  field(INDX, "16")
  field(FTVL, "DOUBLE")
  field(MALM, "64")
}

record(subArray, "$(P)subArr3") {
  field(NELM, "16")
  field(INP, "$(P)wave_test.VAL")
  field(INDX, "32")
  field(FTVL, "DOUBLE")
  field(MALM, "64")
}

record(subArray, "$(P)subArr4") {
  field(NELM, "16")
  field(INP, "$(P)wave_test.VAL")
  field(INDX, "48")
  field(FTVL, "DOUBLE")
  field(MALM, "64")
}

record(fanout, "$(P)mylinker") {
  field(FLNK, "$(P)subArr1")
  field(LNK1, "$(P)subArr3")
  field(LNK2, "$(P)subArr2")
  field(LNK3, "$(P)subArr4")
}

record(waveform, "$(P)wave_test") {
  field(NELM, "64")
  field(FTVL, "DOUBLE")
  field(EGU, "Counts")
  field(SCAN, "Passive")
  field(FLNK, "$(P)mylinker")
}




Replies:
Re: regarding CaChannel v1.6 handling of dynamic subarrays Ritesh Sugandhi
References:
regarding CaChannel v1.6 handling of dynamic subarrays Ritesh Sugandhi

Navigate by Date:
Prev: regarding CaChannel v1.6 handling of dynamic subarrays Ritesh Sugandhi
Next: Re: regarding CaChannel v1.6 handling of dynamic subarrays Ritesh Sugandhi
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  2021  2022  2023  2024 
Navigate by Thread:
Prev: regarding CaChannel v1.6 handling of dynamic subarrays Ritesh Sugandhi
Next: Re: regarding CaChannel v1.6 handling of dynamic subarrays Ritesh Sugandhi
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  2021  2022  2023  2024 
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 ·