EPICS: vxWorks IOC: Difference between revisions
(89 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
VxWorks IOCs are normally running in VME crate controllers. | VxWorks IOCs are normally running in VME crate controllers. | ||
== | '''NOTE:''' $EPICS_BASE/configure/CONFIG was accidently changed and makefiles didnot work, Nerses fixed it - Sep 2011 | ||
== Hardware List == | |||
Following boards are used in CLAS VME vxWorks IOC crates: | |||
{| border="1" cellpadding="2" | |||
!width="200"|Brand/Model | |||
!width="250"|IOC List | |||
!width="250"|Driver's subdirectory (in $BASEB/src/) | |||
!width="250"|device support (by Matt Bickley on April 2012) | |||
|- | |||
|[[Xycom DIO XVME-240]] ||classc1, classc3, classc8 ||xy240||Available/viable | |||
|- | |||
|[[Xycom XVME-564]] ||classc3 ||(probably 'analog', since XVME-564 and XVME-560 are similar)||Available/viable | |||
|- | |||
|[[Xycom XVME-560]] ||classc3, classc8 ||analog||superceeded by XVME-564 | |||
|- | |||
|[[Struck SIS3801]] ||classc1, classc6, classc4, classc2 ||mca||Struck SIS3820 or CAEN V830 (32 channel latch scaler) | |||
|- | |||
|[[Joerger VSC16]] ||classc1, classc8 ||scaler||Available/viable or CAEN V830 | |||
|- | |||
|[[DATEL DVME-628]] ||classc1, classc4 ||DVME628||VMIC VME-4132 or VMIC-4120 (32 channel 12-bit DAC) | |||
|- | |||
|[[OMS VME44]] ||classc1, classc8 ||motor||Jlab in-house chassis (PC104- and FPGA-based) | |||
|- | |||
|[[Compcontrol CC121]] ||classc5, classc12 ||LecroyHV||Still available | |||
|- | |||
|[[CAEN V775]] ||classc7 ||mca||Still available | |||
|- | |||
|[[SYSTRAN VMESC5]] ||classc12 ||ipacLib, magnet||Still available (Curtiss Wright Controls) | |||
|- | |||
|[[SBS VIPC616]] ||classc6, iocptarg(MCC) ||ipacLib|| ??? | |||
|- | |||
|[[OMS VS4]] ||classc2 ||motor||Still available | |||
|- | |||
|[[CAEN V288]] ||camac2, dccntrl ||iocsy527App||Discontinued; no CAENET controller replacement available | |||
|- | |||
|[[VMIC VMIVME-3122]] ||iochlb(MCC) ||...||Superceded by VME-3122A | |||
|- | |||
|[[VMIC VMIVME-2120]] ||iochlb(MCC) ||...||Still available | |||
|- | |||
|[[VMIC VMIVME-1129]] ||iochlb(MCC) ||...||Still available | |||
|- | |||
|Machine Protection System I/O ???? ||iochlb(MCC) ||...||Long-term responsibility lies with Jlab engineering | |||
|- | |||
|Beam Viewer / SLM Control Board ???? ||iochlb(MCC) ||...||Long-term responsibility lies with Jlab engineering | |||
|- | |||
|[[HYTEC VSD2992]] ||iochlb(MCC) ||camacApp||Kinetic Systems KSC-2917 (or eliminate CAMAC) | |||
|- | |||
|[[VMIC VMIVME-2232]] ||iocptarg(MCC) ||...||VMIC VME-2232A | |||
|- | |||
|[[JLAB FLEXIO]] ||iocptarg(MCC) ||...||Long-term responsibility lies with Jlab engineering | |||
|- | |||
|[[VMIC VMIVME-6016]] ||sc-laser1, camac1 ||(tty driver in CLON area, work needed)||VMIC VME-6015 (or IP-to-serial controllers, like the Digi PortServer line) | |||
|} | |||
== Standard Installation == | |||
cd $EPICS_BASE | cd $EPICS_BASE | ||
Line 112: | Line 169: | ||
devCAEN.c | devCAEN.c | ||
Add them to the Makefile the same way, and type 'gmake'. | Add them to the Makefile the same way, and type 'gmake'. It complains for UNIX on linking, but command | ||
gmake vxWorks-ppc604_long | |||
works fine. Reboot IOC - no undefined symbols. | |||
Add our HV database and 'src' directories into ''cdCommands'': | |||
db = "/usr/local/clas/devel/R3.14.8.2/EPICS/app/hvca/db" | |||
src = "/usr/local/clas/devel/R3.14.8.2/base-3.14.8.2/iocsy527App/src" | |||
Add following two lnes to startup script after iocInit() (before - complains): | |||
cd src | |||
dbLoadDatabase("support.dbd") | |||
cd db | |||
dbLoadRecords("caen_04.db") | |||
Reboot ioc again, type 'dbl' - all records printed. | |||
Try to caget one of them - vxWorks printed error: we got through but corresponding function support is missing. | |||
Do following on vxWorks prompt: | |||
registryFunctionAdd("InitChannel",InitChannel) | |||
registryFunctionAdd("ScanChannel",ScanChannel) | |||
does not help. Run driver commands in the very end of startup script - does not help: | |||
sy527Init() | |||
sy527Start(0,"sy527_0x100000_9") | |||
sy527GetMap(0) | |||
== trying same, but use type 'example' instead of 'ioc' == | |||
cd $EPICS_BASE | |||
./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -t example iocsy527 | |||
./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -i -t ioc iocsy527 | |||
Everything compiles and boots, 'caget' works. | |||
Now, lets customize it for sy517: | |||
* copy following v288- and sy527-related *.h and *.c files to ''$EPICS_BASE/iocsy527/src'' directory: | |||
v288.c | |||
v288.h | |||
sy527.c | |||
sy527.h | |||
sy527_test.c | |||
sy527epics.c | |||
sy527epics.h | |||
(sy527epics1 was renamed to sy527epics in a process). Add follwoing lines to the Makefile: | |||
iocsy527_SRCS += v288.c | |||
iocsy527_SRCS += sy527.c | |||
iocsy527_SRCS += sy527epics.c | |||
iocsy527_SRCS += sy527_test.c | |||
Compile, reboot - looks good. | |||
* '''NOTES:''' our CAEN HV software structure | |||
1. Everything starts from ''$APP/hvca/db/caen_04.dat'' or similar file generated from ''caen.dat'' | |||
2. Statements ''field(INAM,InitChannel)'' and ''field(SNAM,ScanChannel)'' requires functions ''InitChannel'' and ''ScanChannel''; | |||
those functions are in ''bigsub.c'' | |||
2.1 ''bigsub.c'' calls one function ''CAEN_GetChannel'', that function is in ''sy527epics.c'' | |||
2.2 ''sy527epics.c'' contains following functions: | |||
CAEN_HVinit | |||
CAEN_HVstart | |||
CAEN_HVstop | |||
CAEN_HVload | |||
CAEN_GetHv | |||
CAEN_GetAlarm | |||
CAEN_GetValidity | |||
CAEN_SetHV | |||
CAEN_GetProperty | |||
CAEN_GetChannel | |||
3. Statement ''field(DTYP,"CAEN_HV")'' requires ... | |||
3.1 file ''support.dbd'' contains following statements: | |||
device(ao,VME_IO,devAoCAEN,"CAEN_HV") | |||
device(bo,VME_IO,devBoCAEN,"CAEN_HV") | |||
device(bi,VME_IO,devBiCAEN,"CAEN_HV") | |||
3.2 file ''devCAEN.c'' contains following statements: | |||
epicsExportAddress(dset,devAoCAEN) | |||
epicsExportAddress(dset,devBoCAEN) | |||
epicsExportAddress(dset,devBiCAEN) | |||
3.3 structure ''devAoCAEN'' contains for example field ''init_record'' containing function ''init_ao'' | |||
Continue customization. Copy ''devCAEN.c'', ''command.h'' and ''support.dbd'' as ''CAENSupport.dbd'' to ''src'' directory. Modify Makefile changing devXxxSoft to devCAEN and xxxSupport to CAENSupport everywhere (I decided not to just add new names, but eliminate old ones, because | |||
for example 'xxxSupport_SRCS += xxxRecord.c' referes to xxxSupport library, and I want to build only one library CAENSupport). Also: | |||
mv xxxSupport.dbd xxxSupport.dbd_obsolete | |||
mv devXxxSoft.c devXxxSoft.c_obsolete | |||
From directory ''iocsy527App'' type 'gmake vxWorks-ppc604_long clean' and 'gmake vxWorks-ppc604_long', compiles fine. Reboot, have error: | |||
## Load record instances | |||
dbLoadRecords("db/dbExample1.db","user=boiarino") | |||
Error Last token ")" | |||
input line: record(xxx, "boiarino:xxxExample") | |||
in: file db/dbExample1.db line 39 | |||
db_parse returned -1 | |||
value = -1 = 0xffffffff | |||
filename="../dbLexRoutines.c" line number=910 | |||
Record Type does not exist dbFindRecordType | |||
This is probably a result of eliminating xxxSupport.dbd and devXxxSoft.c. (INTERESTING: in Makefile there is following code: | |||
# xxxRecord.h will be created from xxxRecord.dbd | |||
DBDINC += xxxRecord | |||
and devXxxSoft.c has | |||
#include "xxxRecord.h" | |||
- just good to know). | |||
In Makefile comment out lines | |||
########DBDINC += xxxRecord | |||
########CAENSupport_SRCS += xxxRecord.c | |||
and in startup script | |||
#####dbLoadRecords("db/dbExample1.db","user=boiarino") | |||
because it does not work anyway. Rename unused files: | |||
mv xxxRecord.c xxxRecord.c_obsolete | |||
mv xxxRecord.dbd xxxRecord.dbd_obsolete | |||
Recompile, reboot. Looks good. | |||
Copy bigsub.c (our init and scan functions for the 'bigsubRecord'). Add following to the Makefile: | |||
iocsy527_SRCS += bigsub.c | |||
Recompile, reboot. Looks good. | |||
Now interesting part. Add following to the startup script: | |||
db = "/usr/local/clas/devel/R3.14.8.2/EPICS/app/hvca/db" |
Latest revision as of 20:13, 28 May 2012
VxWorks IOCs are normally running in VME crate controllers.
NOTE: $EPICS_BASE/configure/CONFIG was accidently changed and makefiles didnot work, Nerses fixed it - Sep 2011
Hardware List
Following boards are used in CLAS VME vxWorks IOC crates:
Brand/Model | IOC List | Driver's subdirectory (in $BASEB/src/) | device support (by Matt Bickley on April 2012) |
---|---|---|---|
Xycom DIO XVME-240 | classc1, classc3, classc8 | xy240 | Available/viable |
Xycom XVME-564 | classc3 | (probably 'analog', since XVME-564 and XVME-560 are similar) | Available/viable |
Xycom XVME-560 | classc3, classc8 | analog | superceeded by XVME-564 |
Struck SIS3801 | classc1, classc6, classc4, classc2 | mca | Struck SIS3820 or CAEN V830 (32 channel latch scaler) |
Joerger VSC16 | classc1, classc8 | scaler | Available/viable or CAEN V830 |
DATEL DVME-628 | classc1, classc4 | DVME628 | VMIC VME-4132 or VMIC-4120 (32 channel 12-bit DAC) |
OMS VME44 | classc1, classc8 | motor | Jlab in-house chassis (PC104- and FPGA-based) |
Compcontrol CC121 | classc5, classc12 | LecroyHV | Still available |
CAEN V775 | classc7 | mca | Still available |
SYSTRAN VMESC5 | classc12 | ipacLib, magnet | Still available (Curtiss Wright Controls) |
SBS VIPC616 | classc6, iocptarg(MCC) | ipacLib | ??? |
OMS VS4 | classc2 | motor | Still available |
CAEN V288 | camac2, dccntrl | iocsy527App | Discontinued; no CAENET controller replacement available |
VMIC VMIVME-3122 | iochlb(MCC) | ... | Superceded by VME-3122A |
VMIC VMIVME-2120 | iochlb(MCC) | ... | Still available |
VMIC VMIVME-1129 | iochlb(MCC) | ... | Still available |
Machine Protection System I/O ???? | iochlb(MCC) | ... | Long-term responsibility lies with Jlab engineering |
Beam Viewer / SLM Control Board ???? | iochlb(MCC) | ... | Long-term responsibility lies with Jlab engineering |
HYTEC VSD2992 | iochlb(MCC) | camacApp | Kinetic Systems KSC-2917 (or eliminate CAMAC) |
VMIC VMIVME-2232 | iocptarg(MCC) | ... | VMIC VME-2232A |
JLAB FLEXIO | iocptarg(MCC) | ... | Long-term responsibility lies with Jlab engineering |
VMIC VMIVME-6016 | sc-laser1, camac1 | (tty driver in CLON area, work needed) | VMIC VME-6015 (or IP-to-serial controllers, like the Digi PortServer line) |
Standard Installation
cd $EPICS_BASE ./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -t ioc iocsy527 ./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -i -t ioc iocsy527 The following target architectures are available in base: solaris-sparc vxWorks-ppc604_long solaris-x86 linux-x86 What architecture do you want to use? vxWorks-ppc604_long The following applications are available: caclient caserver ioc ioccamac iocCore1 iocCore iochv iocsy527 ioctest support What application should the IOC(s) boot? The default uses the IOC's name, even if not listed above. Application name? iocsy527
It creates directories iocsy527App and iocBoot/iocsy527.
cd iocsy527App gmake
It compiles both unix and vxWorks versions.
cd ../iocBoot/iocsy527 gmake
It creates useful cdCommands file. File st.cmd' in the same directory contains an example of startup script. Uncommect followibg line
cd "/usr/local/clas/devel/R3.14.8.2/base-3.14.8.2/iocBoot/iocsy527"
and boot. Everything looks good.
Makefile, source files
Original Makefile in /usr/local/clas/devel/R3.14.8.2/base-3.14.8.2/iocsy527App/src:
TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE #============================= #============================= # build an ioc application PROD_IOC = iocsy527 DBD += iocsy527.dbd # iocsy527.dbd will be made up from these files: iocsy527_DBD += base.dbd #include definitions for any other support applications needed #iocsy527_DBD += xxx.dbd # <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd iocsy527_SRCS += iocsy527_registerRecordDeviceDriver.cpp iocsy527_SRCS_DEFAULT += iocsy527Main.cpp iocsy527_SRCS_vxWorks += -nil- #The following adds support from base/src/vxWorks iocsy527_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary #add a definition for each support application used by this application #iocsy527_LIBS += xxx #NOTES: # 1)It is not possible to build sncExample both as a component of iocsy527 # and standalone. You must choose only one. # 2)To build sncExample SNCSEQ must be defined in <top>/configure/RELEASE #The following builds sncExample as a component of iocsy527 #iocsy527_SRCS += sncExample.stt #iocsy527_LIBS += seq pv iocsy527_LIBS += $(EPICS_BASE_IOC_LIBS) #The following builds sncExample as a standalone application #PROD_HOST += sncExample #sncExample_SNCFLAGS += +m #sncExample_SRCS += sncExample.stt #sncExample_LIBS += seq pv #sncExample_LIBS += $(EPICS_BASE_HOST_LIBS) #=========================== include $(TOP)/configure/RULES #---------------------------------------- # ADD RULES AFTER THIS LINE
Copy following files from 'DriverOld':
sy527.h sy527epics1.h v288.h sy527.c sy527_test.c sy527epics1.c v288.c
Add following to Makefile:
iocsy527_SRCS += v288 iocsy527_SRCS += sy527 iocsy527_SRCS += sy527epics1
Type gmake - everything compiles and linked with new source files.
Copy following files from 'IocshellOld':
command.h sub.c bigsub.c devCAEN.c
Add them to the Makefile the same way, and type 'gmake'. It complains for UNIX on linking, but command
gmake vxWorks-ppc604_long
works fine. Reboot IOC - no undefined symbols.
Add our HV database and 'src' directories into cdCommands:
db = "/usr/local/clas/devel/R3.14.8.2/EPICS/app/hvca/db" src = "/usr/local/clas/devel/R3.14.8.2/base-3.14.8.2/iocsy527App/src"
Add following two lnes to startup script after iocInit() (before - complains):
cd src dbLoadDatabase("support.dbd") cd db dbLoadRecords("caen_04.db")
Reboot ioc again, type 'dbl' - all records printed.
Try to caget one of them - vxWorks printed error: we got through but corresponding function support is missing.
Do following on vxWorks prompt:
registryFunctionAdd("InitChannel",InitChannel) registryFunctionAdd("ScanChannel",ScanChannel)
does not help. Run driver commands in the very end of startup script - does not help:
sy527Init() sy527Start(0,"sy527_0x100000_9") sy527GetMap(0)
trying same, but use type 'example' instead of 'ioc'
cd $EPICS_BASE ./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -t example iocsy527 ./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -i -t ioc iocsy527
Everything compiles and boots, 'caget' works.
Now, lets customize it for sy517:
- copy following v288- and sy527-related *.h and *.c files to $EPICS_BASE/iocsy527/src directory:
v288.c v288.h sy527.c sy527.h sy527_test.c sy527epics.c sy527epics.h
(sy527epics1 was renamed to sy527epics in a process). Add follwoing lines to the Makefile:
iocsy527_SRCS += v288.c iocsy527_SRCS += sy527.c iocsy527_SRCS += sy527epics.c iocsy527_SRCS += sy527_test.c
Compile, reboot - looks good.
- NOTES: our CAEN HV software structure
1. Everything starts from $APP/hvca/db/caen_04.dat or similar file generated from caen.dat 2. Statements field(INAM,InitChannel) and field(SNAM,ScanChannel) requires functions InitChannel and ScanChannel; those functions are in bigsub.c 2.1 bigsub.c calls one function CAEN_GetChannel, that function is in sy527epics.c 2.2 sy527epics.c contains following functions: CAEN_HVinit CAEN_HVstart CAEN_HVstop CAEN_HVload CAEN_GetHv CAEN_GetAlarm CAEN_GetValidity CAEN_SetHV CAEN_GetProperty CAEN_GetChannel 3. Statement field(DTYP,"CAEN_HV") requires ... 3.1 file support.dbd contains following statements: device(ao,VME_IO,devAoCAEN,"CAEN_HV") device(bo,VME_IO,devBoCAEN,"CAEN_HV") device(bi,VME_IO,devBiCAEN,"CAEN_HV") 3.2 file devCAEN.c contains following statements: epicsExportAddress(dset,devAoCAEN) epicsExportAddress(dset,devBoCAEN) epicsExportAddress(dset,devBiCAEN) 3.3 structure devAoCAEN contains for example field init_record containing function init_ao
Continue customization. Copy devCAEN.c, command.h and support.dbd as CAENSupport.dbd to src directory. Modify Makefile changing devXxxSoft to devCAEN and xxxSupport to CAENSupport everywhere (I decided not to just add new names, but eliminate old ones, because for example 'xxxSupport_SRCS += xxxRecord.c' referes to xxxSupport library, and I want to build only one library CAENSupport). Also:
mv xxxSupport.dbd xxxSupport.dbd_obsolete mv devXxxSoft.c devXxxSoft.c_obsolete
From directory iocsy527App type 'gmake vxWorks-ppc604_long clean' and 'gmake vxWorks-ppc604_long', compiles fine. Reboot, have error:
## Load record instances dbLoadRecords("db/dbExample1.db","user=boiarino") Error Last token ")" input line: record(xxx, "boiarino:xxxExample") in: file db/dbExample1.db line 39 db_parse returned -1 value = -1 = 0xffffffff filename="../dbLexRoutines.c" line number=910 Record Type does not exist dbFindRecordType
This is probably a result of eliminating xxxSupport.dbd and devXxxSoft.c. (INTERESTING: in Makefile there is following code:
# xxxRecord.h will be created from xxxRecord.dbd DBDINC += xxxRecord
and devXxxSoft.c has
#include "xxxRecord.h"
- just good to know).
In Makefile comment out lines
########DBDINC += xxxRecord ########CAENSupport_SRCS += xxxRecord.c
and in startup script
#####dbLoadRecords("db/dbExample1.db","user=boiarino")
because it does not work anyway. Rename unused files:
mv xxxRecord.c xxxRecord.c_obsolete mv xxxRecord.dbd xxxRecord.dbd_obsolete
Recompile, reboot. Looks good.
Copy bigsub.c (our init and scan functions for the 'bigsubRecord'). Add following to the Makefile:
iocsy527_SRCS += bigsub.c
Recompile, reboot. Looks good.
Now interesting part. Add following to the startup script:
db = "/usr/local/clas/devel/R3.14.8.2/EPICS/app/hvca/db"