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  2020  <20212022  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  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Utilizing StreamDevice in conjunction with sockets
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "Wang, Andrew" <wang126 at llnl.gov>
Cc: "Pogge, James Robert" <pogge1 at llnl.gov>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 17 May 2021 21:24:04 +0000

Hi Andrew,

 

> There is one command that I need to send to the instrument occasionally that has a length of around 2000000 chars. 

> Based upon my observations, it takes about 20-30 seconds to send that command through a waveform record and receive a response back through StreamDevice. 

 

We need more information.

 

What is the network interface speed on the device (100 MBit/s, 1 GBit/s, etc.).

 

What is the asyn command you are using to create the asyn port?

 

What does the definition of that waveform record in your database file?

 

What is the Stream protocol you are using to send the waveform record data?

 

> I was wondering if anybody has experienced similar behavior with StreamDevice for very long commands and how to potentially speed it up. 

 

I have used large waveforms with Stream on a few occasions, and I have not seen that Stream was slowing things down.

 

> Should I investigate utilizing asyn or some other drivers, and if so, can it be run in conjunction with StreamDevice? 

 

If you are using Stream then you must already be using asyn as the underlying IP driver. 

 

You should turn on asynTrace to look at the communications with the device, which will include timestamps.

 

asynSetTraceIOMask myPort 0 HEX

asynSetTraceMask myPort 0 DRIVER|ERROR

 

You could easily write a little asyn port driver on top of that driver to send the data.  But that is basically what Stream does, so it is surprising that it is slower than a C socket program. 

 

If the above suggestions don’t offer a hint then you can run the IOC in a profiler like “perf” and see where it is spending its time.

 

Mark

 

 

 

 


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, May 17, 2021 1:38 PM
To: EPICS tech-talk
Cc: Pogge, James Robert
Subject: Utilizing StreamDevice in conjunction with sockets

 

All,

 

I’ve been using StreamDevice to interface EPICS with some of our instruments and I’ve noticed something interesting for quite some time now. There is one command that I need to send to the instrument occasionally that has a length of around 2000000 chars. Based upon my observations, it takes about 20-30 seconds to send that command through a waveform record and receive a response back through StreamDevice. However, when I use sockets in my C program, it takes about 3-5 seconds.

 

Originally, what I wanted to do was somehow utilize sockets for just that command, while using StreamDevice for the rest of the commands. However, it doesn’t seem to work out since once StreamDevice starts running, I am unable to use sockets in my asub record.

 

I was wondering if anybody has experienced similar behavior with StreamDevice for very long commands and how to potentially speed it up. Should I investigate utilizing asyn or some other drivers, and if so, can it be run in conjunction with StreamDevice? Ideally, it would be nice if I don’t have to migrate from StreamDevice since all the other commands work just fine.

 

Thanks.

Andy

 


Replies:
RE: Utilizing StreamDevice in conjunction with sockets Wang, Andrew via Tech-talk
References:
Utilizing StreamDevice in conjunction with sockets Wang, Andrew via Tech-talk

Navigate by Date:
Prev: Referencing PV values in commands from Action Buttons in CS-Studio. Li, Ji via Tech-talk
Next: RE: Utilizing StreamDevice in conjunction with sockets Wang, Andrew 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  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Utilizing StreamDevice in conjunction with sockets Wang, Andrew via Tech-talk
Next: RE: Utilizing StreamDevice in conjunction with sockets Wang, Andrew 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  2020  <20212022  2023  2024 
ANJ, 17 May 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·