/extensions/bin/linux-x86 by default.
10. Build the TCS and IT IOCs
When running the makeBaseApp.pl, make sure you use the full path name to the perl script or you will get errors that it cannot find various files when you do the gmake.
Multiple IOCs can be setup in the same manner. The LBTO IOCs are called tcsioc (for TCS services) and itioc (for server alerts). In the LBTO
case, the following was done.
cd <top>
<top>/base-3.14.12.4/bin/linux-x86_64/makeBaseApp.pl -t example tcsioc (This IOC is called "tcsioc".)
<top>/base-3.14.12.4/bin/linux-x86_64/makeBaseApp.pl -i -t example tcsioc (Do not enter an "Application name" when prompted.)
gmake
and
cd <top>
<top>/base-3.14.12.4/bin/linux-x86_64/makeBaseApp.pl -t example itioc (This IOC is called "itioc".)
<top>/base-3.14.12.4/bin/linux-x86_64/makeBaseApp.pl -i -t example itioc (Do not enter an "Application name" when prompted.)
gmake
Be careful after having made the IOC. If you make again after altering the base build, you will blow away any subsequent modifications you have made!
11. Following the standard procedure:
cd iocBoot/itioc
chmod +x st.cmd
cd../tcsioc
chmod +x st.cmd
These files will be superseded in Step 12.
12. The LBTO-specific files stored in SVN are layered on top of the EPICS build. The SVN files include setup scripts, service scripts, and an "ALH" script used to launch the ALHGUI. Update or check out the alh trunk in order to get the latest version of the files. Since this is the "build" location, the trunk directory should not be deleted as one can then easily tell which LBTO-specific files have been updated since the last build.
cd <top>
svn co https://svn.lbto.org/repos/alh/trunk
or
cd trunk
svn update
cp <top>/trunk/itioc/* <top>/iocBoot/itioc/.
cp <top>/trunk/tcsioc/* <top>/iocBoot/tcsioc/.
cp <top>/trunk/itiocApp/src/* <top>/itiocApp/src/.
cp <top>/trunk/tcsiocApp/src/* <top>/tcsiocApp/src/.
cp <top>/trunk/GATEWAY.access <top>/bin/linux-x86_64/.
The first two commands will copy the it.cmd and tcs.cmd files which supersede the corresponding st.cmd file in the respective directories. Also, the envPaths files will be put into the boot directories. The next two commands copy the ioc main programs, itiocMain.cpp and tcsiocMain.cpp, as well as their respective Makefiles into the proper directories. While the systems are in transition from 32-bit to 64-bit, one will probably have to edit the first line of the it.cmd and tcs.cmd files to ensure the 64-bit binary directory is used. The first line should refer to "linux-x86_64" and not "linux-x86". The paths in the envPaths file will probably also need to be updated for the destination machine (three paths will probably need to be changed).
13. The tcsioc obtains TCS Data Dictionary values via the Data Dictionary Service (DDS). There are Ice files in SVN which are needed to support the tcsioc. On the 64-bit machine, you should use version 3.5.1 version of Ice. As such, the Makefile has to be modified to use the newer version. Edit two of the last three lines in the tcsiocApp/src/Makefile such that they look like this:
ICE_HOME:=/lbt/tcs_runtime/Ice-3.5.1
USR_INCLUDES+=-I$(ICE_HOME)/include
USR_LDFLAGS+= -L$(ICE_HOME)/lib64 -Wl,-rpath,$(ICE_HOME)/lib64 -lIce -lIceUtil
There are three changes which have been made in contrast to the 32-bit Makefile.
14. Now build the tcsioc.
cd <top>/tcsiocApp/src
svn export https://svn.lbto.org/repos/tcs/trunk/dds/ice/DDSServer.ice
svn export https://svn.lbto.org/repos/tcs/trunk/dds/ice/Factory.ice
/lbt/tcs_runtime/Ice-3.5.1/bin/slice2cpp DDSServer.ice
/lbt/tcs_runtime/Ice-3.5.1/bin/slice2cpp Factory.ice
gmake clean
gmake
15. Now make the itioc which reads its channel information from an ASCII text file, /lbt/data/logs/zabbix/zabbix_alerts.log, on tcs64-1 (this is being set up as of 10 July 2015).
cd <top>/itiocApp/src
gmake clean
gmake
16. Copy the ancillary scripts into the <top> directory from the SVN checkout so these files can be packaged with the rest of the code for the destination system. Please be aware that you may have to change some directory paths in all of these files to be the proper place on the destination system.
cd <top>
cp trunk/setup.sh . (for now this is the same as setupBuild.sh with an extra line to define ZABBIX_DIR)
cp trunk/ALH . (check setup script being sourced)
cp trunk/epics-iocs . (check EPICSDIR)
17. Create a subdirectory for the LBT ALH support files:
mkdir LBTALHSupport
cp trunk/LBTALHSupport/* LBTALHSupport/.
18. Make a tar file of the LBT ALH configuration files. This step is currently obsolete.
cd trunk/LBTALHConfigure
tar cvpf ALHConfigureDDMMM.tar ALH*.alhConfig
mv ALHConfigureDDMMM.tar ../../.
19. Create a tar of the entire build.
cd .. (This is one directory above <top>.)
tar cvpf EpicsIOC10July2015.tar epics
20. Logon to the destination machine as user ioc and unpack the tar file. (13 Juy 2015: I had to login to tcs64-1 as user tcs, copy the tar file and put it into /lbt. I then unpacked it as user ioc.)
ssh -X ioc@tcs64-1.mountain.lbto.org
cd /lbt
scp tcs@tcs-test.tucson.lbto.org:/home/tcs/ioc/EpicsIOC10July2015.tar
tar xvpf EpicsIONC10July2015.tar
Once the "epics" directory is created in /lbt, delete the tar file.
21. Now check the following
- EPICSDIR is set correctly in the
epics-ioc
service startup file
- check the setup.sh file EPICS_HOME variable is set correctly for the destination directory
- check the ALH script has the correct address for the setup.sh file (ALH is still being run from the 32-bit machines pointing to a different home directory.)
- delete the trunk directory
- delete all tar files in /lbt/epics
- make sure the iocBoot/[it|tcs]ioc/envPaths file is set correctly
- make sure the LBTALHSupport/ice.cfg file has the correct IP (or server name) where the dds is running
22. The public EPICS/ALH configuration files must be put in the public directory which is currently "/home/telescope/TCS/Configuration/ALH". The files here may or may not need to be updated.
su -l telescope
cd /home/telescope/TCS/Configuration/ALH
cp /lbt/epics/ALHConfigureDDMMM.tar .
tar xvpf ALHConfigureDDMMM.tar
This will have created a directory, LBTALHConfigure, whose contents are the ALH configuration files for the entire system.
23. Create an ALH link in /lbt/astronomy/bin. This is already done on the obs (32-bit) machines.
cd /lbt/astronomy/bin
ln -s /lbt/epics/ALH ALH
Before the tcsioc is started, you need to make sure the IP which is associated with the TCS Data Dictionary Service (DDS) is set properly. This value is set in a "private" ALH configuration file, ice.cfg, which is located in the directory associated with the EPICS variable LBTALHSupport.
24. Finally, put the epics-ioc
in /etc/init.d as user ioc.
cd /etc/init.d
cp /lbt/epicsv1.0/epics*service .
25. The IOCs can be started by the service or manually (if necessary). It is best to start/stop the IOCs via the service. As user ioc
or tcs
on host ioc
(aliased to tcs1 or tcs2), type
sudo systemctl start epics-ioc
Note: The TCS IOC writes information to SYSLOG (local 6) which is also written to stdout.
26. Execution - The ALH GUI is only available to run on 32-bit machines (obs for example). Log in to obs and run ALH
. Only the telescope
user has permission to write to the log files and has permission to acknowledge alarms.
Note: To run an alarm handler on a different machine than the one running the ioc, set EPICS_CA_ADDR_LIST environment variable to the IP address of the gateway, with the correct port.
export EPICS_CA_ADDR_LIST "192.168.3.16:5066"
Stop and start the TO's ALH running on obs1:
ssh -X telescope@obs1.mountain.lbto.org
setenv DISPLAY :0
ALH &
27. Once the IOC is running, use caput and caget to see variables. For example:
source /lbt/epics/setup.sh
caget lbc:side0:dewarTemp (to see LBC dewar temp...doesn't work on binary vals....not sure why)
caput your_fav_var value (to change the vars...works for all types)
28. Initialize channels that are only written periodically.
The IT channels are only written when a change occurs, so they need to be initialized when the IOC is restarted. ssh telescope@obs3.mountain.lbto.org
setITChannels.sh
The MODS instrument channels are only written every half an hour, so the script should be run when the IOC is restarted to get the values and initialize the channels.ssh telescope@obs3.mountain.lbto.org
emailMODSErrors.sh
emailMODS2Errors.sh
Some helpful links....
-- %USERSIG{MicheleDeLaPena - 2015-07-10}%