This page gives detailed instructions for the development of each Aida server. Basic development principles are covered in the Aida Development Environment guide.
To start a development version of an Aida server, in preference to a production one, just redefine AIDAROOT before running the Start<servername>Server.bat file. Eg;
C:\dev\aida>set AIDAROOT=c:\dev\aida C:\dev\aida>%AIDASCRIPT%\StartGenericServer.bat
Then start or restart all servers which depend on the test server you brought up, so that they get a new proxy objct reference. You must wait until you get the "Server Ready" message before you can start other servers or clients of your test server. So, once Generic Service has started you must then start Da server:
C:\>%AIDASCRIPT%\StartDaServer
Bear in mind that, as implemented, you can run a test server without bringing down an existing server of the same interface, clients which were using the existing interface proxy will continue to use the existing one.
Note, if you want to start the test server through the IMR, there is a another procedure.
This documentation has been moved to the new labour section.
The files in DATA_DISK_SLC:[SLC.AIDA] are prototypes and should be deleted when the new labour style SLC server is in production. I'll leave the following obsolete documentation here for now.
ON VMS: The SLC data source production executable code is on VMS in the directory DATA_DISK_SLC:[SLC.AIDA]. That directory contains the Aida SLC data source package edu.stanford.slac.aida.slc in a subdirectory [.EDU.STANFORD.SLAC.AIDA.SLC]. ie
- Aidashr.exe shareable image
- AIDA_SLCSRC_GLOBALS_OPTION.OPT the linker options file created by scan_globals_for_options.com (which is part of the build process)
- [.EDU.STANFORD.SLAC.AIDA.SLC] - the .class files of the Aida slc data source servant (source .java files are in CVS).
- EDU_STANFORD_SLAC_AIDA_SLC_SLCI_0005FIM.H;1 - the prototypes file created by javah (necessary for jni).
On CVS (AFS): The command files used to build the executable code, and the .c and .java source files, are in CVS:
Create a development directory on VMS, to hold development version of the
things in DATA_DISK_SLC:[SLC.AIDA]. Alos create the following
subdirectories from the development directory.
[.edu.stanford.slac.aida.slc] and
[.edu.stanford.slac.aida.util] (since SLC uses util).
You'll need the util package class file until we create a .jar for it instead.
Then ftp the .java source files from the production (/package/aida/...) directories into these development subdirectories and edit them.
having FTPed the files into the appropriate directories you need to compile al of the java code (javac), create the c language prototype file for the JNI interface between SlcI_impl functions, and their implemetnation in Aidashr (that's done by javah), and then compile the c functions and link Aidashr.exe (done by @MAKE_AIDASHR).
MCCDEV> javac @slc_javaclist.list MCCDEV> javah -jni "edu.stanford.slac.aida.slc.SlcI_impl" MCCDEV> del AIDA_SLCSRC_GLOBALS_OPTION.OPT;* MCCDEV> @MAKE_AIDASHR.COM DATA_DISK_SLC:[SLC.AIDA]DB_JAVA.OBJ;8 DATA_DISK_SLC:[SLC.AIDA]DB_JAVA_HELPER.OBJ;8 %DCL-I-SUPERSEDE, previous value of AIDASHR has been superseded MCCDEV> java "edu.stanford.slac.aida.slc.Server" Server ready
References:
The SLC data source production directory is at DATA_DISK_SLC:[SLC.AIDA]. This contains the build tools to make the .java files and create Server.class (the SLC data source servant) and the shareable aidashr.exe which the servant uses to access SLC data.
The Aida ca data server is implemented by a java package and supporting c functions:
References
Original SLC/EPICS Client/Server | NT Basic Development Guidelines |
Create a directory that will contain your MS C++ project (in this case the directory created was dev\aida)
Then to check out only package ca:
To generate the CORBA interface files, cd ..\..\..\.. and then:
C:\dev\aida>jidl --prefix-package ca edu.stanford.slac.aida I:\package\aida\idl\ca.idl
To build all of the java class files. I started a new Microsoft J++ project in C:\dev\aida, added I:\package\aida to its classpath (from within project settings) and then built the project.
To generate the JNI include file, run javah:
To release only the ca package:
The supporting c functions which interface the ca package to Channel Access, must be build on Solaris. So, on Solaris first CVS checkout the src module:
flora03> cvs co src
Make changes to source code, then make local development versions of libraries and executables with the makefile provided:
flora03> cd src/ca flora03> make
Obviously, if you created any new modules, add them to the makefile and cvs add them to our CVS repository.
When you have finished local development, CVS commit your changes, and cvs update the reference directory
flora03> cvs commit flora03> cvs update -dA $AIDA/src
Finally, from aida/src/ca, run 'make install' which will compile what you have now released and will update the production version of the libraries and binary in the Aida production area (aida/sun4/lib and aida/sun4/bin respectively).
flora03> cd $AIDA/src/ca flora03> make install
If all went well, don't forget to cvs release src.
First I'll review the files and then try to remember all of the steps to get Channel Access to run on an NT. First the files.
allca.lis compiles everything with javac @allca.lis
Ca.idl is the idl file
Ca_CaI_0005fimpl.h is generated by javah
caRepeater.exe Channel Access repeater. I got this pre-built from (Berkeley?) a long time ago and I've seen it hang so you may want to try a later version.
SlacSca.dll This is my version with the required JNI entry points. You need to put this in Winnt\System32 for it to be found.
Again this has all of the Java code. I put the JNI C code right in the SlacSca.dll.
2.1 Rebuilding SlacSca.dll SLAC Simple Channel Access
This might be hard. I have a set of Visual C++ projects in a workspace on my C drive and the files are backed up in Clearcase. It's called CCAS_View and I've copied this whole directory structure to the dropbox but have no idea how it might work with all the files moved. It's got a bunch of my old C++ experiments in it too so there's a lot of useless stuff. Better too much than too little. If you get it open, the project with the current SlacSca is called Scadll. Good luck!
Wouldn't be much of a problem with plain files and make files but IDEs are another story. I guess I'm just an old command-line device-driver kinda guy.
2.2 Setting up Channel Access on your NT
You need to define the standard EPICS environment variables. Here's how they're defined on my machine to access the BIC and I forget what else:
EPICS_CA_ADDR_LIST 134.79.48.11 134.79.158.27 134.79.51.47
EPICS_CA_AUTO_ADDR_LIST NO
EPICS_CA_REPEATER_PORT 5069
EPICS_CA_SERVER_PORT 5068
See Stephanie or Jingchen if you need help with the IP addresses.
2.3 In Summary
Here's what I think the steps are, assuming you don't try to rebuild SlacSca:
You need a Java environment and the JDBC .zip file in your classpath
Copy the Ca directory tree to your machine
Copy SlacSca.dll to Winnt\system32 on your machine
Copy CaRepeater.exe to your machine
Set the EPICS environment variables via the Control Panel. Log in/out or do whatever to make sure they're set.
Compile the Ca Java code
Run the server java Ca.CaServer It should print a message after it's written its object reference to the Oracle database
Run the client java Ca.CaClient to
CHADS is an epics extension which runs on solaris. To build it, use gmake on any public unix machine (like flora).
There are two issues to keep in mind about CHADS
On CVS (AFS): The command files used to build the executable code, and the C++ source files, are in CVS:
Create a unix AFS development directory somewhere that you're comforatable with (mine is ~ronm/dev). This will hold development versions of the chads source files. Then, use CVS commands to checkout the source files from the directories listed above into your development directory. Then, modify those files as you need to. Then, do a gmake in your chads development directory. Run the server from your development directory until you are happy with your changes. Then, return the source files you modified to the CVS repository.
cd to your development directory (e.g. cd ~ronm/dev/aida)
Set up your environment like this (order is important so env
variables don't get clobbered)
source /afs/slac/g/pepii/ctrl/prod/bin/solaris/epicsSetupDev
source /afs/slac/package/aida/common/script/aidaSetEnv.sh
Check out the CHADS source like this:
cvscheckout src/epics/extensions/src/chads
Having checked out the CHADS source into your development
directory, you will have a tree that looks like this:
~ronm/dev/aida/src/epics/extensions/src/chads
Set up a link within that path (in the extensions subdirectory)
so that the CHADS epics extension makefiles can find the epics environment.
cd ~ronm/dev/aida/src/epics/extensions/
ln -s /afs/slac/package/epics/R3.13.2/base/config config
cd to the end of that chads development path (e.g. cd ~ronm/dev/aida/src/epics/extensions/src/chads) and modify the files you want to.
Execute gmake in order to build your development executables. At this time, the executable will be placed in production /afs/slac/package/aida/@sys/bin (This should be changed when we determine more about the development environment).
Run the server you just created in one window and the test
client in another:
/afs/slac.stanford.edu/package/aida/@sys/bin/ChadServer
/afs/slac.stanford.edu/package/aida/@sys/bin/ChadsClient
After you're satisfied, return the source to CVS and do a gmake
in the production directory:
cd /afs/slac/package/aida/src/epics/extensions/src/chads
gmake
References:
[Aida Home Page][SLAC Controls Software Group][ SLAC Home Page]
Author: Greg
White, 15-Jul-2001
Modified by: Ron MacKenzie,
19-Apr-2002 --- Added CHADS server.