EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Stream device
From: Dirk Zimoch <[email protected]>
To: "Szalata, Zenon M." <[email protected]>
Cc: EPICS tech-talk <[email protected]>
Date: Thu, 25 Oct 2007 13:45:54 +0200
Hi Zen,

the @init handler runs during iocInit, to be exact during init_record. Maybe the vxi11 has not yet connected by that time (when interruptAccept is still 0). I have to check that. I only tested it with serial and TCP ports so far. Unfortunately, not all asyn ports behave the same.

I have not time this week any more. I hope I can help you by the end of next week.

Dirk

Szalata, Zenon M. wrote:
I am learning to use stream device to implement a soft IOC to control an Agilent 33220A waveform generator, which is attached to an ICS 8065 Ethernet-GPIB controller.  I have a very simple program at this point.  It consists of two records: ai and ao and a very simple protocol file.  I am unable to use the @init{} command/handler.  Without the @init{} commented out the program works as it should.  But when I uncomment either of the two @init{} statements an error results. Here is the output:
------------------------------
zms@esaux1 $ ../../bin/linux-x86/atest st.cmd
#!../../bin/linux-x86/atest
< envPaths
epicsEnvSet(ARCH,"linux-x86")
epicsEnvSet(IOC,"iocagwfg")
epicsEnvSet(TOP,"/afs/slac.stanford.edu/g/esa/ilc/epics/iocTop/atest")
epicsEnvSet(ASYN,"/afs/slac/g/esa/ilc/epics/modules/asyn/4-9")
epicsEnvSet(STRM,"/afs/slac/g/esa/ilc/epics/modules/streamdevice-2-3")
epicsEnvSet(EPICS_BASE,"/afs/slac/g/esa/ilc/epics/base/R3-14-9-ilc1")
epicsEnvSet( "STREAM_PROTOCOL_PATH","../../atestApp/Db:.")
cd /afs/slac.stanford.edu/g/esa/ilc/epics/iocTop/atest
## Register all support components
dbLoadDatabase("dbd/atest.dbd",0,0)
atest_registerRecordDeviceDriver(pdbbase)
vxi11Configure( "L0","134.79.64.25",0,0.0,"gpib0",0,0)
dbLoadRecords("db/atest.db","P=AG:")
cd /afs/slac.stanford.edu/g/esa/ilc/epics/iocTop/atest/iocBoot/iocagwfg
iocInit()
Starting iocInit
############################################################################
## EPICS R3.14.9-lcls1 $R3-14-9$ $2007/02/05 16:31:45$
## EPICS Base built Oct  2 2007
############################################################################
2007/10/24 18:21:44.742 L0 port not connected
2007/10/24 18:21:45.307 AG:RFreq: asynError in write: L0 port is not connected

2007/10/24 18:21:45.308 AG:RFreq: @init handler failed
2007/10/24 18:21:45.308 AG:RFreq: Record initialization failed
2007/10/24 18:21:45.308 AG:WFreq: asynError in write: L0 port is not connected

2007/10/24 18:21:45.308 AG:WFreq: @init handler failed
2007/10/24 18:21:45.308 AG:WFreq: Record initialization failed
Bad init_rec return value  PV: AG:WFreq ao: init_record
iocInit: All initialization complete
epics> exit
---------------------------------
Here is my atest.db:

---------------------------------
record( ai,"$(P)RFreq"){
  field( DESC, "read frequency")
  field( DTYP, "stream")
  field( SCAN, "10 second")
  field( PREC, "2")
  field( EGU,  "Hz")
  field( INP,  "@atest.proto rFreq L0 8")
}
record( ao,"$(P)WFreq"){
  field( DESC, "write frequency")
  field( DTYP, "stream")
  field( SCAN, "Passive")
  field( PREC, "2")
  field( EGU,  "Hz")
  field( OUT,  "@atest.proto wFreq L0 8")
}
---------------------------------

And atest.proto, shown here with both @init statements commented out:

---------------------------------
# file: atest.proto

Terminator=LF;

#@init{ out " ";}

rFreq{
 out "FREQ?"; in "%f";
}
wFreq{
 out "FREQ %f";
# @init{ rFreq;}
}
-----------------------------------

Also here is atestApp/src/Makefile

-----------------------------------
TOP=../..

include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================

#=============================
# build an ioc application

PROD_IOC = atest

DBD += atest.dbd
# atest.dbd will be made up from these files:
atest_DBD += base.dbd
atest_DBD += atestSup.dbd
atest_DBD += stream.dbd
atest_DBD += asyn.dbd
atest_DBD += drvVxi11.dbd

# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
atest_SRCS += atest_registerRecordDeviceDriver.cpp
atest_SRCS_DEFAULT += atestMain.cpp
atest_SRCS_vxWorks += -nil-

#The following adds support from base/src/vxWorks
atest_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

#add a definition for each support application used by this application
atest_LIBS += asyn
atest_LIBS += stream
#atest_LIBS += genSub
#atest_LIBS += calc

atest_LIBS += $(EPICS_BASE_IOC_LIBS)

#----------------------------------------
include $(TOP)/configure/RULES
#----------------------------------------
#  ADD RULES AFTER THIS LINE
------------------------------------------

And contents of my atestSup.dbd:

------------------------------------------
registrar( drvAsynIPPortRegisterCommands)
------------------------------------------

When the @init statements are commented out, this is what I get:

-------------------------------------------
#!../../bin/linux-x86/atest
< envPaths
epicsEnvSet(ARCH,"linux-x86")
epicsEnvSet(IOC,"iocagwfg")
epicsEnvSet(TOP,"/afs/slac.stanford.edu/g/esa/ilc/epics/iocTop/atest")
epicsEnvSet(ASYN,"/afs/slac/g/esa/ilc/epics/modules/asyn/4-9")
epicsEnvSet(STRM,"/afs/slac/g/esa/ilc/epics/modules/streamdevice-2-3")
epicsEnvSet(EPICS_BASE,"/afs/slac/g/esa/ilc/epics/base/R3-14-9-ilc1")
epicsEnvSet( "STREAM_PROTOCOL_PATH","../../atestApp/Db:.")
cd /afs/slac.stanford.edu/g/esa/ilc/epics/iocTop/atest
## Register all support components
dbLoadDatabase("dbd/atest.dbd",0,0)
atest_registerRecordDeviceDriver(pdbbase)
vxi11Configure( "L0","134.79.64.25",0,0.0,"gpib0",0,0)
dbLoadRecords("db/atest.db","P=AG:")
cd /afs/slac.stanford.edu/g/esa/ilc/epics/iocTop/atest/iocBoot/iocagwfg
iocInit()
Starting iocInit
############################################################################
## EPICS R3.14.9-lcls1 $R3-14-9$ $2007/02/05 16:31:45$
## EPICS Base built Oct  2 2007
############################################################################
iocInit: All initialization complete
epics> dbl
AG:RFreq
AG:WFreq
epics>
-------------------------------------------
And I can examine the value read in a very simple edm screen.

Sorry for such a lengthy note.  Thanks for helping,
Zen



-- Dr. Dirk Zimoch Paul Scherrer Institut, WBGB/006 5232 Villigen PSI, Switzerland Phone +41 56 310 5182

Replies:
RE: Stream device Mark Rivers
References:
Stream device Szalata, Zenon M.

Navigate by Date:
Prev: another question on custom record stuff Heinrich du Toit
Next: RE: unique alarms for fields? Dalesio, Leo `Bob`
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Stream device Szalata, Zenon M.
Next: RE: Stream device Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·