Presentation on theme: "1 1999/Ph 514: Working With an IOC EPICS Working with an IOC Marty Kraimer APS."— Presentation transcript:
1 1999/Ph 514: Working With an IOC EPICS Working with an IOC Marty Kraimer APS
2 1999/Ph 514: Working With an IOC EPICS Typical Directory Structure for EPICS Applications u All directories and files are referenced relative to some user-defined directory under which all IOC related files exist u e.g. = /home/phoebus/STUDNTn/ioc/linac = /home/phoebus/STUDNTn/ioc/example = /home/phoebus/STUDNTn/ioc/project /home/phoebus/STUDNTn/ioc/linac is provided for you and already contains appropriate.dbd and.db files for the IOCs. You will create the other top directories during the lab sessions.
3 1999/Ph 514: Working With an IOC EPICS Directory Structure of u / u config/ - configuration and make rules u linacApp/ - ioc related source files u Db/ u Makefile.Host - must edit to add database files u xxLinacSim.db - Example database file u *.db - other database files as required u src u Makefile.Host - Rules to build linacApp.dbd u Makefile.Vx u Rules to build linacLib u Rules to install iocCore and sequencer u *.c - C files for added device support, records, etc u *.st - sequence programs u base.dbd and baseLIBOBJS u select components from epics base u linacInclude.dbd u Specifies additional components to be included in linacApp.dbd
4 1999/Ph 514: Working With an IOC EPICS Directory Structure of u / u iocBoot/ u ioclinac/ u st.cmd - startup script for vxWorks u bin u db u dbd u include u lib u... Install directories created and maintained by ‘gnumake’. Do not edit files in these directories.
5 1999/Ph 514: Working With an IOC EPICS Connecting to the IOC’s Console Port u In an xterm window on the Unix workstation u cu -l cua/a u If vxWorks is running, you now have access to the vxWorks shell u bootChange - edit boot parameters u CTL-X - cause a reboot u help - displays vxWorks debugging commands u ____ - any global function loaded at boot time u If vxWorks is not running, you are interacting with a ROM-based debugger u p - Print boot parameters u c - Change boot parameter - Start boot process u ? - help (shows available commands)
6 1999/Ph 514: Working With an IOC EPICS Booting an IOC u vxWorks Boot Parameters '.' = clear field; '-' = go to previous field; ^D = quit boot device: ei processor number: 0 host name: phoebus file name: /usr/local/vxWorks/5.3/mv167bp0/vxWorks inet on ethernet (e): xxx:fffffe00 inet on backplane (b): host inet (h): gateway inet (g): user (u): ftp password (pw) (blank = use rsh): flags (f): 0x0 target name (tn): iocuspasn startup script (s): /home/phoebus/STUDNTn/ioc/linac/ioclinac/st.cmd other (o): u The only parameter you will need to change is ‘startup script’
7 1999/Ph 514: Working With an IOC EPICS vxWorks Startup Script u A vxWorks startup script is used to load EPICS software and databases. The path for the startup script is specified in the boot parameters. u Typical startup script (st.cmd) # Example vxWorks startup file # Following must be added for many board support packages #cd < cdCommands /* defines appbin, startup */ cd appbin ld < iocCore /* loads ioc system software */ ld < seq /* loads the EPICS sequencer */ ld < linacLib /* loads user specified object code */ cd startup dbLoadDatabase("../../dbd/linacApp.dbd") dbLoadRecords("../../db/xxLinacSim.db","user=studnt1") iocInit /* starts ioc software */ seq &bpmTrajectory, "user=studnt0” /* starts a sequence program */
8 1999/Ph 514: Working With an IOC EPICS IOC Test Facilities u Useful vxWorks routines u i - list tasks u d - dump memory u ld < filename.o - load object module u lkup “name” - find address of global variable u spy - show CPU usage per task u Useful EPICS-supplied routines (See Chapter 6 Application Developer’s Guide) u dbl - list records u dbnr - list number of each record type u dbpr “ “, 5 - print all fields of a record u dbgf “ “ - get field value u dbpf “ “,” “ -put field value u dbior - print driver/device report u casr - Channel Access Server Report u dbel “