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  2017  2018  2019  <20202021  2022  2023  2024  2025  2026  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  2025  2026 
<== Date ==> <== Thread ==>

Subject: RE: Faster Scan Rates possible?
From: wduckitt via Tech-talk <[email protected]>
To: [email protected]
Date: Thu, 10 Dec 2020 11:54:11 +0200

Hi 

We modify the scan rate menu choices by default and generaly work down to 1ms scans. This works well with a high end I7 PC with the EtherCAT fieldbus and for the EtherCAT based stepper and servo motors, and safety systems.

We can therefore get tighter closed-loop control and achieve better s-curve acceleration. Our implementation of the closed-loop and open-loop control is all within records and not with the Motor record. For some EtherCAT systems we have 6 motors/axes plus a whole bunch of other digital and analog EtherCAT terminals. Depending on how you load the IOC you can use the preemptive kernel or not. We use Debian headless servers as we have found the graphics part of the desktop versions can cause slowing down issues and loss of etherCAT packets even if using the prememptive kernel.

We have also tested down to 10us with a 24V DO module connected to a DI and then back out on a DO module to a scope. In this case we also implement a soft PWM to control the pulse with in 10us steps with 100ms period. If you start to overload the IOC you will get console warnings though. 

On the user interface side you can't generally update the display so fast so for and ADC at 1kHz we use the compress record as FIFO buffer to store the the last 100 samples and then update the GUI at 10 times second. This also works in our favour as you can do some statistics on the FIFO bufer with an ACALCOUT and the provide the min, max and avg at a reasonable rate to the GUI and archiver.

Regards,

William

On 2020-12-10 00:08, [email protected] wrote:

Send Tech-talk mailing list submissions to
    [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
    https://mailman.aps.anl.gov/mailman/listinfo/tech-talk
or, via email, send a message with subject or body 'help' to
    [email protected]

You can reach the person managing the list at
    [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tech-talk digest..."


Today's Topics:

   1. RE: Faster Scan Rates possible? (Manoussakis, Adamandios)
   2. RE: serial IOC connection problem (Ivashkevych, Oksana)
   3. RE: Faster Scan Rates possible? (Manoussakis, Adamandios)
   4. Re: serial IOC connection problem (Mark Rivers)
   5. RE: serial IOC connection problem (Ivashkevych, Oksana)


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

Message: 1
Date: Wed, 9 Dec 2020 21:36:35 +0000
From: "Manoussakis, Adamandios" <[email protected]>
To: EPICS tech-talk <[email protected]>
Subject: RE: Faster Scan Rates possible?
Message-ID:
    <BY5PR09MB50280AC6B12984852FFDDB7EF1CC0@BY5PR09MB5028.namprd09.prod.outlook.com">BY5PR09MB50280AC6B12984852FFDDB7EF1CC0@BY5PR09MB5028.namprd09.prod.outlook.com>

Content-Type: text/plain; charset="utf-8"

Also mark just to make sure I understood Passive,Event,IO Intr are always at the top and do not have any priority assigned due to being event driven and then the next menuScans are from slowest to fastest which are assigned also lower to highest priority 10s being lowest priority and .1 second being highest priority assigned?


  menu(menuScan) {

      choice(menuScanPassive,"Passive")

      choice(menuScanEvent,"Event")

      choice(menuScanI_O_Intr,"I/O Intr")

      choice(menuScan10_second,"10 second")

      choice(menuScan5_second,"5 second")

      choice(menuScan2_second,"2 second")

      choice(menuScan1_second,"1 second")

      choice(menuScan_5_second,".5 second")

      choice(menuScan_2_second,".2 second")

      choice(menuScan_1_second,".1 second")

  }


From: Tech-talk <[email protected]> On Behalf Of Manoussakis, Adamandios via Tech-talk
Sent: Wednesday, December 9, 2020 1:33 PM
To: EPICS tech-talk <[email protected]>
Subject: RE: Faster Scan Rates possible?

Thanks Mark/Andrew for the insigh, is there any rule of thumb for how fast you can setup a SCAN rate in that dbd file for any current line of CPU (assuming more cores would help with threading and higher clock speeds).  Is it safe to say go to .01 .001 on current gen cpu hardware?

From: Johnson, Andrew N. <[email protected]<mailto:[email protected]>>
Sent: Wednesday, December 9, 2020 1:21 PM
To: Manoussakis, Adamandios <[email protected]<mailto:[email protected]>>
Cc: EPICS tech-talk <[email protected]<mailto:[email protected]>>
Subject: Re: Faster Scan Rates possible?

Hi,

On Dec 9, 2020, at 3:14 PM, Manoussakis, Adamandios via Tech-talk <[email protected]<mailto:[email protected]>> wrote:

I have been looking at older posts and have seen talk of increasing the scan rate from the default (I think) .1seconds but no definitive guide on how to?  On a standard linux distro without RT_PREEMPT, is it possible to push to say .01 or faster scan rates?  Also I wanted to know does camonitor only update as fast as the scan rate limit, .1seconds currently?

There is no internal connection between CA monitor rates and the DB scan rates, it very much depends on your CPU, your IOC application and the clients you have connected as to how fast you would be able to run a periodic scan thread that sends out monitors. Note that the IOC?s CA server can and does throw away monitor updates if the clients can?t keep up, so don?t design your systems assuming that your clients will always get every monitor if you?re running at high speeds.

HTH,

- Andrew

--
Complexity comes for free, simplicity you have to work for.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.aps.anl.gov/pipermail/tech-talk/attachments/20201209/46068f11/attachment.html>

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

Message: 2
Date: Wed, 9 Dec 2020 21:39:02 +0000
From: "Ivashkevych, Oksana" <[email protected]>
To: Mark Rivers <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: RE: serial IOC connection problem
Message-ID:
    <BLAPR09MB7361D5E5874CD6871A6EF80FD3CC0@BLAPR09MB7361.namprd09.prod.outlook.com">BLAPR09MB7361D5E5874CD6871A6EF80FD3CC0@BLAPR09MB7361.namprd09.prod.outlook.com>

Content-Type: text/plain; charset="us-ascii"

Hi Mark,
Thank you very much for being thorough and suspicious.
It still works without errors.
And I gladly express my happy wows one more time. :)
With this line present you won't even see error messages.

Could you please elaborate on this, I did see connection errors  before implementing the fix you suggested, right?
Oksana

[oksana@xf16id-babyioc1 ftsioc]$ ../../bin/linux-x86_64/ftsioc st.cmd
#!../../bin/linux-x86_64/ftsioc
< envPaths
epicsEnvSet("IOC","ftsioc")
epicsEnvSet("TOP","/home/oksana/ftsioc")
epicsEnvSet("SUPPORT","/opt/epics/support")
epicsEnvSet("ASYN","/opt/epics/support/asyn")
epicsEnvSet("CALC","/opt/epics/support/calc")
epicsEnvSet("STREAM","/opt/epics/support/StreamDevice")
epicsEnvSet("DEVIOCSTATS","/opt/epics/support/iocStats")
epicsEnvSet("AUTOSAVE","/opt/epics/support/autosave")
epicsEnvSet("EPICS_BASE","/opt/epics/epics-base")
epicsEnvSet("STREAM_PROTOCOL_PATH",    "../../ftsiocApp/Db")
epicsEnvSet("PREFIX",                  "XF:16IDC-ES:LIX")
epicsEnvSet("FTS_IP",                  "10.16.2.195:49151 HTTP")
epicsEnvSet("PORT",                    "FTS")
## Register all support components
dbLoadDatabase("../../dbd/ftsioc.dbd",0,0)
ftsioc_registerRecordDeviceDriver(pdbbase)
drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP")
## Load record instances
dbLoadRecords("../../db/fts.db","P=XF:16IDC-ES:LIX,R={FTS:2},PORT=FTS,user=oksana")
iocInit()
Starting iocInit
############################################################################
## EPICS R7.0.3.1
## EPICS Base built Dec  1 2020
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncftsioc,"user=oksana"
epics>



-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 3:57 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


 it looks like I forgot to remove asynSetTraceMask( "FTS",0,0).


Yes, you should comment out or remove this line.  With this line present you
won't even see error messages.


asynSetTraceMask( "FTS",0,0)

Mark

________________________________
From: Ivashkevych, Oksana <[email protected]>
Sent: Wednesday, December 9, 2020 2:53 PM
To: Mark Rivers
Cc: [email protected]
Subject: RE: serial IOC connection problem

Hi Mark,
Yes, this is exactly what I did , and it looks like I forgot to remove
asynSetTraceMask( "FTS",0,0).
Oksana

[oksana@xf16id-babyioc1 ftsioc]$ vim st.cmd
[oksana@xf16id-babyioc1 ftsioc]$ ../../bin/linux-x86_64/ftsioc st.cmd
#!../../bin/linux-x86_64/ftsioc < envPaths
epicsEnvSet("IOC","ftsioc")
epicsEnvSet("TOP","/home/oksana/ftsioc")
epicsEnvSet("SUPPORT","/opt/epics/support")
epicsEnvSet("ASYN","/opt/epics/support/asyn")
epicsEnvSet("CALC","/opt/epics/support/calc")
epicsEnvSet("STREAM","/opt/epics/support/StreamDevice")
epicsEnvSet("DEVIOCSTATS","/opt/epics/support/iocStats")
epicsEnvSet("AUTOSAVE","/opt/epics/support/autosave")
epicsEnvSet("EPICS_BASE","/opt/epics/epics-base")
epicsEnvSet("STREAM_PROTOCOL_PATH",    "../../ftsiocApp/Db")
epicsEnvSet("PREFIX",                  "XF:16IDC-ES:LIX")
epicsEnvSet("FTS_IP",                  "10.16.2.195:49151 HTTP")
epicsEnvSet("PORT",                    "FTS")
## Register all support components
dbLoadDatabase("../../dbd/ftsioc.dbd",0,0)
ftsioc_registerRecordDeviceDriver(pdbbase)
drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP"
## Load record instances
dbLoadRecords("../../db/fts.db","P=XF:16IDC-
ES:LIX,R={FTS:2},PORT=FTS,user=oksana")
#asynSetTraceMask( "FTS",0,255)
asynSetTraceMask( "FTS",0,0)
iocInit()
Starting iocInit
##########################################################
##################
## EPICS R7.0.3.1
## EPICS Base built Dec  1 2020
##########################################################
##################
iocRun: All initialization complete
#asynSetTraceMask( "FTS",0,0)
## Start any sequence programs
#seq sncftsioc,"user=oksana"
epics> dbl

[oksana@xf16id-babyioc1 Db]$ more fts.proto Timeout=10000; Terminator =
"";

read{
    MaxInput = 16;
    out
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00%0.2
r\x00\x00";
    in "\x12\x34%(A)02r%(B)2r%(C)2r%(D)2r%(E)2r%(F)2r%(G)2r";
}

readCalibration {
    MaxInput = 24;
    out
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00
\x00\x00\x00";
    in
"\x12\x34%(A)01r%(B)01r%(C)04r%(D)04r%(E)02r%(F)02r%(G)02r%(H)02r%(I
)02r%(J)02r";
    disconnect;
    @init {
        out
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00
\x00\x00\x00";
        in
"\x12\x34%(A)01r%(B)01r%(C)04r%(D)04r%(E)02r%(F)02r%(G)02r%(H)02r%(I
)02r%(J)02r";
    }

}

[oksana@xf16id-babyioc1 Db]$


-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 3:48 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


Just to be clear, did you add HTTP to the drvAsynIPPortConfigure
command, and remove the "disconnect" commands from the protocol file?


Mark



________________________________
From: Ivashkevych, Oksana <[email protected]>
Sent: Wednesday, December 9, 2020 2:35 PM
To: Mark Rivers
Cc: [email protected]
Subject: RE: serial IOC connection problem

Hi Mark,
Thank you very much!
Not a single squeak!

I may suggest considering adding "164.54.17.43:5186 HTTP" to the list
of examples in the link you shared.

Thanks again,
Oksana

-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 2:15 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


It may be that this device wants to just do a single transaction per
connection.  That is how Web servers work.


drvAsynIPPort supports that mode of operation directly.
https://urldefense.com/v3/__https://epics-
modules.github.io/master/asyn/R4-
41/asynDriver.html*drvAsynIPPort__;Iw!!P4SdNyxKAPE!Sz1Tm08wfhCbs3_
mnZgFXMFrf7-JRdetWpdz-RbQ7TG0ozHVy-fgl3g3QhaCrw$


You need to change this line:


drvAsynIPPortConfigure("FTS", "10.16.2.195:49151")


to this:


drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP")


Once you do that I think you can remove the "disconnect" commands
from the protocol file.


If you still have trouble please turn on ASYN_TRACEIO_DRIVER for the
IP port and send the output.


Mark





________________________________
From: Tech-talk <[email protected]> on behalf of
Ivashkevych, Oksana via Tech-talk <[email protected]>
Sent: Wednesday, December 9, 2020 12:51 PM
To: [email protected]
Subject: serial IOC connection problem


Hello,

I have been asked to port an existing Serial IOC  for a Force Torque
Sensor from ATI from one server (Debian 7 with Debian packages dated
~ at least 5 years ago) to CentOS 7.



CentOS 7.7.1908; base R7.0.3.1; asyn R4-37; SerialDevice master.



After the ported recompiled IOC reported unrecoverable connection
error, I have created a brand new IOC using the latest
makeBaseApp.pl
script.



Errors became more dynamic, and I do see some readings, when IOC
does manage to connect successfully. I have browsed the Tech Talk
and found a related discussions about connecting/disconnecting.
Protocol file of this IOC does  connects/disconnects after every
read and is very simple. I only can guess why the developer made
this decision, I am sure it was an unavoidable compromise.  I did
add asynSetTraceMask call which changes temporarily the dynamic of
the errors.  Logs and proto
are attached.



In summary: I have two iocs accessing same device: the old one
running on Debian 7, and the new on running CentOS 7. The old one
works without problem the new on reports connection errors and does
manage to read something at the frequency ~30 times slower than 0.1
expected scan. I am out of my own ideas, and would appreciate help
from the
community.



Thank you,

Oksana



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

Message: 3
Date: Wed, 9 Dec 2020 21:46:30 +0000
From: "Manoussakis, Adamandios" <[email protected]>
To: EPICS tech-talk <[email protected]>
Subject: RE: Faster Scan Rates possible?
Message-ID:
    <BY5PR09MB502803976A7BC276AB6B083AF1CC0@BY5PR09MB5028.namprd09.prod.outlook.com">BY5PR09MB502803976A7BC276AB6B083AF1CC0@BY5PR09MB5028.namprd09.prod.outlook.com>

Content-Type: text/plain; charset="us-ascii"

Thanks Mark, I will look into the I/O intr support and how we might be able to implement it.

-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 9, 2020 1:43 PM
To: Manoussakis, Adamandios <[email protected]>
Subject: Re: Faster Scan Rates possible?

I have never changed the scan rates, so I am not sure about the priorities.


Note that increasing the periodic scan rates is not necessarily the best way to process records more quickly.  Another way is to have the device support or driver support SCAN=I/O Intr.  That is the approach that most drivers I have written use.


Mark



________________________________
From: Tech-talk <[email protected]> on behalf of Manoussakis, Adamandios via Tech-talk <[email protected]>
Sent: Wednesday, December 9, 2020 3:36 PM
To: EPICS tech-talk
Subject: RE: Faster Scan Rates possible?


Also mark just to make sure I understood Passive,Event,IO Intr are always at the top and do not have any priority assigned due to being event driven and then the next menuScans are from slowest to fastest which are assigned also lower to highest priority 10s being lowest priority and .1 second being highest priority assigned?



  menu(menuScan) {

      choice(menuScanPassive,"Passive")

      choice(menuScanEvent,"Event")

      choice(menuScanI_O_Intr,"I/O Intr")

      choice(menuScan10_second,"10 second")

      choice(menuScan5_second,"5 second")

      choice(menuScan2_second,"2 second")

      choice(menuScan1_second,"1 second")

      choice(menuScan_5_second,".5 second")

      choice(menuScan_2_second,".2 second")

      choice(menuScan_1_second,".1 second")

  }





From: Tech-talk <[email protected]> On Behalf Of Manoussakis, Adamandios via Tech-talk
Sent: Wednesday, December 9, 2020 1:33 PM
To: EPICS tech-talk <[email protected]>
Subject: RE: Faster Scan Rates possible?



Thanks Mark/Andrew for the insigh, is there any rule of thumb for how fast you can setup a SCAN rate in that dbd file for any current line of CPU (assuming more cores would help with threading and higher clock speeds).  Is it safe to say go to .01 .001 on current gen cpu hardware?



From: Johnson, Andrew N. <[email protected]<mailto:[email protected]>>
Sent: Wednesday, December 9, 2020 1:21 PM
To: Manoussakis, Adamandios <[email protected]<mailto:[email protected]>>
Cc: EPICS tech-talk <[email protected]<mailto:[email protected]>>
Subject: Re: Faster Scan Rates possible?



Hi,



On Dec 9, 2020, at 3:14 PM, Manoussakis, Adamandios via Tech-talk <[email protected]<mailto:[email protected]>> wrote:



I have been looking at older posts and have seen talk of increasing the scan rate from the default (I think) .1seconds but no definitive guide on how to?  On a standard linux distro without RT_PREEMPT, is it possible to push to say .01 or faster scan rates?  Also I wanted to know does camonitor only update as fast as the scan rate limit, .1seconds currently?



There is no internal connection between CA monitor rates and the DB scan rates, it very much depends on your CPU, your IOC application and the clients you have connected as to how fast you would be able to run a periodic scan thread that sends out monitors. Note that the IOC's CA server can and does throw away monitor updates if the clients can't keep up, so don't design your systems assuming that your clients will always get every monitor if you're running at high speeds.



HTH,



- Andrew



--

Complexity comes for free, simplicity you have to work for.




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

Message: 4
Date: Wed, 9 Dec 2020 21:51:27 +0000
From: Mark Rivers <[email protected]>
To: "Ivashkevych, Oksana" <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: Re: serial IOC connection problem
Message-ID: <[email protected]">[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Could you please elaborate on this, I did see connection errors  before implementing the fix you suggested, right?


Yes, you saw connection errors.  But in the serial_iocLog1.txt file you sent previously, which had the error messages, you had these lines just before iocInit:

#asynSetTraceMask( "FTS",0,255)
#asynSetTraceMask( "FTS",0,0)


So the line disabling the error messages was commented out.

Mark


________________________________
From: Ivashkevych, Oksana <[email protected]>
Sent: Wednesday, December 9, 2020 3:39 PM
To: Mark Rivers
Cc: [email protected]
Subject: RE: serial IOC connection problem

Hi Mark,
Thank you very much for being thorough and suspicious.
It still works without errors.
And I gladly express my happy wows one more time. :)
With this line present you won't even see error messages.

Could you please elaborate on this, I did see connection errors  before implementing the fix you suggested, right?
Oksana

[oksana@xf16id-babyioc1 ftsioc]$ ../../bin/linux-x86_64/ftsioc st.cmd
#!../../bin/linux-x86_64/ftsioc
< envPaths
epicsEnvSet("IOC","ftsioc")
epicsEnvSet("TOP","/home/oksana/ftsioc")
epicsEnvSet("SUPPORT","/opt/epics/support")
epicsEnvSet("ASYN","/opt/epics/support/asyn")
epicsEnvSet("CALC","/opt/epics/support/calc")
epicsEnvSet("STREAM","/opt/epics/support/StreamDevice")
epicsEnvSet("DEVIOCSTATS","/opt/epics/support/iocStats")
epicsEnvSet("AUTOSAVE","/opt/epics/support/autosave")
epicsEnvSet("EPICS_BASE","/opt/epics/epics-base")
epicsEnvSet("STREAM_PROTOCOL_PATH",    "../../ftsiocApp/Db")
epicsEnvSet("PREFIX",                  "XF:16IDC-ES:LIX")
epicsEnvSet("FTS_IP",                  "10.16.2.195:49151 HTTP")
epicsEnvSet("PORT",                    "FTS")
## Register all support components
dbLoadDatabase("../../dbd/ftsioc.dbd",0,0)
ftsioc_registerRecordDeviceDriver(pdbbase)
drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP")
## Load record instances
dbLoadRecords("../../db/fts.db","P=XF:16IDC-ES:LIX,R={FTS:2},PORT=FTS,user=oksana")
iocInit()
Starting iocInit
############################################################################
## EPICS R7.0.3.1
## EPICS Base built Dec  1 2020
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncftsioc,"user=oksana"
epics>



-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 3:57 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


 it looks like I forgot to remove asynSetTraceMask( "FTS",0,0).


Yes, you should comment out or remove this line.  With this line present you
won't even see error messages.


asynSetTraceMask( "FTS",0,0)

Mark

________________________________
From: Ivashkevych, Oksana <[email protected]>
Sent: Wednesday, December 9, 2020 2:53 PM
To: Mark Rivers
Cc: [email protected]
Subject: RE: serial IOC connection problem

Hi Mark,
Yes, this is exactly what I did , and it looks like I forgot to remove
asynSetTraceMask( "FTS",0,0).
Oksana

[oksana@xf16id-babyioc1 ftsioc]$ vim st.cmd
[oksana@xf16id-babyioc1 ftsioc]$ ../../bin/linux-x86_64/ftsioc st.cmd
#!../../bin/linux-x86_64/ftsioc < envPaths
epicsEnvSet("IOC","ftsioc")
epicsEnvSet("TOP","/home/oksana/ftsioc")
epicsEnvSet("SUPPORT","/opt/epics/support")
epicsEnvSet("ASYN","/opt/epics/support/asyn")
epicsEnvSet("CALC","/opt/epics/support/calc")
epicsEnvSet("STREAM","/opt/epics/support/StreamDevice")
epicsEnvSet("DEVIOCSTATS","/opt/epics/support/iocStats")
epicsEnvSet("AUTOSAVE","/opt/epics/support/autosave")
epicsEnvSet("EPICS_BASE","/opt/epics/epics-base")
epicsEnvSet("STREAM_PROTOCOL_PATH",    "../../ftsiocApp/Db")
epicsEnvSet("PREFIX",                  "XF:16IDC-ES:LIX")
epicsEnvSet("FTS_IP",                  "10.16.2.195:49151 HTTP")
epicsEnvSet("PORT",                    "FTS")
## Register all support components
dbLoadDatabase("../../dbd/ftsioc.dbd",0,0)
ftsioc_registerRecordDeviceDriver(pdbbase)
drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP"
## Load record instances
dbLoadRecords("../../db/fts.db","P=XF:16IDC-
ES:LIX,R={FTS:2},PORT=FTS,user=oksana")
#asynSetTraceMask( "FTS",0,255)
asynSetTraceMask( "FTS",0,0)
iocInit()
Starting iocInit
##########################################################
##################
## EPICS R7.0.3.1
## EPICS Base built Dec  1 2020
##########################################################
##################
iocRun: All initialization complete
#asynSetTraceMask( "FTS",0,0)
## Start any sequence programs
#seq sncftsioc,"user=oksana"
epics> dbl

[oksana@xf16id-babyioc1 Db]$ more fts.proto Timeout=10000; Terminator =
"";

read{
    MaxInput = 16;
    out
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00%0.2
r\x00\x00";
    in "\x12\x34%(A)02r%(B)2r%(C)2r%(D)2r%(E)2r%(F)2r%(G)2r";
}

readCalibration {
    MaxInput = 24;
    out
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00
\x00\x00\x00";
    in
"\x12\x34%(A)01r%(B)01r%(C)04r%(D)04r%(E)02r%(F)02r%(G)02r%(H)02r%(I
)02r%(J)02r";
    disconnect;
    @init {
        out
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00
\x00\x00\x00";
        in
"\x12\x34%(A)01r%(B)01r%(C)04r%(D)04r%(E)02r%(F)02r%(G)02r%(H)02r%(I
)02r%(J)02r";
    }

}

[oksana@xf16id-babyioc1 Db]$


-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 3:48 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


Just to be clear, did you add HTTP to the drvAsynIPPortConfigure
command, and remove the "disconnect" commands from the protocol file?


Mark



________________________________
From: Ivashkevych, Oksana <[email protected]>
Sent: Wednesday, December 9, 2020 2:35 PM
To: Mark Rivers
Cc: [email protected]
Subject: RE: serial IOC connection problem

Hi Mark,
Thank you very much!
Not a single squeak!

I may suggest considering adding "164.54.17.43:5186 HTTP" to the list
of examples in the link you shared.

Thanks again,
Oksana

-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 2:15 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


It may be that this device wants to just do a single transaction per
connection.  That is how Web servers work.


drvAsynIPPort supports that mode of operation directly.
https://urldefense.com/v3/__https://epics-
modules.github.io/master/asyn/R4-
41/asynDriver.html*drvAsynIPPort__;Iw!!P4SdNyxKAPE!Sz1Tm08wfhCbs3_
mnZgFXMFrf7-JRdetWpdz-RbQ7TG0ozHVy-fgl3g3QhaCrw$


You need to change this line:


drvAsynIPPortConfigure("FTS", "10.16.2.195:49151")


to this:


drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP")


Once you do that I think you can remove the "disconnect" commands
from the protocol file.


If you still have trouble please turn on ASYN_TRACEIO_DRIVER for the
IP port and send the output.


Mark





________________________________
From: Tech-talk <[email protected]> on behalf of
Ivashkevych, Oksana via Tech-talk <[email protected]>
Sent: Wednesday, December 9, 2020 12:51 PM
To: [email protected]
Subject: serial IOC connection problem


Hello,

I have been asked to port an existing Serial IOC  for a Force Torque
Sensor from ATI from one server (Debian 7 with Debian packages dated
~ at least 5 years ago) to CentOS 7.



CentOS 7.7.1908; base R7.0.3.1; asyn R4-37; SerialDevice master.



After the ported recompiled IOC reported unrecoverable connection
error, I have created a brand new IOC using the latest
makeBaseApp.pl
script.



Errors became more dynamic, and I do see some readings, when IOC
does manage to connect successfully. I have browsed the Tech Talk
and found a related discussions about connecting/disconnecting.
Protocol file of this IOC does  connects/disconnects after every
read and is very simple. I only can guess why the developer made
this decision, I am sure it was an unavoidable compromise.  I did
add asynSetTraceMask call which changes temporarily the dynamic of
the errors.  Logs and proto
are attached.



In summary: I have two iocs accessing same device: the old one
running on Debian 7, and the new on running CentOS 7. The old one
works without problem the new on reports connection errors and does
manage to read something at the frequency ~30 times slower than 0.1
expected scan. I am out of my own ideas, and would appreciate help
from the
community.



Thank you,

Oksana



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

Message: 5
Date: Wed, 9 Dec 2020 22:07:52 +0000
From: "Ivashkevych, Oksana" <[email protected]>
To: Mark Rivers <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: RE: serial IOC connection problem
Message-ID:
    <BLAPR09MB73619611A9C472DA8D8752D9D3CC0@BLAPR09MB7361.namprd09.prod.outlook.com">BLAPR09MB73619611A9C472DA8D8752D9D3CC0@BLAPR09MB7361.namprd09.prod.outlook.com>

Content-Type: text/plain; charset="us-ascii"

Hi Mark,
I am very sorry to sound petty, but I did have this line uncommented in the file I have shared.  Run #3 at the end.
In this file I ran ioc 3 times:
1. with #asynSetTraceMask( "FTS",0,0) and had bunch of connection errors.
2. with asynSetTraceMask( "FTS",0,0) and had protocol errors reported (something new)
3. Third time without changing anything with errors like in 1.  It was very confusing. Same IOC reporting different errors.  May be it gets enabled back by other means somehow...

I did have a bunch of  #asynSetTraceMask  with different parameters commented before and after iocInit() as the leftovers of my struggles to understand what is going on.
Thank you,
Oksana



-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 4:51 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Could you please elaborate on this, I did see connection errors  before
implementing the fix you suggested, right?


Yes, you saw connection errors.  But in the serial_iocLog1.txt file you sent
previously, which had the error messages, you had these lines just before
iocInit:

#asynSetTraceMask( "FTS",0,255)
#asynSetTraceMask( "FTS",0,0)


So the line disabling the error messages was commented out.

Mark


________________________________
From: Ivashkevych, Oksana <[email protected]>
Sent: Wednesday, December 9, 2020 3:39 PM
To: Mark Rivers
Cc: [email protected]
Subject: RE: serial IOC connection problem

Hi Mark,
Thank you very much for being thorough and suspicious.
It still works without errors.
And I gladly express my happy wows one more time. :)
With this line present you won't even see error messages.

Could you please elaborate on this, I did see connection errors  before
implementing the fix you suggested, right?
Oksana

[oksana@xf16id-babyioc1 ftsioc]$ ../../bin/linux-x86_64/ftsioc st.cmd
#!../../bin/linux-x86_64/ftsioc < envPaths
epicsEnvSet("IOC","ftsioc")
epicsEnvSet("TOP","/home/oksana/ftsioc")
epicsEnvSet("SUPPORT","/opt/epics/support")
epicsEnvSet("ASYN","/opt/epics/support/asyn")
epicsEnvSet("CALC","/opt/epics/support/calc")
epicsEnvSet("STREAM","/opt/epics/support/StreamDevice")
epicsEnvSet("DEVIOCSTATS","/opt/epics/support/iocStats")
epicsEnvSet("AUTOSAVE","/opt/epics/support/autosave")
epicsEnvSet("EPICS_BASE","/opt/epics/epics-base")
epicsEnvSet("STREAM_PROTOCOL_PATH",    "../../ftsiocApp/Db")
epicsEnvSet("PREFIX",                  "XF:16IDC-ES:LIX")
epicsEnvSet("FTS_IP",                  "10.16.2.195:49151 HTTP")
epicsEnvSet("PORT",                    "FTS")
## Register all support components
dbLoadDatabase("../../dbd/ftsioc.dbd",0,0)
ftsioc_registerRecordDeviceDriver(pdbbase)
drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP") ## Load record
instances
dbLoadRecords("../../db/fts.db","P=XF:16IDC-
ES:LIX,R={FTS:2},PORT=FTS,user=oksana")
iocInit()
Starting iocInit
##########################################################
##################
## EPICS R7.0.3.1
## EPICS Base built Dec  1 2020
##########################################################
##################
iocRun: All initialization complete
## Start any sequence programs
#seq sncftsioc,"user=oksana"
epics>



-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 3:57 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


 it looks like I forgot to remove asynSetTraceMask( "FTS",0,0).


Yes, you should comment out or remove this line.  With this line
present you won't even see error messages.


asynSetTraceMask( "FTS",0,0)

Mark

________________________________
From: Ivashkevych, Oksana <[email protected]>
Sent: Wednesday, December 9, 2020 2:53 PM
To: Mark Rivers
Cc: [email protected]
Subject: RE: serial IOC connection problem

Hi Mark,
Yes, this is exactly what I did , and it looks like I forgot to remove
asynSetTraceMask( "FTS",0,0).
Oksana

[oksana@xf16id-babyioc1 ftsioc]$ vim st.cmd
[oksana@xf16id-babyioc1 ftsioc]$ ../../bin/linux-x86_64/ftsioc st.cmd
#!../../bin/linux-x86_64/ftsioc < envPaths
epicsEnvSet("IOC","ftsioc")
epicsEnvSet("TOP","/home/oksana/ftsioc")
epicsEnvSet("SUPPORT","/opt/epics/support")
epicsEnvSet("ASYN","/opt/epics/support/asyn")
epicsEnvSet("CALC","/opt/epics/support/calc")
epicsEnvSet("STREAM","/opt/epics/support/StreamDevice")
epicsEnvSet("DEVIOCSTATS","/opt/epics/support/iocStats")
epicsEnvSet("AUTOSAVE","/opt/epics/support/autosave")
epicsEnvSet("EPICS_BASE","/opt/epics/epics-base")
epicsEnvSet("STREAM_PROTOCOL_PATH",    "../../ftsiocApp/Db")
epicsEnvSet("PREFIX",                  "XF:16IDC-ES:LIX")
epicsEnvSet("FTS_IP",                  "10.16.2.195:49151 HTTP")
epicsEnvSet("PORT",                    "FTS")
## Register all support components
dbLoadDatabase("../../dbd/ftsioc.dbd",0,0)
ftsioc_registerRecordDeviceDriver(pdbbase)
drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP"
## Load record instances
dbLoadRecords("../../db/fts.db","P=XF:16IDC-
ES:LIX,R={FTS:2},PORT=FTS,user=oksana")
#asynSetTraceMask( "FTS",0,255)
asynSetTraceMask( "FTS",0,0)
iocInit()
Starting iocInit
##########################################################
##################
## EPICS R7.0.3.1
## EPICS Base built Dec  1 2020
##########################################################
##################
iocRun: All initialization complete
#asynSetTraceMask( "FTS",0,0)
## Start any sequence programs
#seq sncftsioc,"user=oksana"
epics> dbl

[oksana@xf16id-babyioc1 Db]$ more fts.proto Timeout=10000; Terminator
= "";

read{
    MaxInput = 16;
    out
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00%0.2
r\x00\x00";
    in "\x12\x34%(A)02r%(B)2r%(C)2r%(D)2r%(E)2r%(F)2r%(G)2r";
}

readCalibration {
    MaxInput = 24;
    out
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00
\x00\x00\x00";
    in
"\x12\x34%(A)01r%(B)01r%(C)04r%(D)04r%(E)02r%(F)02r%(G)02r%(H)02r%(I
)02r%(J)02r";
    disconnect;
    @init {
        out
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00
\x00\x00\x00";
        in
"\x12\x34%(A)01r%(B)01r%(C)04r%(D)04r%(E)02r%(F)02r%(G)02r%(H)02r%(I
)02r%(J)02r";
    }

}

[oksana@xf16id-babyioc1 Db]$


-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 3:48 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


Just to be clear, did you add HTTP to the drvAsynIPPortConfigure
command, and remove the "disconnect" commands from the protocol
file?


Mark



________________________________
From: Ivashkevych, Oksana <[email protected]>
Sent: Wednesday, December 9, 2020 2:35 PM
To: Mark Rivers
Cc: [email protected]
Subject: RE: serial IOC connection problem

Hi Mark,
Thank you very much!
Not a single squeak!

I may suggest considering adding "164.54.17.43:5186 HTTP" to the
list of examples in the link you shared.

Thanks again,
Oksana

-----Original Message-----
From: Mark Rivers <[email protected]>
Sent: Wednesday, December 09, 2020 2:15 PM
To: Ivashkevych, Oksana <[email protected]>
Cc: [email protected]
Subject: Re: serial IOC connection problem

Hi Oksana,


It may be that this device wants to just do a single transaction
per connection.  That is how Web servers work.


drvAsynIPPort supports that mode of operation directly.
https://urldefense.com/v3/__https://epics-
modules.github.io/master/asyn/R4-
41/asynDriver.html*drvAsynIPPort__;Iw!!P4SdNyxKAPE!Sz1Tm08wfhCbs3_
mnZgFXMFrf7-JRdetWpdz-RbQ7TG0ozHVy-fgl3g3QhaCrw$


You need to change this line:


drvAsynIPPortConfigure("FTS", "10.16.2.195:49151")


to this:


drvAsynIPPortConfigure("FTS", "10.16.2.195:49151 HTTP")


Once you do that I think you can remove the "disconnect" commands
from the protocol file.


If you still have trouble please turn on ASYN_TRACEIO_DRIVER for
the IP port and send the output.


Mark





________________________________
From: Tech-talk <[email protected]> on behalf of
Ivashkevych, Oksana via Tech-talk <[email protected]>
Sent: Wednesday, December 9, 2020 12:51 PM
To: [email protected]
Subject: serial IOC connection problem


Hello,

I have been asked to port an existing Serial IOC  for a Force
Torque Sensor from ATI from one server (Debian 7 with Debian
packages dated ~ at least 5 years ago) to CentOS 7.



CentOS 7.7.1908; base R7.0.3.1; asyn R4-37; SerialDevice master.



After the ported recompiled IOC reported unrecoverable connection
error, I have created a brand new IOC using the latest
makeBaseApp.pl
script.



Errors became more dynamic, and I do see some readings, when IOC
does manage to connect successfully. I have browsed the Tech Talk
and found a related discussions about connecting/disconnecting.
Protocol file of this IOC does  connects/disconnects after every
read and is very simple. I only can guess why the developer made
this decision, I am sure it was an unavoidable compromise.  I did
add asynSetTraceMask call which changes temporarily the dynamic of
the errors.  Logs and proto
are attached.



In summary: I have two iocs accessing same device: the old one
running on Debian 7, and the new on running CentOS 7. The old one
works without problem the new on reports connection errors and
does manage to read something at the frequency ~30 times slower
than 0.1 expected scan. I am out of my own ideas, and would
appreciate help from the
community.



Thank you,

Oksana



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

Subject: Digest Footer

_______________________________________________
Tech-talk mailing list [email protected]
https://mailman.aps.anl.gov/mailman/listinfo/tech-talk


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

End of Tech-talk Digest, Vol 14, Issue 640
******************************************



Navigate by Date:
Prev: Re: serial IOC connection problem Mark Rivers via Tech-talk
Next: Interpreting pvget -d Shankar, Murali via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  2025  2026 
Navigate by Thread:
Prev: Re: Faster Scan Rates possible? Arnold, Ned D. via Tech-talk
Next: Interpreting pvget -d Shankar, Murali via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  2025  2026 
ANJ, 19 Mar 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·