|
|
Experimental Physics and
| ||||||||||||||
|
|
(if somebody prefers to make the experience rather than reading do first dbLoadtemplate test1.subs second dbLoadtemplate test2.subs the short files are at the end of this longer mail) recentely I found a very strange behaviour of dbLoadtemplate.
For a special device the result of dbLoadtemplate had to look like:
record(mbbo,"test:CON-FUNC") {
field(ZSTR,""CURR:DC"")
.....
It is important that there are 2 qoutation marks just one after
the other at the beginning and at the end. I found no other solution
than to have a template file with
field(ZRST,"$(qm)CURR:DC$(qm)")and in the substitution file I put qm = '\"' This worked perfectely, the whole substituion file test1.subs is at the end of this mail: I got the request to add an other record, an easy job, I thought, but .... test2.subs is at the end of the mail, too and the result of dbLoadtemplate: in words: it did not substitute qm with " but with the rest of the file! (I put ">" to show that this is the output) >..... > > field(ZRST, ""'} > >{ NAME = X09LA-KCUR2 > GPNR = 11 > qm = '"CURR:DC"'}> > >{ NAME = X09LA-KCUR2 > GPNR = 11 > qm = '"") > field(ONVL, "1") >.... After playing around I found no other solution than to have 2 dbLoadtemplates, each one loding one record. Thanks for any hints Werner ************** files ************
test1.subs
>file test.template {
>{ NAME = X09LA-KCUR
> ADDR = L38940
> GPNR = 10
> qm = '\"'}
>}test2.subs
>file test.template {
>{ NAME = X09LA-KCUR
> GPNR = 10
> qm = '\"'}
>
>{ NAME = X09LA-KCUR2
> GPNR = 11
> qm = '\"'}
>}test.template
>record(mbbo,"$(NAME):CON-FUNC") {
> field(ZRVL,"0")
> field(ZRST,"$(qm)CURR:DC$(qm)")
> field(ONVL,"1")
> field(ONST,"$(qm)VOLT:DC$(qm)")
>}-- Dr. Werner Portmann, SLS computing and controls Paul Scherrer Institut, CH-5232 Villigen PSI tel + 41- 56 3104061 fax + 41 - 56 310 4413 e-mail: [email protected] http://people.web.psi.ch/portmann/
| ||||||||||||||
| ANJ, 10 Aug 2010 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |