Aida Servers Developer's Guide

 

This page gives detailed instructions for the development of each Aida server. Basic development principles are covered in the Aida Development Environment guide.  

Starting a test NT based server

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. 


SLC Data Source Aida Server

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.

OBSOLETE

Directories Breakdown

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

On CVS (AFS): The command files used to build the executable code, and the .c and .java source files, are in CVS:

Development Procedure 

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. 

Summary development checklist 

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: 

SLC/EPICS Client/Server Alpha Basic Development Guidelines

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. 


EPICS Channel Access Aida Data Server

Directories Breakdown

The Aida ca data server is implemented by a java package and supporting c functions: 

  1. A java package (edu.stanford.slac.aida.ca), whose .java and .class files (no jar file as yet) are on AFS in afs/slac/package/aida/edu/stanford/slac/aida/ca. These are under the "edu" CVS  module; in directory edu/stanford/slac/aida/ca. An nmake compatible makefile makes this package - see below.
  2. Supporting c functions, source in afs/slac/package/aida/src/ca. These are under the "src" CVS module; in directory src/ca. A Solaris make compatible makefile makes the object and binary in that directory - see below. 

References

Original SLC/EPICS Client/Server NT Basic Development Guidelines

CVS for the java package edu.stanford.slac.aida.ca 

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:

Development procedure for the supporting c functions

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.

Development Procedure

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.

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:

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:

  1. You need a Java environment and the JDBC .zip file in your classpath

  2. Copy the Ca directory tree to your machine

  3. Copy SlacSca.dll to Winnt\system32 on your machine

  4. Copy CaRepeater.exe to your machine

  5. Set the EPICS environment variables via the Control Panel. Log in/out or do whatever to make sure they're set.

  6. Compile the Ca Java code

  7. Run the server java Ca.CaServer It should print a message after it's written its object reference to the Oracle database

  8. Run the client java Ca.CaClient to

 

 


Channel Arciver Data Source (CHADS)

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

  1. The standard epics extensions tree is replicated under /afs/slac/package/aida/src/epics.  That means that the standard epics make tools work when building CHADS.
  2. There are two executables provided.    ChadServer is the CHADS server.  ChadsClient is a test program for sending requests to CHADS for data independent of the other AIDA services (ie it sends a request directly to Chads and gets data back instead of going through the generic service).

Directories Breakdown

On CVS (AFS): The command files used to build the executable code, and the C++  source files, are in CVS:

Development Procedure 

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.

Summary development checklist 

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: 

Alpha Basic Development Guidelines

 


[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.