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

Subject: RE: Question about build calc module to use scalcout record
From: Mark Rivers <rivers@cars.uchicago.edu>
To: lzf neu <lzfneu@live.com>, "Mooney, Tim M." <mooney@aps.anl.gov>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 27 Apr 2017 12:50:37 +0000
> I  try to add the following line to the path of calc-master in my softioc's RELEASE file :

> CALC=/home/user/epics/modules/calc-master


That looks correct assuming that you named the calc module calc-master.


> 5) it must add include calc.dbd to its xxxInclude.dbd file:

> however, I don't have xxxInclude.dbd file in my softioc in step 4) I created.

> I have no idea how to do this step.

> So, I try to copy calc.dbd file from calc-master folder to my softioc dbd folder instead.


There are 2 ways to build application dbd files.  One is using an xxxInclude.dbd file, the other is in the Makefile.  The example application uses the Makefile method, so you will see lines like this in the example Makefile:


# example.dbd will be made up from these files:
example_DBD += base.dbd
example_DBD += xxxSupport.dbd
example_DBD += dbSubExample.dbd

Since I think you named your application sapt you need to add this line:

sapt_DBD += calc.dbd

You don't need to copy the calc.dbd file.


I think that should fix your problem.


Mark


________________________________
From: tech-talk-bounces@aps.anl.gov [tech-talk-bounces@aps.anl.gov] on behalf of lzf neu [lzfneu@live.com]
Sent: Thursday, April 27, 2017 6:40 AM
To: Mooney, Tim M.; tech-talk@aps.anl.gov
Subject: Question about build calc module to use scalcout record



Hi Mooney,


Thanks for your respond. I have some questions to consult you.


According to the instructions that described in calc/documentation/calcDocs.html.

I do the following steps to build calc and have doubts in step4 and step5 :

1) Edit configure/RELEASE to specify the paths to EPICS base.

2) comment the sscan and seq modules definition out because of no swait record used and don't have sscan and seq.

3) run "make" to build .

4) An application that uses calc must specify the path to the calc module in its configure/RELEASE file.


I build an softioc use the command:


makeBaseApp.pl -t example sapt
makeBaseApp.pl -i -t example sapt
make


I have no idea how to do this step? I  try to add the following line to the path of calc-master in my softioc's RELEASE file :

CALC=/home/user/epics/modules/calc-master



5) it must add include calc.dbd to its xxxInclude.dbd file:


however, I don't have xxxInclude.dbd file in my softioc in step 4) I created. I have no idea how to do this step.

So, I try to copy calc.dbd file from calc-master folder to my softioc dbd folder instead.



6) it must link with libcalc, by adding a line like

xxx_LIBS += calc

to xxxApp/src/Makefile:



I add this line to my saptApp/src/Makefile file:


# Link in the code from our support library
sapt_LIBS += calc



After start my ioc, I failed to use scalcout record, and display the following errors in terminal:

Record "Second-calc" is of unknown type "scalcout"
Error at or before ")" in file "db/s7_300.db" line 36



Could you give me some suggestions in details and thanks in advance !!


Zhefu


________________________________
发件人: Mooney, Tim M. <mooney@aps.anl.gov>
发送时间: 2017年4月17日 14:55
收件人: lzf neu; tech-talk@aps.anl.gov
主题: RE: Question about string operation in epics db ?

Hi Zhefu,

The scalcout record is not in EPICS base; it's in the calc module:
https://github.com/epics-modules/calc
GitHub - epics-modules/calc: APS BCDA synApps module: calc<https://github.com/epics-modules/calc>
github.com
README.md calc. APS BCDA synApps module: calc. For more information, see http://www.aps.anl.gov/bcda/synApps. Report an issue with calc Request a feature


If you want to use it, you must build the calc module separately from EPICS base,
as described in calc/documentation/calcDocs.html

A database-fragment that does what you've described might look like this:
record(scalcout, "recname") {
    field(INPA, "<link to number-of-seconds PV>")
    field(CALC, "printf('%02d', a)")
}

If you're using EPICS base 3.15, you can use the printf record.

Tim Mooney (mooney@aps.anl.gov) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab

________________________________
From: tech-talk-bounces@aps.anl.gov [tech-talk-bounces@aps.anl.gov] on behalf of lzf neu [lzfneu@live.com]
Sent: Monday, April 17, 2017 8:15 AM
To: tech-talk@aps.anl.gov
Subject: Question about string operation in epics db ?


Hi,


I have a question to consult you.


PV name: "Global-second2_dword" is used to display 60 seconds countdown from PLC.


If the seconds countdown is less than 10, it displays a single digital in terminal. Now I want to add zero in the left of the single digital. eg.09,08,07,06,05,04,03,02,01,00.


Maybe string operation may solve the problem. I have tried  "scalcout" record, but epics displays the error message:

Record XXX is of unknown type "scalcout" and I have no idea how to write the db.


I have post the record in the following lines:


####################################

record(ai, "Global-Second")
{
    field(DTYP, "s7nodave")
    field(INP, "@s7_300 (PG=.2s) MW60")
    field(SCAN, "I/O Intr")
    field(FLNK, "Global-Second2_dword")
}

record(calc, "Global-Second2_dword")
{
        field(INPA, "Global-Second.VAL")
        field(CALC, "A/10")
}
####################################



Any help will be apprecieated and thanks in advance!


Zhefu

References:
Question about string operation in epics db ? lzf neu
RE: Question about string operation in epics db ? Mooney, Tim M.
Question about build calc module to use scalcout record lzf neu

Navigate by Date:
Prev: Question about build calc module to use scalcout record lzf neu
Next: Re: EpicsQT and Archiver Appliance Michael Davidsaver
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
Navigate by Thread:
Prev: Question about build calc module to use scalcout record lzf neu
Next: EPICS support for Solaris (on SPARC or x86)? Andrew Johnson
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
ANJ, 27 Apr 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·