Epics@GSI Webhome

EPICS Example IOC Applicaton

This page documents the first steps to an example IOC Application

Following the example given in chapter 2 section 2.2 of the EPICS IOC Application Developer's Guide:
  1. Creation of a new IOC Application named <My Example Application>:
    $> mkdir <top>
    $> cd <top>
    $> $EPICS_BASE/bin/${EPICS_HOST_ARCH}/makeBaseApp.pl -t example <My Example Application>
    $> $EPICS_BASE/bin/${EPICS_HOST_ARCH}/makeBaseApp.pl -i -t example <My Example Application>
    $> make
    $> cd iocBoot/ioc<My Example Application>
  2. Starting the IOC:
    (<Target> (e.g.: linux-x86, or ${EPICS_HOST_ARCH}), <My Example Application>, <Top>, <Epics Base Directory> and <User> have been replaced in the output )
    $> ../../bin/<Target>/<My Example Application> st.cmd
        #!../../bin/<target>/<My Example Application>
        ## You may have to change <My Example Application> to something else
        ## everywhere it appears in this file
        < envPaths
        epicsEnvSet(ARCH,"<Target>")
        epicsEnvSet(IOC,"ioc<My Example Application>")
        epicsEnvSet(TOP,"<top>")
        epicsEnvSet(EPICS_BASE,"<Epics Base Directory>")
        cd <top>
        ## Register all support components
        dbLoadDatabase("dbd/<My Example Application>.dbd")
        <My Example Application>_registerRecordDeviceDriver(pdbbase)
        ## Load record instances
        dbLoadTemplate "db/userHost.substitutions"
        dbLoadRecords("db/dbSubExample.db","user=<user>Host")
        ## Set this to see messages from mySub
        #var mySubDebug 1
        cd <top>/iocBoot/ioc<My Example Application>
        iocInit()
        Starting iocInit
        ############################################################################
        ## EPICS R3.14.9 $R3-14-9$ $2007/02/05 16:31:45$
        ## EPICS Base built Aug  6 2007
        ############################################################################
        iocInit: All initialization complete
        ## Start any sequence programs
        #seq sncExample,"user=<user>Host"
        epics>
        
  3. Listing the available PVs:
    epics> dbl
       <user>Host:aiExample
       <user>Host:aiExample1
       ...
       <user>Host:xxxExample
       
  4. Any EPICS client should be able to see those PVs, e.g.:
    $> camonitor <User>Host:aiExample1
       <user>Host:aiExample1        2007-08-09 10:42:00.037941 4 LOW MINOR
       <user>Host:aiExample1        2007-08-09 10:42:01.039624 5
       <user>Host:aiExample1        2007-08-09 10:42:02.041629 6 HIGH MINOR
       


-- PeterZumbruch - 10 Aug 2007
Topic revision: r7 - 2018-01-08, PeterZumbruch - This page was cached on 2021-10-19 - 23:18.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Imprint (german) | Privacy Policy (german)