Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 2003/P571: IOC Development Environment EPICS IOC Development Environment with EPICS on Ubuntu Based on “IOC Development Envirnment” by Andrew Johnson,

Similar presentations


Presentation on theme: "1 2003/P571: IOC Development Environment EPICS IOC Development Environment with EPICS on Ubuntu Based on “IOC Development Envirnment” by Andrew Johnson,"— Presentation transcript:

1 1 2003/P571: IOC Development Environment EPICS IOC Development Environment with EPICS on Ubuntu Based on “IOC Development Envirnment” by Andrew Johnson, APS

2 1 2003/P571: IOC Development Environment EPICS Preamble  This talk describes the IOC development environment that comes with EPICS Base R on Ubuntu Linux  IOC Development  Database configuration  Operation Panel  Sequencer program  Device/Record Support  Sometimes called makeBaseApp  After the PERL script that creates application areas  It uses the same major structure and build rules as Base  Allows independent compilation of the same source modules for multiple target architectures

3 1 2003/P571: IOC Development Environment EPICS Reference Documentation EPICS: Input / Output Controller Application Developer's Guide  Release , 27 October 2008  Accessible through the R page on the EPICS website  Chapter 4 covers the EPICS build system in great detail, and is more recent (and accurate) than much of this talk  The R3.14 build system has evolved quite a bit since R3.13.x

4 1 2003/P571: IOC Development Environment EPICS Purpose of an IOC DE  What is an IOC development area for?  A place to collect files and configuration data associated with  one or more similar IOCs  device, driver and/or record support  other related software  Provides simple ways to configure and automate some very complex compilation procedures involving  Databases and database templates  Startup command files  Record, device & driver support  SNL programs  Other IOC code  Portable CA Server applications  Other host software

5 1 2003/P571: IOC Development Environment EPICS Other Features  IOC Software is usually divided into different areas  Each area is managed separately  A may use products from other areas  EPICS Base is mainly regarded as just another  The Gnu version of make is used to build all products  Almost every directory has a Makefile in it  Make recursively descends through the directory structure  Determines what needs to be [re]built  Invokes compilers and other tools as instructed in the Makefile  CVS can be used for revision control of source code and configuration files

6 1 2003/P571: IOC Development Environment EPICS EPICS on Ubuntu/Live-CD  Ubuntu  1-CD/DVD Linux distrribution  Boot from CD/DVD  Don't need to install it on HDD. /Can install the system on to HDD  Run Most PC platform.  Insert CD in the CD drive and just restart,  EPICS on Ubunti  Start terminal window from menu after booting Ubuntu.  For the envrionment setting use . /opt/epics/etc/cshrc.EPICS

7 1 2003/P571: IOC Development Environment EPICS makeBaseApp  To create a new application area, execute the commands mkdir ~/heater cd ~/heater makeBaseApp.pl -t example water makeBaseApp.pl -t example -i water example: a name of template makeBaseApp.pl -l will give you a list of available template

8 1 2003/P571: IOC Development Environment EPICS makeBaseApp  makeBaseApp.pl -t example water makeBaseApp.pl -t example -i heater The first command creates: / Makefile configure/... waterApp src/... Db/... The second command creates: /iocBoot Makefile iocheater/ … makeBaseApp.pl can be run multiple times to create new subdirectories Run env EPICS_HOST_ARCH=linux-x86 make install

9 1 2003/P571: IOC Development Environment EPICS Directory Structure  The example directory is an application  A is structured like this: / configure/Configuration data files xxxApp/All source files except startup src/Source code xxxSrc/There can be multiple xxxSrc directories Db/Databases, templates & substitutions files xxxDbThere can be multiple xxxDb directories...May have others dirs too such as adl, edm, etc yyyApp/Any number of *App directories iocBoot/Only one iocBoot iocxxxDirectory for each ioc...

10 1 2003/P571: IOC Development Environment EPICS Install Directories  By default, build products are installed into various subdirectories under : / bin/Object files and executables linux-x86/ vxWorks-68040/ lib/Object libraries linux-x86/etc. include/e.g. xxxRecord.h dbd/menu, recordtype, device, driver,etc db/record instances, templates, etc javalib/.jar files DONT touch files in these directory. They will be OVERWRITTEN when you run “make” in the application directories

11 1 2003/P571: IOC Development Environment EPICS /configure files  Files meant to be modified  CONFIG - Can override make variables CROSS_COMPILER_TARGET_ARCHS = vxWorks  CONFIG_APP Some other definitions  RELEASE Location of other areas used in this application EPICS_BASE=/opt/epics/R3.14.7/base  Other files not meant to be modified  RULES* Files containing (pointers to) make rules in base  Makefile Some configuration tasks

12 1 2003/P571: IOC Development Environment EPICS /xxxApp/src files  Source code for  Device support  Record support  Sequencer (snl) program  Subroutines  Commands for iocsh,....

13 1 2003/P571: IOC Development Environment EPICS /xxxApp/src files  base.dbd - definitions supplied by base  Edit this if you don't want to load some base record or device types  Links to menu, recordtype, device, drivers provided by base  Earlier versions of base included hardware support too, not R  Not fully expanded, contains many component include statements include “menuGlobal.dbd” include “menuConvert.dbd” include “aiRecord.dbd”... include "waveformRecord.dbd" device(ai,CONSTANT,devAiSoft,"Soft Channel")... device(waveform,CONSTANT,devWfSoft,"Soft Channel")

14 1 2003/P571: IOC Development Environment EPICS xxxApp/src continued  Makefile defines what is to be built, from which source files TOP=../.. include $(TOP)/configure/CONFIG DBDINC += xxxRecord DBD += example.dbd PROD_IOC = example example_SRCS += xxxRecord.c devXxxSoft.c exampleMain.cpp example_SRCS += example_registerRecordDeviceDriver.cpp example_LIBS += iocsh miscIoc rsrvIoc dbtoolsIoc asIoc dbIoc example_LIBS += registryIoc dbStaticIoc ca Com include $(TOP)/configure/RULES  ExampleInclude.dbd include “base.dbd” include “xxxRecord.dbd” device(xxx,CONSTANT,devXxxSoft,”Soft Channel”)

15 1 2003/P571: IOC Development Environment EPICS xxxApp/xxxDb/Makefile  Databases installed into /db  DB += xxx.db  Template files expanded on host  yyy.template has the format record(ai,”$(USER):aiExample$(NO)”){ … }  yyy.substitutions contains file yyy.template { {USER=“mrk”,NO=“1”} {USER=“mrk”,NO=“2”} } DB += yyy.db USES_TEMPLATE += yyy.template  Template files to be expanded at boot time via dbLoadTemplate()  DB += zzz.template zzz.substitutions  Support for capfast generated files  Can also expand.dbd files

16 1 2003/P571: IOC Development Environment EPICS iocBoot/iocxxx  iocBoot/iocxxx/Makefile Creates cdCommands file for vxWorks targets. Make sure that  ARCH =  is defined correctly in the Makefile  For a vxWorks target the cdCommands output file looks like startup=“ “ appbin=“ “ …  A vxWorks st.cmd file looks like < cdCommands cd appbin ld < iocCore ld < xxxLib cd startup dbLoadDatabase(“../../dbd/xxxApp.dbd”) dbLoadRecords(“../../db/xxx.db”,”user=mrk”) iocInit

17 1 2003/P571: IOC Development Environment EPICS Make Targets (commands)  It is possible to run make (gnumake) in any subdirectory   make clean uninstall Removes all products, leaving just the original source files  make Builds and installs everything that is not up to date  configure  make Constructs target-specific files from contents of RELEASE  iocBoot  make Same as issuing command in each iocxxx subdirectory  iocBoot/iocxxx  make Creates the envPath file, if appropriate for the IOC's architecture

18 1 2003/P571: IOC Development Environment EPICS Make Targets (commands) cont.  xxxApp  make Same as issuing command in each subdirectory  xxxApp/xxxSrc  Builds in O. ; installs products in /  make Builds and installs all out of date components  make Build only for specified architecture(s), e.g. make vxWorks-ppc604  make clean Remove all O. directories  XxxApp/xxxDb  make Generates and installs database instance files etc.

19 1 2003/P571: IOC Development Environment EPICS Application Templates  MakeBaseApp uses templates for the files it creates  New application templates can be created by anyone  Base supplies the following /templates/makeBaseApp/top/ Makefile configure exampleApp exampleBoot simpleApp simpleBoot  Template files undergo textual substitutions when installed  Use “makeBaseApp.pl -l”to get the list of installed template

20 1 2003/P571: IOC Development Environment EPICS iocsh  Iocsh  EPICS database/CA server program  st.cmd : startup script for iocsh  Database download  Sequencer program  Start ioc operation: iocInit  Command to start iocsh /bin/ / st.cmd  Or  Chmod +x st.cmd  “./st.cmd” to start iocsh

21 1 2003/P571: IOC Development Environment EPICS Commands for debugging  Try first: epics> help  Then, try some of the other commands: epics> thread epics> dbl epics> dbpr “record_name” epics> scanppl epics> …

22 1 2003/P571: IOC Development Environment EPICS Commands to check channel  base/bin/  caConnTest.o  CaEventRate  ca_test  Caget  Camonitor  Caput  catime  Cainfo  callbackTestHost

23 1 2003/P571: IOC Development Environment EPICS Hands-on preparation  Boot you PC using Ubuntu CD  Wait for a while  When Ubuntu desktop is up. Open “terminal”  Applications -> Accessories -> Terminal  Insert your USB memory, if you have  In “Terminal”, input the following commands  ls /media  Cd /media/  Create working directory  mkdir Group App  Replace with your group number shown on your PC  Set User Environment variable  export USER=

24 Starting Ubuntu ← Just after rebooting PC. Press Enter to proceed. → Automatically log in to Ubuntu as user: ubuntu

25 Ubuntu:Network configuration ← select network configuration ←select eth0. And click “edit” button → setup IP address/mask or use DHCP

26 Ubuntu:Open Terminal

27 1 2003/P571: IOC Development Environment EPICS Hands on  cd Group App  makeBaseApp.pl -t example myexample  makeBaseApp.pl -i -t example myexample  make  Run Iocsh:  do:  cd iocBoot/iocmyexample ../../bin/linux-x86/myexample st.cmd  or  cd iocBoot/iocmyexample  chmod +x./st.cmd ./st.cmd

28 1 2003/P571: IOC Development Environment EPICS  In inocsh try:  dbl  dbpr  scnppl  In Unix shell try:  caget  cainfo  camonitor  caput,  Create User Interface with edm/medm


Download ppt "1 2003/P571: IOC Development Environment EPICS IOC Development Environment with EPICS on Ubuntu Based on “IOC Development Envirnment” by Andrew Johnson,"

Similar presentations


Ads by Google