Skip to content
slac-epicsPublic

About

vacuum: Mirror for /afs/slac/g/cd/swe/git/repos/package/epics/modules/vacuum.git

Resources

Stars

0 stars

Watchers

3 watching

Forks

Latest commit

 

History

57 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2013-05-09

A. Wallace

This is a module for the vacuum IOCs. Basically I want to have one place to
keep all the templates and protocols for the vacuum IOCs used in LCLS. Additionally, this will
help keep everyone's IOC version up-to-date.

To use it on your vacuum IOC make your release file looks like this:
###############################################
# RELEASE
# Defines location of external products
include $(TOP)/RELEASE_SITE

# ===============================================================
# Define the version of our generic vacuum ioc and
# use it's release settings
# ===============================================================
VAC_IOC_VERSION=<version of module you want to use>
include $(EPICS_SITE_TOP)/modules/vacuum/$(VAC_IOC_VERSION)/configure/RELEASE

VACUUM=$(EPICS_SITE_TOP)/modules/vacuum/$(VAC_IOC_VERSION)/
##########################################################

Your ***App/src/Makefile should include these lines:

# Build an ioc application
# Use PROD_IOC_RTEMS for RTEMS only
# Use PROD_IOC_Linux for Linux only
PROD_IOC = vacuum

# vacuum.dbd will be created and installed
DBD += vacuum.dbd

# vacuum.dbd will be made up from these files:
vacuum_DBD += base.dbd
vacuum_DBD += iocAdmin.dbd
vacuum_DBD += autosaveSupport.dbd
vacuum_DBD += asyn.dbd
vacuum_DBD += stream.dbd
vacuum_DBD += modbus.dbd
vacuum_DBD += modbusSupport.dbd

# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
vacuum_SRCS += vacuum_registerRecordDeviceDriver.cpp
vacuum_SRCS_DEFAULT += vacuumMain.cpp

# Add locally compiled object code
#vacuum_SRCS += dbSubExample.c

vacuum_LIBS += devIocStats
vacuum_LIBS += autosave
vacuum_LIBS += ModBusTCPClnt
vacuum_LIBS += modbus
vacuum_LIBS += asyn
vacuum_LIBS += stream
vacuum_LIBS += $(EPICS_BASE_IOC_LIBS)
vacuum_LIBS += vacuum

PROD_SYS_LIBS_DEFAULT += pcre

########################################


Sometimes the build will fail unless you include this line in your src makefile: 
PROD_SYS_LIBS_DEFAULT += pcre

Change all autosave and archive sub files to look for tpl-req or tpl-arch (for the most recent archiver and autosave version).


######### Protocol files #################
It is highly encouraged that you use the vacuum ioc module protocols. The preferred way to do this is to source them directly from the module (no copying).
Change this line in the st.cmd:
epicsEnvSet( "STREAM_PROTOCOL_PATH", "protocol" )
to this:
epicsEnvSet("STREAM_PROTOCOL_PATH", "$(VACUUM)/vacuumApp/protocols")

Delete the protocols from your protocol directories.

Note: Make sure envpaths is called before you set the protocol file path in the st.cmd. Otherwise the $(VACUUM) macro will be undefined.
########################################################



######### Modbus changes #################
Due to the modbus update some of the port setup has changed. An extra slave parameter is now available but if not configured will cause the port setup in the st.cmd
to fail. Add this parameter like so:
Before
drvModbusAsynConfigure("HXX_Xn_Bit","HXX:PLC:VAC",2,04000,96,0,100,"Koyo")
After
drvModbusAsynConfigure("HXX_Xn_Bit","HXX:PLC:VAC",0,2,04000,96,0,100,"Koyo")
##########################################



######### Gamma pump changes #############
Add the vacuum module root as the parent directory for the gamma pump db files:

old - dbLoadRecords("db/vac_pumps_serial.db", "micrc=CXI:R51:PCI,unitc=01,port=CXI:R51:PCI:01,micr1=CXI:DG1:PIP,micr2=CXI:DG1:PIP,unit1=01,unit2=02")

new - dbLoadRecords("$(VACUUM)/db/vac_pumps_serial.db", "micrc=CXI:R51:PCI,unitc=01,port=CXI:R51:PCI:01,micr1=CXI:DG1:PIP,micr2=CXI:DG1:PIP,unit1=01,unit2=02")

###########################################



**** Using the sync templates ****

1. Add the following to your st.cmd:  dbLoadRecords("$(VACUUM)/db/sync_master.db", "IOC=IOC:<hutch name>:VACUUM,scanRate='1 second',fastEvt=1,medEvt=2,slowEvt=3")
2. Edit all gauge controller sub files to use the sync templates (note there is a script for this), also you must now include the subfile events and phase, see example:
#################################

#==============================================================================
#
# Name: mks937a_R35-22a.substitutions 
#
# Macros:
#        IOC     : IOC Name
#==============================================================================
#
file sync_mks937a_serial.template
{
    pattern { controller       ,  port             , slowEvt, phase }
    	    { XPP:R35:GCT:22:A ,  XPP:R35:GCT:22:A,       3,     9 }
}

file sync_mks937a_serial_cc.template
{
    pattern { device        , port            , channel , slot, fastEvt, slowEvt }
	    { XPP:SB3:GCC:01, XPP:R35:GCT:22:A, 1, CC ,       1,       3 }
	    { XPP:SB3:GCC:02, XPP:R35:GCT:22:A, 2, A1,       1,       3 }
}

file sync_mks937a_serial_pr.template
{
    pattern { device        , port            , channel , slot, fastEvt, slowEvt }
	    { XPP:SB3:GPI:01, XPP:R35:GCT:22:A, 4, B1,       1,       3 }
	    { XPP:SB3:GPI:02, XPP:R35:GCT:22:A, 5, B2,       1,       3 }
}

##############################
3. Rebuild Db
4. Add this line to your st.cmd (replace IOC:XPP:VACUUM with the IOC name): 
dbLoadRecords("$(VACUUM)/db/sync_master.db", "IOC=IOC:XPP:VACUUM,scanRate='1 second',fastEvt=1,medEvt=2,slowEvt=3")
5. Remove all streamfix related items from the st.cmd and Db directory (makefile and other files).
5. Reload the IOC, all the MKS controllers should be perfectly happy now and never go bad!

**************************************


That should do it!

Now you don't have to keep the .template files for the vacuum devices in your IOC files. They will be sourced from this module,
which will make the vacuum IOC easier to maintain. Please remove the templates from the Db directory so they will be sourced from the module.

About

vacuum: Mirror for /afs/slac/g/cd/swe/git/repos/package/epics/modules/vacuum.git

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages