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: Stream device
From: "Szalata, Zenon M." <[email protected]>
To: "EPICS tech-talk" <[email protected]>
Date: Wed, 24 Oct 2007 20:26:20 -0700
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


Replies:
Re: Stream device Dirk Zimoch

Navigate by Date:
Prev: RE: Running sequencer within IOC Mark Rivers
Next: unique alarms for fields? Heinrich du Toit
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: RE: Running sequencer within IOC Mark Rivers
Next: Re: Stream device Dirk Zimoch
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 ·