EPICS Home

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  2021  2022  2023  2024  <2025 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  2021  2022  2023  2024  <2025
<== Date ==> <== Thread ==>

Subject: RE: Update IOC with pushed data
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "Kasemir, Kay" <kasemirk at ornl.gov>, Dave Bracey <dbracey at fnal.gov>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 10 Jun 2025 17:10:41 +0000

 

The standard device support in the asyn module also supports SCAN=I/O Intr.  If you have a driver based on asyn then it can cause records with SCAN=I/O Intr to process when there is new data.

 

https://github.com/epics-modules/asyn

https://epics-modules.github.io/asyn/asynDriver.html#asynmanager-interrupts-and-epics-device-support

 

This is the code in an asyn driver that sets the values and does the callbacks that force SCAN=I/O Intr records to process:

https://github.com/epics-modules/asyn/blob/413a3b834b3b3cfd01b1098a023fb01fd9396a59/testAsynPortDriverApp/src/testAsynPortDriver.cpp#L226

 

This is the definition of an ai record that will process with SCAN=I/O Intr when that driver code executes.

https://github.com/epics-modules/asyn/blob/413a3b834b3b3cfd01b1098a023fb01fd9396a59/testAsynPortDriverApp/Db/testAsynPortDriver.db#L255

 

Mark

 

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Kasemir, Kay via Tech-talk
Sent: Tuesday, June 10, 2025 11:08 AM
To: Dave Bracey <dbracey at fnal.gov>; tech-talk at aps.anl.gov
Subject: Re: Update IOC with pushed data

 

 

We would like data to travel through an IOC with as little latency as possible. Can I use Event Scanning rather than Periodic to achieve this? At one point I tried having a data source use a User-Defined Event to trigger record processing, but

> We would like data to travel through an IOC with as little latency as possible.  Can I use Event Scanning rather than Periodic to achieve this? 

 

Yes, event or I/O Interrupt scanning would be the way to minimize latency.

 

> At one point I tried having a data source use a User-Defined Event to trigger record processing, but I didn’t get it working at that time.

 

Should be easy to test:

# File test.db

record(ai, "test")

{

   field(SCAN, "Event")

   field(EVNT, "42")

   field(TPRO, "1")

}

 

Run `softIocPVX -d test.db`.

In the IOC shell, type `postEvent 42` and you’ll see a log message that the record was processed.

 

The trick would then be to get that event generated without you having to type “postEvent 42” all the time.

If you have a timing system, it might emit events. Or you might be able to use the “event” record to generate the event, and the processing of the event record in turn may be triggered by your timing system.

 

> I’m assuming this is the idea behind I/O Interrupt Event triggering – the record is triggered to process on new I/O, and the Device or Driver handler reads the data from the data source.

 

With I/O interrupt, you don’t have to pick an event ID like the 42 in the above example and then worry about posting that event.

Device support modules that support I/O scanning allow you to basically say this:

 

record(ai, “test”)

{

   field(DTYP, “SomeDeviceSupport”)

   field(INP, “Something that makes sense to SomeDeviceSupport”)

   field(SCAN, “I/O Intr”)

 

… and now SomeDeviceSupport will read from your hardware and magically process the record whenever there’s a new value.

For an example, see stream device, which can read data via network or serial connection and then process your record whenever it receives a new value,

https://paulscherrerinstitute.github.io/StreamDevice/processing.html#iointr

 

 

 


References:
Update IOC with pushed data Dave Bracey via Tech-talk
Re: Update IOC with pushed data Kasemir, Kay via Tech-talk

Navigate by Date:
Prev: Re: Retiga E7 and ADKinetix Wlodek, Jakub via Tech-talk
Next: Re: PVXS programmatically create pvalinks Michael Davidsaver 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  2021  2022  2023  2024  <2025
Navigate by Thread:
Prev: Re: Update IOC with pushed data Kasemir, Kay via Tech-talk
Next: Re: Update IOC with pushed data Michael Davidsaver 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  2021  2022  2023  2024  <2025