TOC PREV NEXT INDEX

Put your logo here!


2.4 CCS ENVIRONMENT

2.4.1 Purpose

The Central Control Software (CCS) consists of a collection of libraries, servers and utilities. The libraries provide a set of services to be used for SW development in a CCS environment covering program-to-program communications, data storage and retrieval, access control to hardware and/or software resources and user interaction with the VLT system. Purpose of the servers is to provide special services on application level.

The CCS is organized in software modules each providing specialized services. The first module called "ccs" provides the basic facilities to configure the necessary resources to get access to the different services provided by the other modules, in particular to the on-line database and the message system.

With the JAN06 release, support for multithreaded applications is provided by means of a dedicated library providing a thread safe version of the standard ccs functions and some additional functions to initiate new threads within a ccs environment.

Support for Unix real time priorities is also provided by the ccsScheduler which is now handling the corresponding configuration parameters from the ccsEnvTable.

2.4.2 Basic Concepts

CCS inherits from RTAP the concept of environment.

2.4.2.1 Definitions
· An Rtap environment is defined as a combination of RtapScheduler (An RTAP specific process), other RTAP processes, and applications, together with the communication channels and other resources which they share.(e.g. database)
· A CCS environment is basically an RTAP environment together with some CCS specific processes and Database structures used by these processes. CCS_LITE shares the same concept of environment. However in that case, Rtap processes are replaced by ccs processes, e.g RtapScheduler <-> ccsScheduler; RtapPerfMon <-> ccsPerfMon.
· The environment concept has been extended in a compatible way to the LCUs where RTAP is not available.
· Multiple environments can exist on several hosts or on a single host workstation, either independently or with their processes communicating.
2.4.2.2 Naming rules
· Each environment has a unique symbolic name.
· The name must follow the rules for environment names specified in the VLT LAN Specifications. All the rules apply, but the one interesting CCS are:
-- 7 characters (a-z,0-9) maximum.
-- First character is "l" for an LCU environment, "w" for a workstation environment.
· Environment names must be declared in the RtapEnvList according to Rtap rules. CCS_LITE uses a similar table: CcsEnvList located in $VLTDATA/config/. All environments to be accessed by a CCS_LITE environment must be declared there according to the same rules. This includes Rtap, CCS_LITE, and LCU environments.

2.4.3 Functions

With the present release of CCS_Lite, 2 new tools are delivered:

· CcseiDb, a database browser allowing to verify the database structure and content. In order to enforce the configuration control rules, , it is not permitted to modify on-line the database structure. This tool is described in a dedicated user manual[21]
· ccsMongui, a grapical user inteface to an environment monitoring tool replacing the old ccsPerfMon and extending its basic capabilities. Usage of the monitoring tools is described in a dedicated document[22]

The CCS library grants the applications programmatic access to the different resources such as:

· connecting to an environment,
· getting a message queue for the message system,
· allocating and releasing necessary memory resources,
· declaration of the signal handlers for special commands,
· use of the Rtap and CCS environment variables.

The following functions are provided in this release:

ccsExit Performs cleanup operations before exiting a process. Any message still present in the input queue is removed. Found commands are answered with an error reply, all other messages are simply discarded.
ccsFindFile Searches for a file in the VLT file system hierarchy.
ccsGetMyEnvName Returns the name of the environment a process is registered with.
ccsGetMyProcId Returns

- the name by which a process is registered with the environment

- its process number

- and the environment.

ccsGetProcName Returns the process name for the indicated process from the environment
in which it is running.
ccsGetProcNum Returns the process number of a process.
ccsInit Initializes resources necessary for further access to CCS.
It is MANDATORY to call ccsInit once at the beginning of any CCS.
application, before calling any other CCS function.
ccsOpenFile Open a file taking into account the CCS environment variables VLTROOT
and INTROOT as part of the search path.

Additional functions for multithreading support (Available in the threadsafe version of the ccs Library: libCCS_P.lib):
ccsPthreadInit initializes the CCS multithreading services and registers
the main (calling) thread with the local environment. This function has to
be called before any other CCS function. It is important, that the main
thread calling this function terminates last.
ccsMPthreadCreate starts a new thread registering with the local environment.
This generates the assignment of a new message queue for
the new thread which will become addressable like a standard
standalone CCS application. This is the mode to be used for
threads accessing CCS resources like message system and database.
ccsPthreadCreate starts a new thread sharing the CCS resources and message
queue of the main thread allocated by ccsPthreadInit().
This thread cannot be individually addressed from other
CCS processes.

Other utilities:

ccsWaitForProc To be used in scripts to verify when a process has reached a given state
regarding the reception of messages: REACHABLE, ANSWERING, EXIT.

Additional utilities provided with CCS_Lite:

ccsScheduler To start a CCS_LITE environment.
ccsShutdown To stop a CCS_LITE environment.
ccsPerfMon To monitor a CCS_LITE environment.
ccsNextPhase To be used in the CcsEnvTable when environment startup is split in phases;
can also be used in RtapEnvTable under Full CCS..
ccsCmdServer CCS_Lite daemon to execute commands on a time basis or event driven.
ccsRunCmd In CCS_lite, to execute a command as if started by the ccsScheduler..

2.4.4 Examples

See examples in other sections for use of the ccs functions.

2.4.5 Configuration

In order to access a CCS environment, one has first to configure the corresponding CCS_Lite/Rtap environment, and then make the CCS specific applications available to that environment.

It is assumed hereafter, that the reader is already familiar with the RTAP or CCS_Lite terminology, and that the CCS_Lite or the RTAP software has already been successfully installed according to the respective installation procedures.

2.4.5.1 Configuration of the CCS environment

A minimum environment is delivered with CCS. To operate it, proceed with the following steps:

1. Rename the minimum environment according to your application, in accordance to the rules given in the VLT LAN Specifications. This name will be represented hereafter with <envName>
2. Declare the necessary environment variables:
· RTAPROOT The existence of this environment variable depends on the installation. It must be defined only when full CCS, based on Rtap, is installed. In the CCS_LITE case, it must remain undefined. It is Pointing to the directory Rtap is installed on, normally set to: /opt/rtap/A.06.70
· RTAPENV set to the name of your CCS environment <envName> . Must be defined both for CCS and CCS_LITE environments.

3. Include the following directory in your path (FULL CCS only):
· $RTAPROOT/bin

4. Declare your environment in the $RTAPROOT/etc/RtapEnvList (FULL CCS) or $VLTDATA/config/CcsEnvList (CCS_LITE)
This entry must point to the directory containing the RtapEnvTable file delivered with CCS, or the CcsEnvTable for CCS_LITE environments.
This directory will become the RTAPDIR after environment start-up.

Example:
<envName> <VLTDATA>/ENVIRONMENTS/<envName>

Remote environments located on LCUs or Workstations, and communicating with the local one must also be declared with similar entries such as:

<envName> <hostname>

5. The following shows an example of template for the RtapEnvTable pointed to by the entry in RtapEnvList.
#************************************************************************
# NAME
# RtapEnvTable.normal - rtap environment table
#
# SYNOPSIS
# $VLTROOT/ENVIRONMENTS/<envName>/RtapEnvTable
#------------------------------------------------------------------------
#
# P R M C G S P C
# R E U L E H R O
# O P U S L E T U I M
# C H S T T A O T O M
# N A E A I N B D R A
# U S R R P U I W T N
#_ M_ E_ ?_ T_ L__P_ T__ N__ Y___ D_______________________________________
#
# These are the core processes which I will always want to run.
1 0 N N N N N 100 128 RtapScheduler
2 1 N P N N Y 99 128 RtapMonitor -a -s > rtap_log 2>&1
3 1 N P N A Y 100 128 RtapQServer
4 1 N N N A N 80 128 RtapEventTrig
5 1 N N N A Y 80 128 RtapEventConfg
6 1 N E N A Y 80 128 RtapTimeKeeper
#
# First thing for CCS: setup of the shared memory area.
0 1 Y N N A N 100 128 ccsSHManager -s 20000
#
7 1 N N N A N 1 128 RtapDbStartup
#
#RtapDbStartup requests to proceed to next phase. i.e. phase 2
58 0 N E N A N 80 128 RtapMQDBM
9 2 N Y N A N 1 128 RtapDbCfServer
#
# Miscellaneous Tasks which may have to be performed.
0 2 N P N N E 100 128 logManager
#
# WARNING: On empty databases the RtapScanMngr MUST be started with -f 300
# Later on, once scan configuration has been performed, a factor -f 4 is enough.
# When more scan links will be used, this might have to be reduced again.
10 2 Y N N A N 20 128 RtapScanMngr -f 300
# To be tried after confirmation of necessary space
# 10 2 Y N N A N 20 128 RtapScanMngr -f 4
#
# CCS tasks
11 0 Y N N Y Y 1 128 ccsScan
0 0 Y N N Y Y 1 128 scanOut
0 0 N N N N N 1 128 scanConfig
0 2 Y E N A N 100 128 envsKill
13 2 N N N A N 100 128 msgServer
14 2 N P N N N 100 128 cmdManager
0 0 N N Y A N 100 128 cmdSetup
0 0 N N N Y N 100 128 accServer
0 0 N N N N N 100 128 bookServer
#
# Rtap utilities
# New Rtap processes for handling of alarms have been added hereafter.
# Once the environment is started, an alarm display can be invoked with
# one of the run strings:
# history mode: RtapASDisplay -c -H 40 -F All &
# summary mode: RtapASDisplay &
15 2 Y P N A N 100 128 RtapASServer
0 0 Y N N A N 100 128 RtapASDisplay
#
# The next entry is for logging of alarms.
# REMARK: RTAP must be able to create/write the file "alarmsLog" in the environment directory.
16 2 N N N A N 100 128 RtapASLogger -f alarmsLog -F All
#
0 0 N N N A N 1 128 RtapDbConfig
0 0 N Y Y A N 1 128 RtapPtDisplay
0 0 N Y Y A N 1 128 RtapPtSelector
0 0 N N Y A N 1 128 RtapDbLoader
0 0 N N Y A N 1 128 RtapDbUnloader
0 0 N Y Y A N 1 128 RtapPlotDisp -s -p -q
#
# Applications
#
0 0 N N N N N 1 128 dbRead
0 0 N N N N N 1 128 dbWrite
#
#___oOo___


6. CCS_Lite example:
The second example shows a similar file, called CcsEnvTable, sharing the same syntax, needed for CCS_LITE environments. The following features are now supported with the JANUARY 2006 release:
· . real time priorities are taken into consideration. The values and ranges being different on HP, Solaris and Linux Operating systems, ccs recognizes values ranging from 0 to 99, 0 being the lowest priority. This value from the CcsEnvTable is remapped into the corresponding OS range. By default, the ccsScheduler ignores Real Time priorities. To operate an environment with Real Time priorities, the ccsScheduler must be satred with option -R
· . Shutdown sequence is now considered. When shuting down an environment, the ccsScheduler sendsthe termination request to processes with highest number first, and lowest number last.
The envs module provides a default template for the CcsEnvTable file with proper configuration values for the ccs processes. This file is automatically used by the standard tools to generate environments, if not replaced by a user provided file. In that case, the user is responsible for providing correct values in the shutdown column. On the Linux platform, incorrect configuration might result in difficulties to release the system resources when the environment is shut down.


#*****************************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: CcsEnvTable,v 1.43 2002/02/07 10:44:47 vltsccm Exp $"
#
#------------------------------------------------------------------------
#
#
# P R M C G S P C
# R E U L E H R O
# O P U S L E T U I M
# C H S T T A O T O M
# N A E A I N B D R A
# U S R R P U I W T N
#___M__E__?__T__L__P__T____N___Y____D_______________________________________
#
# These are the core processes which I will always want to run.
#
1 0 N N N N N 100 128 ccsScheduler
2 1 N N N N N 100 128 ccsSHManager -s 20000
0 1 N N Y N N 100 128 ccsNextPhase -t 3
0 2 N N N N N 100 128 dbStartup
58 0 N N N Y Y 100 128 dbMQDBM
3 2 N N N Y Y 100 128 qsemu
5 2 N N N Y Y 100 128 timsTimeKeeper
0 3 N N N N N 100 128 cmdManager
0 3 N N N N N 100 128 msgServer
0 3 N P N N Y 100 128 logManager
4 3 N N N Y Y 100 128 evtEventConfg
8 3 N N N Y Y 100 128 ccsCmdServer
9 3 N N N Y Y 100 128 alrmServer
#
# Scan System
#
6 3 Y N N Y Y 1 128 scanMngr
7 0 Y N N Y Y 1 128 ccsScan
0 0 Y N N Y Y 1 128 scanOut
0 0 N N N N N 1 128 scanConfig
#
# Process that handle plot & history tables
#
0 3 N N Y N N 100 128 ccsNextPhase -t 30
17 4 Y P N A N 50 128 hisDHMngr
#
# Applications
#
0 0 N N Y N N 1 128 dbRead
0 0 N N Y N N 1 128 dbWrite

# sequencer-shell that care about obituaries
0 0 N N Y Y Y 1 128 seqObituary


#
#___oOo___


7. Allocate a unique tcp port number to your environment, and declare it in the /etc/services file to make your environment known to the external world. The entry must look like:

<envName> nnnn/tcp # CCS environment for application xxxx

The number <nnnn> is the tcp port number used by the (Rtap)QServer.

Accordingly one entry must exist for each LCU respectively WS environment your environment will have to communicate with.
2.4.5.2 CCS specific configuration
1. Some more environment variables must be declared for the different parts of CCS. The Logging system requires VLT_ROOT_LOG and VLT_LOG_FILES to be defined. See the logging system section of this manual for their definition.

2. The PATH variable must include the path of the directory containing the executable files before the CCS environment is started. All executables of the VLT software are installed in $VLTROOT/bin. If necessary, add also <module>/bin and $INTROOT/bin.
2.4.5.3 Starting the environment

The following command is valid for the minimum environment and for simple test purposes:

· FULL CCS: >RtapScheduler -e <envname> &
· CCS_LITE: >CcsScheduler -e <envname> &

Wait for the environment to be ready, and check in rtap_log alternatively ccs_log file if everything started properly.

The rtap_log file is located in the RTAPDIR defined for that environment. Similarly, the ccs_log exists under the environment directory for CCS_LITE.

2.4.5.4 Application dependent configuration

The application is made of additional processes to be run within the environment (possibly other environments) and data to be stored in the on line database.

Additional processes to be started within the environment automatically or not must be added to the Ccs/RtapEnvTable and the different field described above configured as necessary.

The database is populated with user defined points described in dbl files stored in the $VLTDATA/<environment>/dbl directory. The dbLoader transforms these files into a DB directory tree containing the point configuration files according to the Rtap syntax. The generated point configuration files are then automatically loaded into the online database at environment startup. Read the dbStartup/RtapDbStartup man pages for a detailed description of the loading process, in particular with respect to existing snapshots.

2.4.5.5 Resources configuration

This chapter concerns only Rtap based configuration, i.e. Full CCS. The environment delivered with CCS is really a minimum environment. If your application makes extensive use of the message system, you better increase the resources allocated for your environment (see RTAP Reference Manual, Volume 1).

The following setup is recommended, if applications heavily loading the message system will be started:

>RtapScheduler -e <envName> -g 1024 -m 256&

NOTE: The possible ranges of these values depend on the configuration of your UNIX kernel. In order to use the values above, the following settings are necessary:

· msgssz = 64
· msgtql = 1024
· msgseg = 4096

2.4.6 Reference

Rtap ordering information.

The minimum configuration to support and configure a CCS environment is:

· RTAP/Plus software for HP9000 Series 700 workstations. Release 6.7 for HP-UX 10.1.
HP Product Number: B2771A

Or

· RTAP/Plus software for Sun SPARC station workstations. Release 6.6.
HP Product Number: B2774A

The following options must be ordered:

· UAU RTAP Basic run time.
· 100 Data collection.
· 208 Data base capacity 8 kilopoints.
· 500 Display tools.
· 600 Configuration tools.
· 900 Program development.
· AAH Software on DAT/DDS.

One set of manuals is part of the option 900.



Quadralay Corporation
http://www.webworks.com
Voice: (512) 719-3399
Fax: (512) 719-3606
sales@webworks.com
TOC PREV NEXT INDEX