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: ether_ip driver for ControlLogix PLCs and 'BOOL' tags
From: "Kasemir, Kay" <[email protected]>
To: "[email protected]" <[email protected]>
Date: Wed, 24 Aug 2011 17:47:30 -0400
Hi:

Martin Smith @ APS has found a quirk in the way the ether_ip driver for
ControlLogix PLCs and the PLC handle 'BOOL' tags that might be of interest
to those that use the driver.

The short summary is that you cannot use BI or BO records with plain BOOL
tags on the PLC.

The binary record support in the ether_ip driver is meant for efficient
handling of _bits_. It can read and write bits in a BOOL[], DINT, DINT[]
tag. In those cases it reads or writes the whole numbers over the network,
then dispatches the individual bits to records.

For example, say record A is attached to BOOL[0] or DINT.0,
record B is attached to BOOL[1] or DINT.1 and so on.
Meaning the records are attached to the bits of a DINT, DINT[] or BOOL[].
That all works fine: The driver reads or writes the whole DINT or DINT array
or BOOL array and performs the appropriate bit fiddling to interface the
bits to records.

But if you attach a binary record to a plain, scalar BOOL tag on the PLC,
the following happens:
The driver still wants to read or write individual bits.
A BO record with OUT="@plc MyBOOLTag" will read or write 0 and 1 values.
The PLC, however, returns 0 for 'false' and 255 for 'true'.

The mismatch between 1 and 255 is the issue at the root of the problem that
Martin found in a setup:

A BO record would write a "1". The PLC now actually sets the BOOL tag to
255, and the driver from now on sees 255 as a value.
If the driver is instructed to write a "0" for the BO record, it will write
254, i.e. the received value of 255 with the first bit set to 0.
The PLC, however, considers 254!=0 also as 'true' and keeps the BOOL tag at
255.

Longer summary:
Use binary records (BI, BO, MBBI, MBBO) with BOOL[], DINT or DINT[].
Not with individual BOOL tags, which - even if it were supported - would be
slower than array transfers anyway.

Thanks,
Kay




Replies:
Re: ether_ip driver for ControlLogix PLCs and 'BOOL' tags David Dudley
Re: ether_ip driver for ControlLogix PLCs and 'BOOL' tags John William Sinclair

Navigate by Date:
Prev: Re: question about best IDEs for Windows/Cygwin-x86, GCC, EPICS inEPICS community Guy Jennings
Next: RE: Newbe question - PV limits Allison, Stephanie
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: Newbe question - PV limits emmanuel_mayssat
Next: Re: ether_ip driver for ControlLogix PLCs and 'BOOL' tags David Dudley
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 ·