How to start a brand new RTS model
(reference: aLIGO wiki, "how to add a brand-new front-end model")
- Determine what's already in use
- ssh [front-end,host] computer where you want to start a brand new model.
- Run 'lsmod' command on the [front-end,host] computer to determine what models are running. All of displayed models by lsmod are running.
- Open CDS status medm screen (K1CDS-FE_CPU_STAT.adl) from sitemap medm.
- Look at the model names running and go look at the corresponding simulink models and look at the parameters block (cpu, dcuid number, etc). These parameters are summarized in CDS status medm screen.
- Check what CPUs are available, the ones actually displayed when you run 'cat /proc/cpuinfo' on the [front-end,host] computer. Note always leave a CPU (usually 0) free for the OS. CPU 1 is for the IOP.
- Create the new model
- Open Matlab and make new mdl file
- Fill in the cdsParameters block appropriately.
- Rates are 2K, 4K, 16K, 32K, 64K
- Two filter minimum in the model or else doesn't run. 1 ADC minimum. Get parts from CDS_PARTS.mdl
- Model files(*.mdl) exist in /opt/rtcds/userapps/trunk
- Go to the build computer usually k1boot (will be changed in the future) and build the model
Go to the build directory (cd /opt/rtcds/rtscore/release/ /opt/rtcds/kamioka/k1/rtuild/current or just type "cdscode" as an alias)
- make clean-MODELNAME
- make MODELNAME
- make install-MODELNAME
- Be aware if you are using IPC (dolhpin,RFM, shared memory), build the sender first. If you have senders sending to each other, build one, then the other, then build the first again.
- Add the model to the rtsystab and edit master file
- Login to k1boot and modify the rtsystab (sudo emacs /diskless/root/etc/rtsystab)
- Add model name to the right of the computer name (example: computername MODELNAME MODELNAME)
- Add the model's channel and tp files to the framebuilder master file (usually located something like /opt/rtcds/kamioka/k1/target/fb/master
- Only attempt this with the assistance of the cds admin or equivalent*
- Check if the .ini files (i.e. the files in /opt/rtcds/kamioka/k1/chans/daq/, such as K1EDCU_MODELNAME.ini and MODELNAME.ini) are added under the appropriate IOP file.
- Check if the .par files (i.e. the tpch_MODELNAME.par file which lives in /opt/rtcds/kamioka/k1/target/gds/param/) are added, also under the appropriate IOP file.
Restart the frame builder process so the channels get recorded
Only attempt this with the assistance of the cds admin or equivalent*
- Restart the "daqd"
- login k1dc0
- $ ssh k1dc0
- check process ID
- k1dc0$ ps -ef | grep daqd | grep controls
- kill process
k1dc0$ kill process_id
- login k1dc0
- Start the model on the front end computer for the first time
- Have the GDS_TP screen up first (usually located in /opt/rtcds/kamioka/k1/medm/MODELNAME/MODELNAME_GDS_TP.adl)
- startMODELNAME (located in i.e. /opt/rtcds/kamioka/k1/scripts/)
- Hit the BURT button soon after the EPICS come up (you usually have 5-10 seconds), so the front end code will think a burt restore has been done and actually start - this procedure is changed after RTS2.9.
- Update the appropriate MEDM screens via the MEDM update screen from the sitemap (under the 'MEDM' button).
- Setup your safe.snap (a burt snapshot of a safe state) so you don't need hit BURT each time (generally soft-linked from userapps to target/MODELNAME/MODELNAMEepics/burt/safe.snap file) example: login as controls in a terminal, then enter: makeBackup vis MODELNAME
- Set BURT_RESTORE channel as 1
- execute following command
> caput K1:FEC-(dcuid)_BURT_RESTORE 1
- execute following command
- Save safe.snap and modified safe.snap
- Open the GDS_TP screen
- Click the "SDF TABLE" button
- Follow the instruction of attached figures
- Restart new model
> startk1(modelname)
Old information
6. generate snap file
- copy latest snap file as safe.snap
> cd /opt/rtcds/kamioka/k1/target/MODELNAME/MODELNAMEepics/burt
> cp MODELNAME_burt_DATE.snap safe.snap - edit safe.snap
> emacs safe.snap
old: K1:FEC-dcuid_BURT_RESTORE 1 0.000000000000000e+00
new: K1:FEC-dcuid_BURT_RESTORE 1 1.000000000000000e+00
7. Re-start model
> ssh k1XXX
> startk1YYY