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  2015  2016  <20172018  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  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Time interval for Asyn auto reconnect
From: "Paduan Donadio, Marcio" <[email protected]>
To: "[email protected]" <[email protected]>
Date: Sat, 29 Jul 2017 01:46:56 +0000
Hello, Mark.

I found the record that is processing the asyn record. It is a sequence of records that checks if there is information comming from the equipment and writes 0 and 1 to CNCT if not. The only thing I didn't understand yet is why it is processing each 5 seconds and not each 10 seconds.

Here they are:

record(calcout, "BSOIC:B44:4:GammaAsynControlCount")
{
  field(DESC, "Missing Data Counter")
  field(SCAN, "10 second")
  field(FLNK, "BSOIC:B44:4:GammaAsynControlCheck")
  field(CALC, "((B==4)&&(C==0))?(A+1):0")
  field(INPA, "BSOIC:B44:4:GammaAsynControlCount")
  field(INPB, "BSOIC:B44:4:GammaSWStatus")
  field(INPC, "0")
  field(EGU,  "Counts")
  field(OUT,  "BSOIC:B44:4:GammaAsynControlCount.C")
  field(DOPT, "Use OCAL")
  field(OCAL, "0")
  field(HOPR, "10")
}

record(calcout, "BSOIC:B44:4:GammaAsynControlCheck")
{
  field(DESC, "Missing Data Counter Check")
  field(CALC, "(A>=B)")
  field(INPA, "BSOIC:B44:4:GammaAsynControlCount")
  field(B,    "12")
  field(OCAL, "0")
  field(DOPT, "Use OCAL")
  field(OOPT, "Transition To Non-zero")
  field(OUT,  "BSOIC:B44:4:GammaAsynControlReset.PROC PP")
}

record(seq, "BSOIC:B44:4:GammaAsynControlReset")
{
  field(DESC, "Asyn Control Reset")
  field(DOL1, "1")
  field(LNK1, "BSOIC:B44:4:GammaAsynControlCount.C")
  field(DOL2, "0")
  field(LNK2, "BSOIC:B44:4:GammaAsynControl.CNCT PP")
  field(DLY3, "2")
  field(DOL4, "1")
  field(LNK4, "BSOIC:B44:4:GammaAsynControl.CNCT PP")
}

# Asyn Diagnostic PVs
record(asyn,"BSOIC:B44:4:GammaAsynControl") {
    field(DTYP, "asynRecordDevice")
    field(PORT, "GAMMA_B44_4")
}




________________________________________
De: Mark Rivers <[email protected]>
Enviado: quarta-feira, 19 de julho de 2017 12:18
Para: Paduan Donadio, Marcio; [email protected]
Assunto: RE: Time interval for Asyn auto reconnect

Hi Marcio,

> The only asyn record in the database is used for debugging reason:
>record(asyn,"$(BL,recursive)GammaAsynControl") {
>    field(DTYP, "asynRecordDevice")
>    field(PORT, "$(PORT,undefined)")
>}

It is clear from your previous message that that asyn record is processing twice approximately every 5 seconds:

> 2017/06/28 19:09:03.392 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
> 2017/06/28 19:09:03.392 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
> 2017/06/28 19:09:08.270 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
> 2017/06/28 19:09:08.270 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
> 2017/06/28 19:09:14.529 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
> 2017/06/28 19:09:14.529 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout

What is causing that record to process?  I want to figure out why it is printing those messages.

Mark


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Paduan Donadio, Marcio
Sent: Wednesday, July 19, 2017 2:00 PM
To: [email protected]
Subject: Re: Time interval for Asyn auto reconnect

Hello, Mark.

Records using stream with I/O Intr are stringin and calcout ones.

The only asyn record in the database is used for debugging reason:

record(asyn,"$(BL,recursive)GammaAsynControl") {
    field(DTYP, "asynRecordDevice")
    field(PORT, "$(PORT,undefined)")
}

I didn't studied Stream Device code, but I tend to like decoupled code. So, it seems to me that not adding dependencies to Asyn, where it is currently independent, is a good idea.

Best regards,

Márcio Paduan Donadio
Control Systems Engineer
SLAC National Accelerator Laboratory
Advanced Instrumentation for Research Division
2575 Sand Hill Rd
Menlo Park CA 94025
Office (650) 926-5007

________________________________________
De: Mark Rivers <[email protected]>
Enviado: terça-feira, 18 de julho de 2017 19:14
Para: Paduan Donadio, Marcio
Cc: [email protected]
Assunto: Re: Time interval for Asyn auto reconnect

Hi Marcio,

Ok, I see some messages that are probably from Asyn:
2017/06/28 19:09:03.392 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout

What record type is that record? Is it an asyn record?  If so what is the value of its SCAN field and what is it doing? That may be a message we need to suppress in the asyn record so it is not issued repeatedly.

streamDevice uses asyn for I/O but it does not use asyn for printing error messages. That is unfortunate because if it did you would have the ability to turn off the messages using asynTrace control.  I have suggested this to Dirk but it would introduce asyn dependencies into parts of streamDevice code that are currently independent of asyn, which he is reluctant to do.

Mark





Sent from my iPhone

On Jul 18, 2017, at 6:23 PM, Paduan Donadio, Marcio <[email protected]<mailto:[email protected]>> wrote:


Thank you for your answer, Mark.

> Your first question is whether it is possible to control when it retries a connection.  That is not
> currently possible.  If the port is disconnected then it will try to reconnect each time there is an
> attempt to  communicate with that port. This is typically when periodically processed records process.
> There is not a separate asyn thread that is doing the reconnect attempts.

Oh, so now I am understanding the point. We are using StreamDevice and all records with  DTYP=stream have SCAN=I/O Intr. So, it is the polling loop that works inside I/O Intr of StreamDevice that is requesting a communication with Asyn. I think Tim Mooney could confirm this for us? Answering my own question, if this is the case, all I need to do is to set PollPeriod to something in the protocol file. The problem I see here is that the data will not be updated in a good frequency when we are not facing problems.

> Your second question is whether you can reduce the number of error messages.  The drvAsynIPPort
> driver does not print any error messages when ports disconnect and reconnect.  asynManager also
> does not print any  error messages when ports disconnect and reconnect.  Both of them simply format
> error message strings that they pass back to device support when they detect an error. Since the error
> messages are coming from device support (or some other layer above asyn),  the answer to your
> questions depends on what device support you are using.​

After you mentioned it, I checked the messages in the IOC shell. All of them seems to come from Stream Device, in fact:
********************
2017/07/06 13:20:58.366686 GAMMA_B44_12 BSOIC:B44:12:GammaDoseRate: I/O error after reading 0 bytes: ""
2017/07/06 13:20:58.366701 GAMMA_B44_12 BSOIC:B44:12:GammaDoseRate: Protocol aborted
2017/07/06 13:20:59.075736 GAMMA_B44_12 BSOIC:B44:12:GammaString: asynError in read. Asyn driver says: ts-b044-pp01:2107 disconnected:
********************
The message that tricked me is "asynError in read. Asyn driver says: ts-b044-pp01:2107 disconnected". I attributed it to Asyn.

> There is standard asyn device support that comes with asyn.  In asyn R4-27 I made the following change:
>    Changed error reporting if pasynManager->queueRequest returned an error. Previously error messages were
>    printed on every call, which would cause a large number of messages if the port was disconnected and records
>    were  periodically processing. Now an error message is only printed when the status return from pasynManager
>    queueRequest changes, so there will be single message for each record when a port disconnects and a single
>     message when it reconnects.

Ok, I see some messages that are probably from Asyn:
2017/06/28 19:09:03.392 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:03.392 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:08.270 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:08.270 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:14.529 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:14.529 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:17.991 BSOIC:B44:4:GammaAsynControl: Connect error, status=3, asynManager:connectDevice port GAMMA_B44_19 not found
2017/06/28 19:09:21.194 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:21.194 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:32.755 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:32.755 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:37.171 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout
2017/06/28 19:09:37.171 BSOIC:B44:4:GammaAsynControl: special queueRequest timeout

These are all of them until a connection is reestablished.

> Here are some questions for you:
>
> - What version of asyn are you using?
4.31

The remaining questions were answered above.

 So, I think that I should redirect my questions to Stream Device. Maybe write a new e-mail to Tech Talk?

Thank you once more for the answers!

Márcio Paduan Donadio
Control Systems Engineer
SLAC National Accelerator Laboratory
Advanced Instrumentation for Research Division
2575 Sand Hill Rd
Menlo Park CA 94025
Office (650) 926-5007​





From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Paduan Donadio, Marcio
Sent: Monday, July 17, 2017 1:39 PM
To: [email protected]<mailto:[email protected]>
Subject: Time interval for Asyn auto reconnect

Hello.

I am using Asyn with IPPort, in auto connect mode, and set it to disconnect if no messages arrive after a timeout. What happens when the connected equipment is switched off is that Asyn waits  for the timeout and than closes the connection. After this, auto connection keep trying to connect until the equipment is switched on again.

This is perfectly what I need, but the problem is the frequency that the auto connection is being done. We are receiveing a lot of reconnection messages in the IOC console and all of this are  being logged in a file.

Is there a way to configure this to retry a connection only after some minutes? Or even to reduce the amount of messages being sent to the IOC console?

Thank you,


Márcio Paduan Donadio

Control Systems Engineer

SLAC National Accelerator Laboratory

Advanced Instrumentation for Research Division

2575 Sand Hill Rd

Menlo Park CA 94025

Office (650) 926-5007​


Replies:
Re: Time interval for Asyn auto reconnect Andrew Johnson
References:
Time interval for Asyn auto reconnect Paduan Donadio, Marcio
RE: Time interval for Asyn auto reconnect Mark Rivers
Re: Time interval for Asyn auto reconnect Paduan Donadio, Marcio
Re: Time interval for Asyn auto reconnect Mark Rivers
Re: Time interval for Asyn auto reconnect Paduan Donadio, Marcio

Navigate by Date:
Prev: Re: BEAST Alarm Server Kasemir, Kay
Next: Re: Time interval for Asyn auto reconnect Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Time interval for Asyn auto reconnect Paduan Donadio, Marcio
Next: Re: Time interval for Asyn auto reconnect Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·