Edit configuration files in an installed version

Usually configuration files for the insertion device control program (IDCP) are created with the IDCP application an put on the bootserver host where the IOC loads them at startup.

Changes in these files that are permanent must always be made in the IDCP application or the StructuredData <https://yaml-structureddata.sourceforge.io/> parameter database. This requires building and installing a new version of idcp (see How to build and install IDCP).

Changes that are made for a short time and that are not intended to be permanent can be made by directly editing the configuration files on the boot server.

Attention

As said, if these changes are intended to be permanent, please contact the IDCP developer, currently Goetz Pfeiffer <goetz.pfeiffer@helmholtz-berlin.de>

The following text describes how to do that.

Attention

It is assumed that you are user “idadm” on host elbe.acc.bessy.de, stretch.acc.bessy.de or hscon1l.blc.bessy.de. Only for this user the commands will work. If you are in front of hscon1l and logged in as “hzb_user”, open a text terminal and enter “ssh idadm@localhost” first.

Step One, make a backup

Attention

This must be done before you start changing files on the bootserver.

This step is not just for backup, if you omit this , you will corrupt old IDCP software versions.

The technical reason has to do with the way rsync-dist.pl. works (“hard-links”). You can read further details in the documentation of the tool.

You perform a backup with the command:

idcp-dbd-backup.sh NAME

where NAME is any name that specifies an undulator like for example:

U49ID4R u49id4r U49-1:Bii7 u49-1:bii7 7 U49-1 u49-1 U49/1 u49/1 idcp7

The program will create one of these messages:

backups were created

or:

backups already existed

Both are okay. If you see a message like:

unknown undulator: NAME

you provided a NAME for an undulator that doesn’t exist and have to re-run the program.

Step Two, edit the files

Attention

“IDCPNAME” must be replaced with the idcp name for your undulaor in all of the text below. How to get IDCPNAME is described in “Step One” above.

You now have to log on to the bootserver:

ssh -X iocadm@nfs.blc.bessy.de

Then change to the dbd directory:

cd /opt/IOC/idcp/links/IDCPNAME/dbd

Here you may edit the files whose name starts with IDCPNAME.

Typically you want to edit the configuration file named IDCPNAME_config.tab, for example “idcp8_config.tab”.

You should use a simple editor, for example “nano” to do this. Move within the file with the arrow keys on your keyboard, save the file with “CTRL-X”.

Edit the configuration file for IDCPNAME with this command:

nano IDCPNAME_config.tab

After you are finished editing the file, leave this host with:

exit

Step Three, activate the changes on the IOC

All files are reloaded when the IOC is rebooted. You can, however, reload some of the files without rebooting the IOC.

Reload the configuration file idcpnn_config.tab

You can do this with a console command or by a “caput” to a certain record.

Reload with caput (preferred)

First get the devicename with this command:

iddb devicename UNDULATORNAME

Now enter these commands, DEVICENAME must be replaced with the undulator devicename (see above):

caget DEVICENAME:BaseCmnConfigure
caput DEVICENAME:BaseCmnConfigure.PROC 1
caget DEVICENAME:BaseCmnConfigure

If everything worked, the value returned by “caget” should have been increased by one.

Alternatively reload on the IOC console

You need the console name of the IOC, you get this with this command:

iddb console UNDULATOR

Now log on to the IOCs console with:

console CONSOLENAME

You must provide the password for user “tscadm” here, which which quite simple…

On the IOCs console enter:

configure()

Leave the console with:

CTRL-E c .

(Control-E c dot)

Reload the current correction tables idcpnn_gap2ccmm.tab

You can do this with a console command or by a “caput” to a certain record.

Reload with caput (preferred)

Enter these commands, DEVICENAME must be replaced with an undulator devicename e.g. “UE112ID7R”:

caget DEVICENAME:AcsLoad
caput DEVICENAME:AcsLoad.PROC 1
caget DEVICENAME:AcsLoad

If everything worked, the value returned by “caget” should have been increased by one.

Alternatively reload on the IOC console

Log on the IOCs console (how to use the console see above) and enter:

acs_reload()

Complete example

Here is an example for the UE112 undulator (idcp13) and it’s configuration file. Do NOT enter ‘~>’ and the text before, this is just the command prompt of the host:

hscon1l: ~> iddb prefix ue112
idcp13
hscon1l: ~> idcp-dbd-backup.sh idcp13
backups were created
hscol1l: ~> ssh -X iocadm@nfs.blc.bessy.de
iocadm@opic1l ~> cd /opt/IOC/idcp/links/idcp13/dbd
iocadm@opic1l ~> nano idcp13_config.tab

Now edit the file in nano, save with ctrl-X, then continue on the command line. “exit” is used to leave the file server host:

iocadm@opic1l ~> exit
connection to nfs.blc.bessy.de closed.
hscon1l: ~> iddb devicename ue112
UE112ID7R
hscon1l: ~> caget UE112ID7R:BaseCmnConfigure
UE112ID7R:BaseCmnConfigure     0
hscon1l: ~> caput UE112ID7R:BaseCmnConfigure.PROC 1
Old : UE112ID7R:BaseCmnConfigure.PROC 0
New : UE112ID7R:BaseCmnConfigure.PROC 1
hscon1l: ~> caget UE112ID7R:BaseCmnConfigure
UE112ID7R:BaseCmnConfigure     1