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  2012  2013  2014  <20152016  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  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: signal enable/disable in drvSIS3820 driver
From: Mark Rivers <[email protected]>
To: "'[email protected]'" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 24 Sep 2015 16:36:23 +0000

Hi,

 

While using a pull request on github is a good approach in general, in this case it is more work for Hovanes than necessary, because he is using a modified version of the driver, and so he would need to patch both his version and the original version.

 

The problem does indeed occur 2 places in drvSSIS3820.cpp, and also in 1 place in drvSIS3801.cpp.  I have fixed both and pushed the fixes back to github.  My fix is very similar but not identical to the fix that Hovanes suggested.  I also fixed a number of compiler warnings.

 

Mark

 

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Thursday, September 24, 2015 10:15 AM
To: [email protected]; [email protected]
Subject: RE: signal enable/disable in drvSIS3820 driver

 

Hi Hovanes,

 

The “mca” module is now on github which makes it a lot easier to feedback fixes to the developers. I suggest that you make a github fork of the mca repository from here: https://github.com/epics-modules/mca then apply your change to your fork and issue a Pull Request back to the original repository. Then the maintainer(s) can review, discuss and hopefully accept the change all in one place.

 

If you are not familiar with git/github then the github help pages are a good starting point – this one will take you through the forking/pull request workflows: https://help.github.com/articles/fork-a-repo/

 

Cheers,

Ulrik

 

From: [email protected] [mailto:[email protected]] On Behalf Of Hovanes Egiyan
Sent: 24 September 2015 15:56
To: [email protected]
Subject: signal enable/disable in drvSIS3820 driver

 

Hi,

when we were trying to use SIS3820 struck scalers with mca record on a Linux CPU
using modified EPICS mca module, we run into a problem when we could not enable all inputs
(signals) of the Struck scaler module in EPICS, which is probably the most frequent 
mode for this scaler readout. We tracked it down to the line# 480 in drvSIS3820.cpp asyn driver
for SIS3820:

/* Disable channel in MCS mode. We enable the first maxSignals_ inputs */

 

registers_->copy_disable_reg = 0xFFFFFFFF << maxSignals_;



The result of the left-shift of a 32-bit variable by 32 bits in C apparently is undefined, and it
happens to be 0 on our Motorolla VME controllers running VxWorks, and 0xFFFFFFFF on
our Intel-based Linux controllers. Therefore, when we were enabling all input signals, the
driver for Linux was actually disabling all of the signals. We patched it using an if-statement and it
seems to work for us now for our customized version of the driver, but it would probably be useful to do
something similar in the official driver. 

 
      disableMask = ( allEnabled << maxSignals_ );
      if( maxSignals_ >= SIS38XX_MAX_SIGNALS ) disableMask = 0;
      vmeWrite32((volatile unsigned int*)&registers_->copy_disable_reg, disableMask );
 

The same issue probably will arise at line# 521 (SCALER mode):

/* Disable channel in scaler mode. */

 

registers_->count_disable_reg = 0xFFFFFFFF << maxSignals_;




Best,
    Hovanes Egiyan

 

-- 

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 


References:
signal enable/disable in drvSIS3820 driver Hovanes Egiyan
RE: signal enable/disable in drvSIS3820 driver ulrik.pedersen

Navigate by Date:
Prev: RE: Unable to build support modules on Windows, with base 3.15.2 Mark Rivers
Next: RE: Unable to build support modules on Windows, with base 3.15.2 Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: signal enable/disable in drvSIS3820 driver ulrik.pedersen
Next: alarm severity set by other channel values Patrick Thomas
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·