Obtaining the sources
1) Check out the source from the svn. The repository is https://redoubt.ligo-wa.caltech.edu/svn/advLigoRTS/trunk
2) Change the approriate makefile in cds/advLigo/config/Makefile.
In the original installiation on megatron, we had to correct the epics root. I.e. on megatron, installed in /opt/ is epics-3.14.7-linux,
so we changed EPICS_ROOT to: EPICS_ROOT=/opt/epics-3.14.7-linux
Constructing the model in Matlab
1) Change to the editing directory
cd /opt/rtcds/caltech/c1/core/advLigoRTS/src/epics/simLink
2) Start matlab and add the lib directory to the matlab path
matlab &
- In MATLAB
addpath lib
3) Open CDS_PARTS.mdl and then open or create a .mdl file you want to work with.
open CDS_PARTS.mdl open c1sys.mdl
- where "sys" is the last 3 letters of the mdl file name identifying the system (i.e. c1sus for suspensions).
4) Read Rolf's document on what various parts do [https://dcc.ligo.org/cgi-bin/private/DocDB/ShowDocument?docid=1033 here].
5) Gotchas!
The model must have at least 2 filter modules.
The cdsParameters block must have specific_cpu set to something other than 0 or 1 and it must have adcSlave set to 1.
Make sure the DCUID number is NOT overlaped with any other models by referencing: ["Electronics/Existing RCG DCUID and gds ids"]
Do not use the word "DUMMY" or "DEFAULT_NAME" in naming pieces.
Updating/Creating the IPC file
IPC file
A file, starting with the site location, like C1.ipc or G1.ipc, lives in /opt/rtcds/caltech/c1/chans/ipc/.
- This file relates a given name used in a model file, like C1:SUS-ETMY_COIL_UL to a memory location, like 0x20afc.
- The memory location is actually a offset in memory plus a constant (64*8*2 I think) times its ipcNum listed in its entry. To use the naming feature of shared memory locations, this file must be updated with the correct information about a channel.
Updating IPC file
- The feCodeGen.pl script (called when you use the make c1SYS command in the /advLigoRTS directory) is now smart enough to update the ipc file itself.
- However, it only adds to the ipc if the "sending" side of the communication is in the currently being compiled model. "Receiver" side connections which don't exist in the IPC file will cause an exit from the code with a message stating the IPC file is missing certain entries.
- With 2 or more way communications between front ends, each front end model needs to be tried to made once (i.e. "make c1SYS"), before any of them will actually successfully build the model.
Building the realtime executable
1) Log in to a realtime linux, otherwise some of the following commands doesn't properly run.
ssh -X megatron
2) Once the SYS.mdl file is finished, change your current directory to the advLigo directory
cd /opt/rtcds/caltech/c1/core/advLigoRTS
3) Run:
make uninstall-daq-SYS make clean-SYS make SYS make install-SYS make install-daq-SYS make install-screens-SYS
where SYS is the 3 letter name of the mdl file.
Note1: SYS.mdl must be one which directly saved from SimuLink
because "The RCG code does not work unless the name of the mdl file (simulink model) matches to the model name". This means that just copying the mdl file does not work for the new system.
Note2: Check you have at least two testpoints registered
using daqconfig. Note a fresh install of daqconfig may require editing to point at the correct location. Change line 346 in the daqconfig script in /opt/rtcds/caltech/c1/scripts from set dir "/opt/rtcds/${site_name}/chans/daq" to set dir "/opt/rtcds/${site_name}/c1/chans/daq"
Note3: make install-daq-SYS doesn't seem to replace the
previous C1SYS.ini file in /cvs/cds/caltech/chans/daq or /opt/rtcds/caltech/c1/chans/daq. If you modified the model significantly, you need to cleaning the previous C1SYS.ini, such that your testpoints are properly registered.
Note4:
Running the realtime executable
1) start IOP process which controls the ADC inputs and the DAC outputs If its not running, try setting "BURT Restore" to 1 (lower left of the screen). If you are using shared memory, you will have to
2) To start the realtime process, run cd /opt/rtcds/caltech/c1/scripts
startIOP
3) Open medm screens to see if it's working. Particularly, the associated C1SYS_GDS_TP.adl screen is useful. The screens are usually in the /opt/rtcds/caltech/c1/medm/SYS directory. cd /opt/rtcds/caltech/c1/scripts
startSYS
medm -x /opt/rtcds/caltech/c1/medm/SYS/C1SYS_GDS_TP.adl &
modify the
/etc/rc.d/rc.local file and add the part to the line that looks like: care of things at boot time. However, to immediately get it working,: Then as root run /usr/bin/setup_shmem.rtl SY1 SY2 SY3 etc, with the
1.
In /opt/rtcds/caltech/c1/target/gds/param/ there is a testpoint.par file. Inside it has something like: model (tst.mdl in this case). This because the simulink code starts counting at 1, while the other codes start at 0.
In /opt/rtcds/caltech/c1/target/gds/param/ there is a awg.par file. Inside it has something like: model (tst.mdl in this case). This because the simulink code starts counting at 1, while the other codes start at 0. in the testpoint.par file.
aaa is the system name (e.g. oms, tst, ...) description directory notes for model /opt/rtcds/caltech/c1/core/advLigoRTS/src/epics/simLink to build /opt/rtcds/caltech/c1/core/advLigoRTS startup script /opt/rtcds/caltech/c1/scripts medm screens /opt/rtcds/caltech/c1/medm/aaa realtime code log /opt/rtcds/caltech/c1/target/aaa/logs ioc log /opt/rtcds/caltech/c1/target/c1x00/c1x00epics/iocC1.log daqd / daqdrc / master /opt/rtcds/caltech/c1/target/fb filter coeffs /opt/rtcds/caltech/c1/caltech/chans daq settings /opt/rtcds/caltech/c1/chans/daq which are to be configured by daqconfig autoburt snapshots /tmp/ probably should be changed to a better place - currently set in the starttst script start script directories as well as params for gds /opt/rtcds/caltech/c1/target/gds /usr/bin/setup_shmem.rtl SY1 SY2 SY3 &
where SY1, SY2, etc are the 3 letter names of the system. This will take Frame Builder issues
Status
Making Changes
If you have added a new model then you need to modify the /opt/rtcds/caltech/c1/target/fb/master file Starting the testpoint manager
[C-node0] hostname=192.168.1.2 system=tst
Getting AWG working
[C1-awg0]
hostname=192.168.1.2
prognum=0x31001002
Useful directories
Links