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

Subject: Re: BO which should switch to 1 whenever processed
From: "Hu, Yong via Tech-talk" <tech-talk at aps.anl.gov>
To: "Pearson, Matthew" <pearsonmr at ornl.gov>, Majer Karel <Karel.Majer at eli-beams.eu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 29 Apr 2026 13:17:00 +0000
This is an interesting subtle hiccup. 

Intuitively, I am on Karel’s side: MoveToPos would be 1 then 0 whenever it gets processed. I used Karel’s “MoveToPos” with typo fixing and asked a few LLMs (Gemini, Claude, ChatGPT, etc.):
I have a 'bo' record like this:
record(bo, "MoveToPos") {
    field(DOL,  "1")
    field(OMSL, "closed_loop")
    field(HIGH, "1")
}
What will the output of 'camonitor -n MoveToPos' look like if I perform the steps below? 
caput MoveToPos.PROC 1
Wait for more than 2 seconds
caput MoveToPos.PROC 0
Wait for more than 2 seconds
caput MoveToPos.PROC 1

All of them provide wrong predictions. This is by Gemini:
image.png

So, on behalf of human intelligence, Matt has beaten AI. Congrats, Matt!

Cheers,
Yong

From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Pearson, Matthew via Tech-talk <tech-talk at aps.anl.gov>
Date: Thursday, April 23, 2026 at 10:03 AM

Hi,


You may have to have that extra record, although there’s usually a few ways of doing this.

 

In the bo record documentation it says:

 

If closed_loop is specified, the VAL field’s value is obtained from the address specified in the Desired Output Link (DOL) field which can be a database link or a channel access link, but not a constant.

 

The HIGH field function will set VAL back to 0, so after the first processing you’re writing 0 each time instead of 1, unless you have that second record writing a new 1 each time.

 

It might make it easier to digest by renaming the record ‘Go’ (or similar), instead of ‘Constant’, and use another bo instead of longout, like:

 

record(bo, “Go”) {

  field(VAL, “1”)

  field(OUT, “MoveToPos PP”)

}

record(bo, “MoveToPos”) {

  field(OUT, “$(MOVE_OUTLINK) PP”)

  field(HIGH, “1”)

}

 

Or, you could incorporate a seq record to write the position and trigger the move:

 

record(seq, “MoveToPos”) {

  field(DLY0, “0”)

  field(DOL0, “SelectAbsPos”)

  field(LNK0, “$(POS_OUTLINK) PP”)

  field(DLY1, “0”)

  field(DOL1, “1”)

  field(LNK1, “$(MOVE_OUTLINK) PP”)

  field(DLY2, “1”)

  field(DOL2, “0”)

  field(LNK2, “$(MOVE_OUTLINK) PP”)

}

 

Also, this FLNK line:

field(FLNK, "MoveToPos PP")

doesn’t need the PP link attribute.

 

Cheers,

Matt

 

 

record(longout, "Constant1") {

    field(VAL,  "1")

    field(OUT,  "MoveToPos PP")

}

 

record(bo, "MoveToPos") {

    field(HIGH, "1")

}

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Majer Karel via Tech-talk
Sent: Thursday, April 23, 2026 3:45 AM
To: tech-talk at aps.anl.gov
Subject: [EXTERNAL] BO which should switch to 1 whenever processed

 

Hello, I would like to have a BO record which sets its value to 1 whenever processed (without necessarily writing 1 to VAL), then back to 0. It's part of PLC-based motion control IOC. The database should allow moving the motor to saved waypoint

Hello,

 

I would like to have a BO record which sets its value to 1 whenever processed (without necessarily writing 1 to VAL), then back to 0.

It's part of PLC-based motion control IOC. The database should allow moving the motor to saved waypoint positions; it looks like this:

 

record(ao, "AbsPos") {

    field(EGU,  "step")

}

 

record(ao, "Waypoint1") {

    field(EGU,  "step")

}

 

record(longout, "WaypointIdx") {

    field(FLNK, "SelectAbsPos")

}

 

record(sel, "SelectAbsPos") {

    field(SELM, "Specified")

    field(NVL,  "WaypointIdx")

    field(INPA, "AbsPos")

    field(INPB, "Waypoint1")

    field(FLNK, "DesiredPos")

}

 

record(ao, "DesiredPos") {

    field(EGU,  "step")

    # field(OUT,  "OUTLINK")  link to PLC

    field(DOL,  "SelectAbsPos")

    field(OMSL, "closed_loop")

    field(FLNK, "MoveToPos PP")

}

 

The processing chain is WaypointIdx -> SelectAbsPos -> DesiredPos -> MoveToPos

MoveToPos is a BO which tells the PLC to start motion, and it must have HIGH field set to non-zero. I'm having a problem triggering its processing in a way that its value becomes 1.

I tried this:

 

Record(bo, "MoveToPos) {

    # field(OUT,  "OUTLINK")  link to PLC

    field(DOL,  "1")

    field(OMSL, "closed_loop")

    field(HIGH, "1)

}

 

I expected that processing the record would set VAL to 1, then back to 0 after 1 second. It works only once; subsequent processing does not switch value back to 1. Writing 1 into VAL works as expected. Is this the correct functionality of the BO record?

 

I ended up with the following construct, which provides the desired functionality, but I don't much like having a record which only holds a constant value to be put into the BO. Is there a better way to do this?

 

record(ao, "DesiredPos") {

    field(EGU,  "step")

    # field(OUT,  "OUTLINK")

    field(DOL,  "SelectAbsPos")

    field(OMSL, "closed_loop")

    field(FLNK, "Constant1")

}

 

record(longout, "Constant1") {

    field(VAL,  "1")

    field(OUT,  "MoveToPos PP")

}

 

record(bo, "MoveToPos") {

    field(HIGH, "1")

}

 

Thanks,

 

Karel

 

Karel Majer | Senior software developer
Phone: +420 266 051 514
E-mail:
karel.majer at eli-beams.eu

ELI Beamlines Facility|The Extreme Light Infrastructure ERIC
Za Radnicí 835, 252 41 Dolní Břežany, The Czech Republic
www.eli-beams.eu 

 


References:
BO which should switch to 1 whenever processed Majer Karel via Tech-talk
RE: BO which should switch to 1 whenever processed Pearson, Matthew via Tech-talk

Navigate by Date:
Prev: Re: Building latest StreamDevice Zimoch, Dirk via Tech-talk
Next: Understanding alarms, alarm server and notification usage in other facilities Érico Nogueira Rolim 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  <2026
Navigate by Thread:
Prev: Re: BO which should switch to 1 whenever processed Ralph Lange via Tech-talk
Next: PVmapper - another EPICS nameserver Vodopivec, Klemen 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  <2026
ANJ, 30 Apr 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·