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: Fwd: Re: OPC with binary out records
From: [email protected]
To: "Roland Fleischhauer" <[email protected]>
Cc: [email protected], [email protected]
Date: Wed, 15 Aug 2012 15:43:18 -0700 (PDT)
Hi Roland,

Yes, in our case we are not using it as a toggle. When we set the bo
record value to 1, we want the OPC variable to be set to 1 and remain 1
until we change it (this works) and when we set the bo record value to 0,
we would like the OPC variable to be set to 0 and remain 0 until we change
it (this works). When the OPC IOC starts we would like to have the bo
record value be set to whatever the value of the corresponding OPC
variable is. If the OPC variable is 0 when the OPC IOC starts we would
like the bo record value to be set to 0 (this works). If the OPC variable
is 1 when the OPC IOC starts we would like the bo record value to be set
to 1 (currently it gets sets to 65535). The record I was testing was
configured as:

record(bo,"H2:ASC-Y_TR_A_WHITEN_SEG_1_SET_1") {
	field(DESC,"Filter set")
	field(SCAN,"Passive")
	field(DTYP,"opc")
	field(OUT,"@Plc2.H2.Asc.Y.Tr_A.Whiten.Seg[1].Set[1]")
	field(TSE,"-2")
	field(PINI,"0")
	field(ONAM,"On")
	field(ZNAM,"Off")
}
---------------------------------------------------------------------

The st.cmd file was configured as:

opcDbg("0x020")

dbLoadDatabase("C:/Program Files/HZB/OpcIocShell/dbd/opcIoc.dbd",0,0)
iocShell_registerRecordDeviceDriver(pdbbase)

opcSetServer("localhost","TwinCATOpcServerDA")

#opcSetGroup("plc1","10")                     # scanning every 10
milliseconds
#dbLoadRecords("./PLC1/PLC1.db")

#opcSetGroup("plc2","10")                     # scanning every 10
milliseconds
#dbLoadRecords("./PLC2/PLC2.db")

#opcSetGroup("plc3","10")                     # scanning every 10
milliseconds
#dbLoadRecords("./PLC3/PLC3.db")

#opcSetGroup("plc4","10")                     # scanning every 10
milliseconds
#dbLoadRecords("./PLC4/PLC4.db")

opcSetGroup("group1","10")
dbLoadRecords("./PLC1/PLC1.db")
dbLoadRecords("./PLC2/PLC2.db")
dbLoadRecords("./PLC2/alias.db")
dbLoadRecords("./PLC3/PLC3.db")
#dbLoadRecords("./PLC4/PLC4.db")

iocInit()

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

The record that I am testing is in PLC2.db.

Are there any other configuration settings that would be helpful?

Thank you for your time,
Patrick



> Hi Patrick,
>
> I am Roland Fleischhauer, a coworker of Carsten and maintainer of the
OPC/IOC configurations at BESSY.
>
> Your question seems to be a little bit more difficult at a closer lock.
For bo-records we use a construct like this:
>
> record(bo,"$(PV):SetTa"){
>     field(DESC,"")
>     field(ASG,"DEFAULT")
>     field(TSE,"-2")
>     field(DTYP,"opc")
>     field(OMSL,"supervisory")
>     field(OUT,"@$(PV):SetTa")
> #    field(HIGH,"1")
>     field(ZNAM,"off")
>     field(ONAM,"toggle")
> }
>
> That should be very similar to your application, isn't it? But please
note
> that the standard value always is Zero (0). A temporarily TRUE-value,
better the rising edge of signal, will activate an action in our plc (
e.g. open/close a valve ). So such a record works as a trigger signal for
> the plc.
>
> We don't using direct connections between a bo-record and a physical
output on plc-side so sending a zero-value at initialization is no problem.
>
> In generally our strategy is to put all automation tasks on plc-side and
control it from EPICS (e.g. start, stop etc.) by trigger signals.
>
> For bi-records only we use the DTYP=rawOpc, like this:
>
> record(bi,"$(PV):Closed") {
>     field(ASG,"DEFAULT")
>     field(DESC,"valve closed")
>     field(SCAN,"I/O Intr")
>     field(DTYP,"opcRaw")
>     field(TSE,"-2")
>     field(PINI,"1")
>     field(INP,"@$(PV):Closed")
>     field(ZNAM,"not closed")
>     field(ONAM,"closed")
> }
>
> Sorry for the confusion but it seems that DTYP=rawOpc will not work for
you with bo-records. For better understanding your application it would be
> nice if you would give some more information about it. Maybe you can
provide your config files?
>
> Additional we will take a closer lock to the software sources to
understand why the bo sends data in passive mode with pini=0. This will
take some time I afraid.
>
>
> Roland Fleischhauer
>
>
> Am 15.08.2012 08:59, schrieb Carsten Winkler:
>
>
>
> -------- Original-Nachricht --------
> Betreff:        Re: OPC with binary out records
> Datum:  Tue, 14 Aug 2012 14:55:34 -0700
> Von:    <[email protected]><mailto:[email protected]>
> An:     Carsten Winkler
> <[email protected]><mailto:[email protected]>
Kopie (CC):     <[email protected]><mailto:[email protected]>
>
>
>
> Hi Carsten,
>
> Thank you for your reply. Unfortunately when I set the DTYP to opcRaw on
a
> binary out record, it seems to change the value from 1 to 0 when the OPC
IOC is restarted. The RVAL changes from 1 to 4294967295. The SCAN field
for the record is Passive and PINI is set to 0.
>
> -Patrick
>
>> Hallo Patrick,
>> the OPC specification for binary values says a zero value will be
mapped
>> to FALSE and all other numbers will be mapped to TRUE and stored as -1.
If you start your OPC IOC it gets the current value from the OPC server
for all OPC variables. The OPC server writes 0xffff for bo-records if they
>> are true and so you get 65535 or -1 as integer value. If you want to
get
>> 0
>> for FALSE and 1 for TRUE you should use in your boolean records (bo and
bi) the definition field(DTYP, "opc Raw")
>> Carsten
>> Hi,
>> I am using the OPC device support module version 3.8.0.0 to connect to
an
>> OPC server supplied with Beckhoff TwinCAT 2.11. This is running on
Windows
>> 7 Professional with Service Pack 1. For the binary out records, if they
are set to 1, and the EPICS OPC IOC is then restarted, their value is
changed to 65535. If they are set to 0, and the EPICS IOC is then
restarted, they remain set to 0. I do not think I have seen this
behavior
>> with the binary input records.
>> Thank you for your time,
>> Patrick
>> ________________________________
>> Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
>> Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher
>> Forschungszentren e.V.
>> Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch,
stv.
>> Vorsitzende Dr. Beatrix Vierkorn-Rudolph
>> Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas
Frederking
>> Sitz Berlin, AG Charlottenburg, 89 HRB 5583
>> Postadresse:
>> Hahn-Meitner-Platz 1
>> D-14109 Berlin
>> http://www.helmholtz-berlin.de
>
>
>
>
>
>
>
>
>
> --
>
>
> Dipl.-Ing (FH) Ingenieur / graduate engineer
> Roland Fleischhauer
> NP-A3
>
> Elektronenspeicherring BESSY II am Helmholtz-Zentrum Berlin für
Materialien und Energie GmbH
> Albert-Einstein-Str. 15, 12489 Berlin
> Fon +49 30 8062-15005 / -17932
> Fax +49 30 8062-14850
> [email protected]<mailto:[email protected]>
>
>
> ________________________________
>
> Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
>
> Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher
> Forschungszentren e.V.
>
> Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch,
stv.
> Vorsitzende Dr. Beatrix Vierkorn-Rudolph
> Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking
>
> Sitz Berlin, AG Charlottenburg, 89 HRB 5583
>
> Postadresse:
> Hahn-Meitner-Platz 1
> D-14109 Berlin
>
> http://www.helmholtz-berlin.de
>











References:
Re: OPC with binary out records pthomas

Navigate by Date:
Prev: Re: EPICS Base version 3.15.0.1 released Tim Mooney
Next: RE: JCas Carcassi, Gabriele
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: OPC with binary out records Bernhard Kuner
Next: JCas Carsten Winkler
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 ·