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  <20242025  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  <20242025 
<== Date ==> <== Thread ==>

Subject: trouble using event record to control bo record
From: "Saunders, Wyatt via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 22 Aug 2024 18:48:37 +0000
Hi I am a student working at Edwards Accelerator lab and I am trying to toggle a relay on and off. I am using the EPICS IOC (7.0) and I am interfacing with it using CS-Studio to control an Agilent technologies 34980A. I am really new to EPICS and Controls systems using databases.

Goal: I want to use a toggle button in CS-Studio. All CS-Studio does is write a 1 or 0 to a PV when the toggle button is toggled on or off so it is not the focus of the problem

Current working system: Currently I can get the relay to toggle with two buttons that have passive bo records. All the buttons do is call a caput command that puts 1 in VAL of the record. The record is processed, correct me if in wrong, because with SCAN set to passive any event that updates VAL will make the record do its process. My code is below.

record(bo, "$(P)$(R)relay1off"){
  field(DESC, "set parameter relay1")
  field(DTYP, "stream")
  field(SCAN, "Passive")
  field(OUT, "@devKS_34980A_EPICS.proto setRouteOpen(5001) $(PORT) $(A)")
  field(PINI, "YES")

}

record(bo, "$(P)$(R)relay1on"){
  field(DESC, "set parameter for relay1")
  field(DTYP, "stream")
  field(SCAN, "Passive")
  field(OUT, "@devKS_34980A_EPICS.proto setRouteClose(5001) $(PORT) $(A)")
  field(PINI, "YES")

}

Question/problem with event record: The question is how to a make a controlling record that can conditionally call the on or off record based upon the VAL of that controlling record. 

      My guess would be using the event record like I had written below. I think it's supposed to work in the following way. When the VAL of the event record is set by CS-Studio it should cause the record to cause an event with VAL as the event number 0 or 1. With both records that control the relay with scan field set to event this should cause them to process toggling the relay. This did not work for me. I am unsure why and I didn't encounter any error messages. I am open to suggestions on how to accomplish this goal in different ways or let me know if I just missed something in my code that needs fixed. Thanks! 

record(bo, "$(P)$(R)relay1off"){
  field(DESC, "set parameter relay1")
  field(DTYP, "stream")

#  field(SCAN, "Passive")

  field(SCAN, "Event")
  field(EVNT, 0)

  field(OUT, "@devKS_34980A_EPICS.proto setRouteOpen(5001) $(PORT) $(A)")
  field(PINI, "YES")

}

record(bo, "$(P)$(R)relay1on"){
  field(DESC, "set parameter for relay1")
  field(DTYP, "stream")

#  field(SCAN, "Passive")

  field(SCAN, "Event")
  field(EVNT, 1)

  field(OUT, "@devKS_34980A_EPICS.proto setRouteClose(5001) $(PORT) $(A)")
  field(PINI, "YES")

}

record(event, "$(P)$(R)toggleRelay"){
  field(SCAN, "Passive")
  field(PINI, "YES")
}


Replies:
Re: [EXTERNAL] trouble using event record to control bo record Hartman, Steven via Tech-talk

Navigate by Date:
Prev: RE: How to use CSS script? Zhang, Tong via Tech-talk
Next: Re: [EXTERNAL] trouble using event record to control bo record Hartman, Steven 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  <20242025 
Navigate by Thread:
Prev: Re: measComp E-TC alarm IOC init error 106 Mark Rivers via Tech-talk
Next: Re: [EXTERNAL] trouble using event record to control bo record Hartman, Steven 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  <20242025 
ANJ, 11 Sep 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·