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

Subject: regarding CaChannel v1.6 handling of dynamic subarrays
From: Ritesh Sugandhi <ritesh.sugandhi@gmail.com>
To: tech-talk@aps.anl.gov
Date: Thu, 28 Apr 2011 14:30:59 +0200
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 Martin L. Smith

Navigate by Date:
Prev: Handling of a character waveform of 64k elements Ritesh Sugandhi
Next: Re: regarding CaChannel v1.6 handling of dynamic subarrays Martin L. Smith
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 
Navigate by Thread:
Prev: Re: Handling of a character waveform of 64k elements Andrew Johnson
Next: Re: regarding CaChannel v1.6 handling of dynamic subarrays Martin L. Smith
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 
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 ·