129 lines
3.8 KiB
HTML
129 lines
3.8 KiB
HTML
<HTML>
|
|
<BODY>
|
|
<PRE>
|
|
<!-- Manpage converted by man2html 3.0.1 -->
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
dbLoadRecords, dbLoadTemplate - load ascii database records
|
|
into an IOC
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
dbLoadRecords(char* db_file, char* substitutions)
|
|
|
|
dbLoadTemplate(char* template_file)
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
These routines are available from IOC core on the vxWorks
|
|
command line. Both provide a way to load ascii ".db" files
|
|
(usually created by <B>gdct(1)</B> ) into the IOC. The ".db" files
|
|
contain ascii versions of record instances and are described
|
|
in more detail in <B>dbfile(5)</B>. In addition to loading the
|
|
".db" ascii files into the IOC, both routines provide a
|
|
method of performing variable substitution on record names
|
|
and field values.
|
|
|
|
dbLoadRecords() reads the ".db" file <I>db</I>_<I>file</I> performing sub-
|
|
stitutions specified in string <I>substitutions</I>. The substitu-
|
|
tion must be a string specified as follows:
|
|
|
|
"var1=sub1,var2=sub3,..."
|
|
|
|
Variables are specified in the ".db" file as
|
|
$(variable_name). If the substitution string
|
|
"a=1,b=2,c=\"this is a test\"" were used, any variables
|
|
$(a), $(b), or $(c) would be substituted with the appropri-
|
|
ate data. See the EXAMPLES section for more details.
|
|
|
|
dbLoadTemplate() will read a <I>template</I>_<I>file</I>. The
|
|
<I>template</I>_<I>file</I> resides in the your IOC boot directory and
|
|
contains rules about loading ".db" files and performing sub-
|
|
stitutions. The template_file must be in the form used by
|
|
an IOC and is described in <B>templatefile(5)</B>. The EXAMPLES
|
|
section descibes how it can be used.
|
|
|
|
|
|
</PRE>
|
|
<H2>EXAMPLES</H2><PRE>
|
|
The next two examples of dbLoadRecords() and dbLoadTem-
|
|
plate() will use the following ".db" file named <I>test</I>.<I>db</I> :
|
|
|
|
database(test)
|
|
{
|
|
record(ai,"$(pre)testrec1")
|
|
record(ai,"$(pre)testrec2")
|
|
record(stringout,"$(pre)testrec3")
|
|
{
|
|
field(VAL,"$(STRING)")
|
|
field(SCAN,"$(SCAN)")
|
|
}
|
|
}
|
|
Running dbLoadRecords ("test.db","pre=TEST,STRING=\"this is
|
|
a test\",SCAN=Passive") will produce the following records
|
|
in the IOC's database:
|
|
|
|
TESTtestrec1
|
|
TESTtestrec2
|
|
TESTtestrec3
|
|
|
|
The third record will have VAL set to "this is a test" and
|
|
SCAN set to "Passive".
|
|
|
|
Running dbLoadTemplate ("test.template") with test.template
|
|
containing:
|
|
file test.db
|
|
{
|
|
{pre=TEST1, STRING = "this is a test two", SCAN="1 Second" }
|
|
{pre=TEST2, STRING = "this is a test one", SCAN=Passive }
|
|
{pre=TEST3, STRING = "this is a test three", SCAN=Passive }
|
|
}
|
|
will produce a total of nine records in the IOC's database:
|
|
TEST1testrec1
|
|
TEST1testrec2
|
|
TEST1testrec3 - (VAL="this is a test two", SCAN="1 Second")
|
|
TEST2testrec1
|
|
TEST2testrec2
|
|
TEST2testrec3 - (VAL="this is a test one", SCAN="Passive")
|
|
TEST3testrec1
|
|
TEST3testrec2
|
|
TEST3testrec3 - (VAL="this is a test three", SCAN="Passive")
|
|
|
|
|
|
</PRE>
|
|
<H2>NOTES</H2><PRE>
|
|
The binary file <I>default</I>.<I>dctsdr</I> must be loaded prior to run-
|
|
ning either of these routines. This file contains the rules
|
|
on how to construct records and change field values.
|
|
|
|
After the default.dctsdr file is loaded, these routines can
|
|
be run as many times as desired until iocInit is run.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<B>gdct(1)</B>, <B>templatefile(5)</B>, <B>dbfile(5)</B>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
<HR>
|
|
<ADDRESS>
|
|
Man(1) output converted with
|
|
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|