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: [EXTERNAL] trouble using event record to control bo record |
From: | "Hartman, Steven via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "Saunders, Wyatt" <ws275820 at ohio.edu> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Thu, 22 Aug 2024 20:03:04 +0000 |
Hi Wyatt—
If your relay1off and relay1on records are controlling the hardware output, then you are mostly there.
However, the event record is not needed. The event record is typically used to trigger a number of records to process when some software event occurs. You should be able to do what you need with just one record, not three.
A single bo record can be configured to write the “off” string to the hardware when it goes to zero and write the “on” string to the hardware when it goes to one.
First, try this simple test (no hardware required) . . .
record(bo,”$(P)(R)relay1") { field(SCAN,"Passive") field(PINI,"YES") field(ZNAM,"Off") field(ONAM,"On") } In CS-Studio, use a “Choice Button” controller widget with the PV “$(P)(R)relay1". You should be able to toggle the button to switch between the two states, and see the record go from “Off” (0) to “On” (1).
If that works, go back to your streams protocol file and modify it so that the output string depends on the value of the bo record. You want it to send the “off" command when the record is zero and the “on" command when the record is one. Now change the
relay1 record to use DTYP “stream” again, and point the OUT field to the new entry in your protocol file.
Good luck and welcome to EPICS,
--
Steven Hartman hartmansm at ornl.gov
|