I'm confused by this, because the DTYP choices I know of for an scalcout record are "Soft Channel" and "stream".
"Soft Channel" is the default, and often the only choice. If you build the StreamDevice module, you can cause it to include device support for the scalcout record.
Tim Mooney (mooney at anl.gov) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab
From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Friday, August 14, 2020 7:41 AM
To: Christian Pauly <pauly at physik.uni-wuppertal.de>
Cc: Mooney, Tim M. <mooney at anl.gov>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: Calling external program and read return value into record
Hi Christian,
> It was a stupid mistake I made, the solution was easy:
> In the record definition of the scalcout record i was missing the
> DTYP "Soft Module"
> field.
> Adding this got it working...
I am confused, adding that DTYP field should not be necessary, I believe it should be the default.
This is an example of a working scalcout record in one of my databases. Note that it does not specify DTYP.
record(scalcout,"$(P)DP41:$(S):sp_HIHI3") {
field(CALC,"(A>=4096)&&(A<25536)?1:0")
field(INPA,"$(P)DP41:$(S):times102.VAL NPP NMS")
field(INAA,"$(P)DP41:$(S):spHIHI.SVAL NPP NMS")
field(OUT,"$(P)DP41:$(S):sendHIHI_RAM.VAL PP MS")
field(OOPT,"When Non-zero")
field(DOPT,"Use OCAL")
field(OCAL,"AA+$P('%X',A)")
}
Can you tell me what version of EPICS base and calc you are using?
Perhaps Tim has some ideas?
Mark
________________________________
From: Christian Pauly <pauly at physik.uni-wuppertal.de>
Sent: Friday, August 14, 2020 6:45 AM
To: Mark Rivers
Subject: Re: Calling external program and read return value into record
Hi Marc
Thanks for the answer.
It was a stupid mistake I made, the solution was easy:
In the record definition of the scalcout record i was missing the
DTYP "Soft Module"
field.
Adding this got it working...
Thanks again
Christian
On 8/14/20 1:43 PM, Mark Rivers wrote:
>> "2020/08/14 10:03:51.229277 _main_ CBM:Lauda:AirFlow: Wrong I/O link type CONSTANT"
>
>
> What versions of EPICS base and the calc module are you using? I can't find that error string in base 3.14.12.6, 3.15.5, or 7.0.4 of base, nor in the master branch of the calc module.
>
>
> Are you sure your application was built with support for the scalcout module, and that there are not other errors before that in the IOC startup output?
>
>
> Mark
>
>
>
> ________________________________
> From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Christian Pauly via Tech-talk <tech-talk at aps.anl.gov>
> Sent: Friday, August 14, 2020 3:16 AM
> To: tech-talk at aps.anl.gov
> Subject: Calling external program and read return value into record
>
> Hej Folks
>
> Again i am facing the problem to call an external program (to read out a
> sensor), but this time i would like to get the stdout output from this
> program (the sensor value) into a record.
>
>
> I am trying to use the ExecuteDevice module for this, and basically it
> works. Here is what i do:
>
> record(bo, "$(P)$(R)AirFlowRun")
> {
> field(SCAN, "1 second")
> field(DTYP, "execute")
> field(OUT, "@ReadFlow run")
> field(FLNK, "$(P)$(R)AirFlowStr")
> }
>
>
> record(stringin, "$(P)$(R)AirFlowStr")
> {
> field(DESC, "Measured Air Flow as String")
> field(DTYP, "execute")
> field(INP, "@ReadFlow stdout")
> field(FLNK, "$(P)$(R)AirFlow")
> }
>
> record(scalcout, "$(P)$(R)AirFlow")
> {
> field(INAA, "$(P)$(R)AirFlowStr.VAL")
> field(CALC, "AA")
> }
>
> The first record executes the external program, and once done it
> forwards to the second record to readout the stdout output. So far it works.
> Problem: The second record has to be a stringin record, so i have the
> output only as string not as number. record type ai is not supported by
> the EcecuteDevice module.
>
> In order to convert the string into a usable number i am trying to use
> the third "scalcout" record. It should retrieve the string via input
> link, and simply convert it to a float number.
> However: Specifying the input link "INAA" does not work, i get an error
>
> "2020/08/14 10:03:51.229277 _main_ CBM:Lauda:AirFlow: Wrong I/O link
> type CONSTANT"
>
> Acording to the scalcout documentation, it should be possible to use a
> link as input, so i dont get why this is not working...
>
> Or is there an even simpler way to achieve the goal ?
>
>
> As always: Any help or suggestionis very welcome !!
>
> Best regards,
> Christian
>
--
Dr. Christian Pauly
Bergische Universität Wuppertal
Fakultät für Mathematik und Naturwissenschaften -
Physik
Gaußstraße 20, D-42119 Wuppertal
Tel: +49 (0)202 439-2625,
Fax: +49 (0)202 439-2662
|