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

Subject: Re: Loading modbus waveform record from acalcout record (or caput)
From: Tim Mooney <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Fri, 28 Sep 2012 10:53:49 -0500 (CDT)
Jon,

field(OUT, "CnOutWArray.VAL CA NMS")
and
field(OUT, "CnOutWArray.VAL PP NMS")
should both work.

The "caput -a..." command you show is not succeeding in setting the array elements because of the commas.
$ caput -a CnOutWArray 28 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
should work, and verify that the waveform record is accepting puts.

The acalcout record checks the number of elements of the PV it's writing to to decide whether to write the AVAL field, or the VAL field.  You can have the record show you what it thinks is the number of elements of the PV it's writing to, by setting the variable devaCalcoutSoftDebug to 1.  Here's an example on vxWorks:

  iocvxWorks> devaCalcoutSoftDebug=1
  devaCalcoutSoftDebug = 0x1b3b73c: value = 1 = 0x1
  <process an acalcout record with an output link to a waveform record configured with NELM==100>
  iocvxWorks> write_acalcout: pact=0
  write_acalcout: target nelm=100




----- Original Message -----
From: [email protected]
To: [email protected]
Sent: Thursday, September 27, 2012 5:45:11 PM
Subject: Loading modbus waveform record from acalcout record (or caput)



How can we update the value of a modbus waveform record,
programmatically from an acalcout record, or interactively via caput?

We are using EPICS asyn with modbus support to write bits to a PLC.
We use modbus function 15, which writes to the PLC from a waveform
record with DTYP asynInt32ArrayOut - all the output bits are packed
into the waveform.  We use a waveform record defined by the
intarray_out.template included in the modbus support.  We currently
use a gensub to collect the bits from many bo records and pack them
into the waveform record.

We are investigating using acalcout records instead of a gensub to
collect and pack the bits.  We have this working up to where we have
an acalcout record - call it BitArray - whose AVAL field contains the
array of bits we want in our waveform record.  All that remains is to
copy BitArray.AVAL into our waveform record - call it CnOutWArray.
How?  We have tried various values for BitArray.OUT, including
"CnOutWArray CPP", "CnOutWArray.VAL PP, "CnOutWArray.VAL CA NMS", and
passive or periodic scanning.  None of these work, the value of
CnOutWArray remains all zeroes (sometimes integers appear in
the first element only, in an unreproducible way). At the destination
end, CnOutWArray.INP is already assigned in intarray_out.template to
@asyn... so I presume we shouldn't change that.

It would sometimes be helpful to load the waveform interactively, for example by
using caput.  The caput -a option only loads the first array element:

$ caput -a CnOutWArray 28 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Old : CnOutWArray 28 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
New : CnOutWArray 28 1 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

Is there a way to assign all the bits interactively?

Jon Jacky, University of Washington

PS - Here is our acalcout record, BitArray

record(acalcout, "BitArray") {
  field(SCAN, ".1 second")
  field(NELM, 28)
  field(CALC, "AA+BB+CC+DD+EE+FF+GG+HH+II+JJ")
  field(OOPT, "On Change")
  field(DOPT, "Use CALC")
  field(OUT, "CnOutWArray.VAL CA NMS") # recommended in acalcout doc
  field(INAA, "BitArray0.AVAL")
  field(INBB, "BitArray1.AVAL")
  ... etc. ...
}





-- 
Tim Mooney ([email protected]) (630)252-5417
Software Services Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab

Replies:
Re: Loading modbus waveform record from acalcout record (or caput) jon
References:
Loading modbus waveform record from acalcout record (or caput) jon

Navigate by Date:
Prev: RE: problem passing string to aSub record parameter Jim Chen
Next: RE: problem passing string to aSub record parameter Jim Chen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Loading modbus waveform record from acalcout record (or caput) jon
Next: Re: Loading modbus waveform record from acalcout record (or caput) jon
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  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 ·