EPICS Application Quick Start

From sysuser user home directory create a directory for your example IOC application:

[sysuser@starepics ~]$ mkdir example
[sysuser@starepics ~]$ cd example
then create the example IOC application


[sysuser@starepics example]$ makeBaseApp.pl -t example test 
[sysuser@starepics example]$ makeBaseApp.pl -i -t example test  
[sysuser@starepics example]$ make 
Assuming ydu didn't get any errors during the make (you really shouldn't), your first EPICS IOC application is now ready to use.

Before executing the IOC, let's take a look to a db file using VDCT:


[sysuser@starepics example]$ vdct /home/sysuser/example/dbd/test.dbd /home/sysuser/example/db/dbExample1.db 
 
You should see something like this:

Now let's start the example IOC application:


[sysuser@starepics example]$ cd iocBoot/ioctest 
[sysuser@starepics ioctest]$ chmod +x st.cmd 
[sysuser@starepics ioctest]$ ./st.cmd 
#!../../bin/linux-x86_64/test 
## You may have to change test to something else  
## everywhere it appears in this file  
< envPaths epicsEnvSet(ARCH,"linux-x86_64")  
epicsEnvSet(IOC,"ioctest")  
epicsEnvSet(TOP," home/sysuser/example")  
epicsEnvSet(EPICS_BASE,"/usr/local/epics/base-3.14.12.1")  
cd /home/sysuser/example 
## Register all support components  
dbLoadDatabase("dbd/test.dbd")  
test_registerRecordDeviceDriver(pdbbase)  
## Load record instances  
dbLoadRecords("db/dbExample1.db","user=sysuserHost")  
dbLoadRecords("db/dbExample2.db","user=sysuserHost,no=1,scan=1 second")  
dbLoadRecords("db/dbExample2.db","user=sysuserHost,no=2,scan=2 second")  
dbLoadRecords("db/dbExample2.db","user=sysuserHost,no=3,scan=5 second")  
dbLoadRecords("db/dbSubExample.db","user=sysuserHost") 
## Set this to see messages from mySub  
#var mySubDebug 1  
cd /home/sysuser/example/iocBoot/ioctest  
iocInit()  
Starting iocInit  
#####################################################################  
#######  
### EPICS IOC CORE built on Jan 11 2007  
### EPICS R3.14.8.2 $R3-14-8-2$ $2006/01/06 15:55:13$  
#####################################################################  
####### iocInit: All initialization complete  
## Start any sequence programs  
#seq sncExample,"user=sysuserHost" 
Now you are into the epics; take a look of a prompt "epics>", from there, check the names of your records:


epics>dbl  
sysuserHost:aiExample  
sysuserHost:aiExample1  
sysuserHost:aiExample2  
sysuserHost:aiExample3  
sysuserHost:calcExample  
sysuserHost:calcExample1  
sysuserHost:calcExample2  
sysuserHost:calcExample3  
sysuserHost:compressExample  
sysuserHost:subExample  
sysuserHost:xxxExample 
Now from another shell check someone of your records:

[sysuser@starepics ~]$ camonitor sysuserHost:calcExample 
sysuserHost:calcExample        2017-10-16 08:45:08.048672 4 LOW MINOR 
sysuserHost:calcExample        2017-10-16 08:45:09.050654 5   
sysuserHost:calcExample        2017-10-16 08:45:10.052660 6 HIGH MINOR 
sysuserHost:calcExample        2017-10-16 08:45:11.054658 7 HIGH MINOR 
sysuserHost:calcExample        2017-10-16 08:45:12.056657 8 HIHI MAJOR 
sysuserHost:calcExample        2017-10-16 08:45:13.058652 9 HIHI MAJOR 
sysuserHost:calcExample        2017-10-16 08:45:14.060646 0 LOLO MAJOR 
(type "control-C" to quit).

or to do the same in graphical mode:

[sysuser@starepics ~]$ probe sysuserHost:calcExample 
Press the "Start" to see the count changes:

Go to EPICS Example IOC Exercise for more.