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  <20162017  2018  2019  2020  2021  2022  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  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: std support countdown timer trigger PV and calcout record question
From: Alireza Panna <[email protected]>
To: "[email protected]" <[email protected]>
Date: Thu, 11 Feb 2016 20:37:09 -0500
Hello tech talkers,

1. I am trying to add the following functionality in my stream device x-ray apps:
Basically I want to kill the x-ray flux based on a timer (an auto shut off timer) if the x-ray is continuously firing upto the set time. I want to give the end user, the ability to set this time.

Currently the way I do this is using a sequencer code (see attached file), But I think it is better to use the countdownTimer records provided in stdApp. So I decided to test it out. The problem I encountered is that when I set the trigger PV  to the xray on/off record ($(P):ON), at the end of the countdown, the xray does not turn on or off. So as another test I tried to trigger the sim detector acquire PV (from area detector) using the countdownTimer records, and this worked. Looking at the record types, I see that the acquire PV for sim detector is a busy record. Now when I change the xray on/off to a busy record instead of bo, I get this error:

dbLoadRecords("db/devsri.db","P=VPFI:SRI:xray,PORT=L0,A=0")
Can't set "VPFI:SRI:xray:ON.DTYP" to "stream"
Error at or before ")" in file "db/devsri.db" line 4

Here's the relevant record:
record(busy, "$(P):ON") 
 {
    field(DESC, "X-ray on")
    field(DTYP, "stream")
    field(VAL, "0")
    field(ZNAM, "OFF")
    field(ONAM, "ON")
    field(OUT , "@devsri.proto setXR L0")
 }
(The record works fine when i set the type to bo)
So how do I get the countdownTimer to shut off the xray?

By the way I am fairly new to snl coding so any comments are much appreciated.

2. I have the following records in my records instance file (.db), Basically I get the kVp and power from the device and use it to calculate the tube current. Now when both the kVp and power rbv's are 0 (so 0/0), I would like to show the current as 0 (or NAN) to the end user. How do I do this in the database file. 
record(ai, "$(P):KVP_RBV")
{
    field(DESC, "Get peak kilovolt")
    field(DTYP, "stream")
    field(INP, "@devoxford.proto get_val(VM) $(PORT) $(A)")
  field(EGU, "kVp")
    field(PREC, "0")
    field(SCAN, ".1 second")
    field(FLNK, "$(P):CALC_UA")
}

record(ai, "$(P):WATT_RBV")
{
    field(DESC, "Get tube power")
    field(DTYP, "stream")
    field(INP, "@devoxford.proto get_val(WM) $(PORT) $(A)")
  field(EGU, "W")
    field(PREC, "0")
    field(SCAN, ".1 second")
    field(FLNK, "$(P):CALC_UA")
}

record(calcout, "$(P):CALC_UA") 
{
  field (INPA,"$(P):KVP_RBV")
  field (INPB,"$(P):WATT_RBV")
  field (CALC, "B*1*10**(3)/A")
  field (OUT, "$(P):UA_RBV.VAL")
  field (OOPT,"Every Time")

record(longin, "$(P):UA_RBV")
{
  field (DESC, "Get Tube Current")
  field (DTYP, "Soft Channel")
  field (INP, "$(P):CALC_UA.VAL")
  field (EGU, "UA")
  field (SCAN, ".1 second")
}

Thank you

Best,
Ali

Attachment: sri.st
Description: Binary data


Replies:
RE: std support countdown timer trigger PV and calcout record question Mooney, Tim M.

Navigate by Date:
Prev: Re: Re. installation of EPICS for beam position measurement using Raspberrypi Keith Parker
Next: RE: std support countdown timer trigger PV and calcout record question Mooney, Tim M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Modbus R2-8 available Mark Rivers
Next: RE: std support countdown timer trigger PV and calcout record question Mooney, Tim M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·