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: Handling of String Array in CaChannel library
From: Ritesh Sugandhi <[email protected]>
To: Wang Xiaoqiang <[email protected]>
Cc: [email protected]
Date: Thu, 21 Apr 2011 17:25:40 +0200
Dear Sir,

thanks for sharing the code,  using your code I have mange to read and write array a simple array.

I am able to successfully enhance the code to  read and write a double array of size 64k ( 65535) elements. in this case I am using EPICS_CA_MAX_ARRAY_BYTES configuration was 524280 ( i.e. 65535 * 8 bytes for double). this works successfully

I have declared a string Array of 65535 elements and this time I have setted EPICS_CA_MAX_ARRAY_BYTES to 2621400 (i.e. 40*65535 considering size of 40 bytes for string) at server and client side. running with this gives error 

('total values are', 65535)
The requested data transfer is greater than available memory or EPICS_CA_MAX_ARRAY_BYTES

but when I set EPICS_CA_MAX_ARRAY_BYTES to greater then 2621420 at client side. I get the correct data at client side. 


code is 

from CaChannel import *
from random    import *
def main():
  try:
    channel = CaChannel('Py:string64k')
    channel.searchw()
    newval=[]
    for i in range(65535): newval.append("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-$#")
    channel.putw(newval)
    print('total values are',channel.element_count())
    print(channel.getw())
    del channel
  except CaChannelException, status:
    print ca.message(status)
main()

record is 

 record(waveform, "Py:string64k")
{
    field(DESC, "string array")
    field(NELM, "65535")
    field(FTVL, "STRING")
}



-----------------------------------------------------------

 



On Wed, Apr 20, 2011 at 4:21 PM, Wang Xiaoqiang <[email protected]> wrote:
 
Hi,
 
Load this into your IOC:
record(waveform, "cawave")
{
    field(DESC, "numeric array")
    field(NELM, "20")
    field(FTVL, "DOUBLE")
}
 
>>> import CaChannel
>>> pv=CaChannel.CaChannel('cawave')
>>> pv.searchw()
>>> pv.getw()
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
>>> pv.putw(range(12))
>>> pv.getw()
[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
>>>
 
Xiaoqiang

From: [email protected] [mailto:[email protected]] On Behalf Of Ritesh Sugandhi
Sent: Wednesday, April 20, 2011 3:48 PM
To: [email protected]
Subject: Handling of Array in CaChannel library

Dear Sir,

Could I get an example of how to handle sub array and waveforms records in CaChannel-v1.6 library code.

Best regards,

ritesh Sugandhi




Replies:
RE: Handling of String Array in CaChannel library Wang Xiaoqiang

Navigate by Date:
Prev: Re: EPICS Base v3.14.12.1-rc1 compilation error Andrew Johnson
Next: Re: PyEpics and Python threads Matt Newville
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: Re: #RE: About ASG usage jun-ichi.odagiri
Next: RE: Handling of String Array in CaChannel library Wang Xiaoqiang
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 ·