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 11:40:07 -0500 (CDT)
Jon,

I noticed something else:
field(OOPT, "On Change")
probably does not do what you're thinking it does.  It looks only at the (scalar) VAL field (the first element of AVAL) to determine whether or not to execute the output link.

This really does seem like a job for the genSub or asub records.  I can't think of an efficient way for the acalcout record to do it.

Tim

----- 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

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

Navigate by Date:
Prev: Re: problem passing string to aSub record parameter Andrew Johnson
Next: modbus 2.4 Pierrick M Hanlet
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: Re: Loading modbus waveform record from acalcout record (or caput) jon
Next: camon: multiple servers found? Laznovsky Michael
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 ·