TUM/E12
Benjamin.Sailer@ph.tum.de
Version: 0.2
-Date: 2001-02-19
+Date: 2001-03-31
allParam libraries
==================
server, which is contained in the HADES DAQ runctrl package, together with the
param library can be tested.
-2. How to install the allParam libraries
-----------------------------------------
+2. How to make and install the allParam libraries
+-------------------------------------------------
Retrieve the libraries via ftp from
-ftp://ftp.e12.physik.tu-muenchen.de/pub/hadsoft/allParam.0.2.tar.Z
+ftp://ftp.e12.physik.tu-muenchen.de/pub/hadsoft/allParam-0.2.tar.Z
and extract them to a directory of your own choice (which is only needed for
-building, testing and installing the libraries). Although the sources are also
-available via CVS, it is recommended to use only the tar archives, while CVS
-is reserved for the developers of the libraries (as the checkouts are logged
-by CVS).
+building and testing the libraries). Although the sources are also available
+via CVS, it is recommended to use only the tar archives, while CVS is reserved
+for the developers of the libraries (as the checkouts are logged by CVS).
Go into the extracted directory allParam and type
+$ make <lib>
+(where <lib> is one of 'ca', 'file', 'ora', 'psql' or 'tcl') to make a single
+library. As making all of them is not very likely, (you will use only some of
+them at all), this possibility is skipped in this version.
+$ make <lib>_test compiles the sources for the test an performs one. The
+results ca be seen in the files test/*_protocol.txt.
+$ make <lib>_install
+copies the libraries to $(LIBDIR) specified in the Makefile (usually
+$HOME/lib/$SYSTYPE or /usr/local/lib) an the headerfile allParam.h to $(INCDIR)
+($HOME/include or /usr/local/include).
$ make <lib>_all
-where <lib> is one of 'ca', 'file', 'ora', 'psql' or 'tcl', or simply
+does the same as
+$ make <lib> && make <lib>_test && make <lib>_install
+. Note that
+$ make <lib>_test
+and
+$ make <lib>_install
+depend on
$ make
-if you want to make them all. '_all' includes installation to your home
-directory respectively the subdirectories lib/$SYSTYPE and include as well as
-compiling and running a test suite in the subdirectory allParam/test. A
-protocol named <lib>_test_protocol.txt is created there but take care of the
-fact, that failures may come due to missing parameter sources - as mentioned
-above.
+so the libraries will be made automatically before testing or installing.
The usage of the enviroment variable $SYSTYPE applies to the fact that your
home directory may be available from different os' with different binary file
formats, which you should be able to use simultaneously. If you don't have this
tr -c [:alnum:] _)
export SYSTYPE
into your ~/.profile.
- If you want to install the libraries to another path (e.g. /usr/local/lib is
-foreseen, if you want to make the libraries available systemwide as root),
-the change of LIBPATH and INCPATH in the Makefiles is straight forward.
3. How to use the allParam libraries
------------------------------------
sources:
- Param_getStringArray() retrieves an array of strings,
+- Param_getFilename() is more specialized on strings representing files,
- Param_getIntArray() makes a conversion to unsigned long integers (if all
elements of the retrieved array can be converted properly; to decide this,
the C-function strtoul(3) is used)
-- Param_getString() and
+- Param_getString(),
+- Param_getFilename() and
- Param_getInt() are aliases that retrieve only a scalar value (the first
- element of an array)
+ element of an array),
+- Param_getBlob() allows to receive an open file stream to read data from.
Additionally, there are two functions that allow to store scalar values of
unsigned integers respectively strings to the parameter source. These functions
printf("%s(%s) : %s\n", name, idx2, valuei);
}
+/* Param_getFilename */
+ const char *name = "tname";
+ const char *idx3 = "tfile";
+ char valuef[PARAM_MAX_VALUE_LEN];
+ int row;
+ if(Param_getFilename(param, name, idx3, &row, valuef) != 0) {
+ sprintf(stderr, "%s : Param_getFilename() failed: %s",
+ argv[0], Param_getErrStr(param));
+ exit (-1);
+ } else if(row == 0) {
+ sprintf(stderr, "%s(%s) not found.\n", name, idx3);
+ } else {
+ printf("%s(%s): %s\n", name, idx3, valuef);
+ }
+
/* Param_getStringArray */
- const char *idx3 = "tstringa";
+ const char *idx4 = "tstringa";
char *valuesa[LEN];
int maxrows = LEN;
int rows;
exit(-1);
}
}
- if(Param_getStringArray(param, name, idx3, maxrows, &rows, valuesa) != 0) {
+ if(Param_getStringArray(param, name, idx4, maxrows, &rows, valuesa) != 0) {
sprintf(stderr, "%s : Param_getStringArray() failed: %s",
argv[0], Param_getErrStr(param));
exit (-1);
} else if(row == 0) {
- sprintf(stderr, "%s(%s) not found.\n", name, idx3);
+ sprintf(stderr, "%s(%s) not found.\n", name, idx4);
exit (-1);
} else {
for (i = 0 ; i < maxrows ; i++) {
- printf("%s(%s %d) : %s\n", name, idx3, i, valuesa[i]);
+ printf("%s(%s %d) : %s\n", name, idx4, i, valuesa[i]);
free(valuesa[i]);
}
}
/* Param_getIntArray */
- const char *idx4 = "tinta";
+ const char *idx5 = "tinta";
unsigned long int valueia[LEN];
- if(Param_getIntArray(param, name, idx4, maxrows, &rows, valueia) != 0) {
+ if(Param_getIntArray(param, name, idx5, maxrows, &rows, valueia) != 0) {
sprintf(stderr, "%s : Param_getIntArray() failed: %s",
argv[0], Param_getErrStr(param));
exit (-1);
} else if(rows == 0) {
- sprintf(stderr, "%s(%s) not found.\n", name, idx4);
+ sprintf(stderr, "%s(%s) not found.\n", name, idx5);
+ exit (-1);
+ } else {
+ for (i = 0 ; i < maxrows ; i++) {
+ printf("%s(%s %d) : %d\n", name, idx5, i, valueia[i]);
+ }
+ }
+
+/* Param_getFilenameArray */
+ const char *idx6 = "tfilea";
+ char *valuefa[LEN];
+ int maxrows = LEN;
+ int rows;
+ int i;
+ for (i = 0 ; i < maxrows ; i++) {
+ valuesa[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char));
+ if(valuefa[i] == 0) {
+ sprintf(stderr, "malloc() for value failed.\n");
+ exit(-1);
+ }
+ }
+ if(Param_getFilenameArray(param, name, idx6, maxrows, &rows, valuefa) != 0) {
+ sprintf(stderr, "%s : Param_getFilenameArray() failed: %s",
+ argv[0], Param_getErrStr(param));
+ exit (-1);
+ } else if(row == 0) {
+ sprintf(stderr, "%s(%s) not found.\n", name, idx6);
exit (-1);
} else {
for (i = 0 ; i < maxrows ; i++) {
- printf("%s(%s %d) : %d\n", name, idx4, i, valueia[i]);
+ printf("%s(%s %d) : %s\n", name, idx6, i, valuefa[i]);
+ free(valuefa[i]);
}
}
different value fields:
- Param_getString() needs a char *,
- Param_getInt() needs a unsigned long int *,
+- Param_getFilename() needs a char *,
- Param_getStringArray() needs a char** (which is not returned by
- char valuesa[PARAM_MAX_VALUE_LEN][LEN] !) and
+ char valuesa[PARAM_MAX_VALUE_LEN][LEN] !),
- Param_getIntArray() needs a unsigned long int *, too (but of course with
- LEN * sizeof(unsigned long int) allocated memory behind)
+ LEN * sizeof(unsigned long int) allocated memory behind),
+- Param_getFilenameArray() needs a char** (like Param_getStringArray() does) and
+- Param_getBlob() needs a FILE **
4. Known bugs and further developement perspectives
---------------------------------------------------
PARAM_MAX_NAME_LEN and PARAM_MAX_VALUE_LEN) is not checked in the testsuite
yet.
- EPICS has a much more strict limitation on the length of PV names (28
- including the prefix 'HAD:PARAM:'). So the full length of 127 + 127
+ including the prefix 'HAD:Px:<setup>:'). So the full length of 127 + 127
characters for name + idx cannot be used when including a libcaParam.a in the
- data path. Also libfileParam.a only supports an overall length of 127 for the
- string s when s is produced via sprintf(s, "%s(%s%d)", name, idx, i).
-- As a fifth data type, blobs (binary large objects) should be supported in the
- future.
+ data path. Although the test suite shows, that channel access may also work
+ with longer PV name lengths, the next version should take advantage of the
+ EPICS Release 3.14 which promises to skip this limitation officially.
+- Limitations on the size of blobs when they are transported via channel access
+ should no longer be valid in the next version.
+- Up to now no concept is found to easily use the correct set of libraries
+ depending on the host architecture and operating system. However, this should
+ be a general rule to be available for all the hades libraries.
-Please send bug reports to
+Please send further bug reports to
Benjamin.Sailer@ph.tum.de
TUM/E12
Benjamin.Sailer@ph.tum.de
Version: 0.2
-Date: 2001-02-21
+Date: 2001-03-31
allParam library Release Notes for Version 0.2
==============================================
> conParam(Param *),
that will be changed to the final
> conParam(Param *, const char *)
-in one of the next releases. For libfileParam.a and libtclParam.a, the setup
-is translated to file names. See the READMEs of those particular libraries for
-details.
+in one of the next releases.
+For libfileParam.a and libtclParam.a, the setup is translated to file names.
+See the READMEs of those particular libraries for details.
3. Storage of parameters
recent one (or at least sould do that). Like parameters to read, parameters to
write are identified by "setup", "name" and "idx".
-4. Test extension
+4. daq_*_param_cas
-The test suite has been extended to proofe the new features.
+From this version on, the package does not only contain the libraries for the
+channel access parameter source, but also the sources to build the server. This
+seems to be more consistent and allows testing for this special source without
+the requirement of a extern parameter server.
+
+5. Param_getFilename() and Param_getFilenameArray()
+
+Two new functions have been introduced that can be handled like the string-
+functions but give the user the possibility to change the prefix for all of
+them by editing just one line in the tcl-file. This is especially useful for
+moving files pointed to to another sub tree of the directory structure but
+not to be dependend on relative paths to these files.
+
+6. Param_getBlob()
+
+The possibility to transport binary data as a unit has been introduced. Up to
+now, this is realized as a file-stream and thus has no limitations for most
+of the parameter sources while caParam just allows sizes up to 16368 bytes
+(as a limitation of channel access). This limitation may be skipped in the
+next version.
+
+7. Test extension
+
+The test suite has been extended to proof the new features. Subdirectories,
+scripts before and after test execution allow more sophisticated tests, while
+the structure provides the flexibility to skip single tests without any changes
+in the sources (exept renaming the sources of the specified test).
Bugfixes:
---------