Differences between revisions 1 and 27 (spanning 26 versions)
Revision 1 as of 2012-03-03 20:47:39
Size: 753
Comment:
Revision 27 as of 2020-08-15 17:37:17
Size: 3397
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= How to edit and build a RT model =

As an example, commands for the k1imc model running on k1ioo machine is shown. Please change the model names and machine names accordingly.

 1. Edit the Simulink RT model file (.mdl) with Matlab.{{{
$cd /opt/rtcds/userapps/release/imc/k1/models
$matlab &
}}}

   * Run /opt/rtcds/userapps/release/cds/k1/models/startup.m on Matlab to add paths.
   * To edit the Library Blocks, single-click on the block and Ctrl-L to edit them.
   * "dcuid" (FEC) should be different for each model, and the list of DCU IDs are kept --(at [[KAGRA/Subgroups/DGS/RTPC/DCUIDList|DCUIDList page]])-- This is not managed well...
     * Do not use the number 10's DCU IDs, those numbers are pre-reserved. A maximum of 128 DCU IDs can be used. (RCG 3.6 will be extended to 512.)
     * Available DCUIDs can be listed up by '''''the bottom right button on the CPU_STAT screen'''''.
   * "specific_cpu" should also be different for each model on a single machine. iop model has specific_cpu=2, so slave models should have specific_cpu>=3.
     * In new version (for O4), specific_cpu=1 and >=2 should be used for iop models and slave models, respectively.


 1. ssh k1ioo (the machine running the model), and run the following commands to build the RT model.{{{
$cdscode (or cd /opt/rtcds/kamioka/k1/rtbuild/current)
$make k1imc
$make install-k1imc
}}}
 You might have to edit /opt/rtcds/kamioka/k1/target/gds/param/testpoint.par if you get error messages with testpoint.par.

 1. check related guardian is in SAFE or DOWN state.

 1. check SDF shows no difference.

 1. ssh k1ioo, and run the following commands to start the new model.{{{
$startk1imc
}}} You have to press BURT button on the GDS screen (e.g. K1IMC_GDS_TP.adl) when its starting.

 1. Edit MEDM screens. Auto-generated screens live in /opt/rtcds/kamioka/k1/medm/k1imc. Your original MEDM screens should be saved in /opt/rtcds/userapps/release/imc/k1/medm. To edit MEDM screens, start MEDM with the command{{{
$medm &
}}} and open the file (.adl). Press "Execute" button to see the screen on execution.

----
= OBSOLETE INFO BELOW =

## page was renamed from LCGT/subgroup/ifo/digital/Manual/BuildModel
Line 3: Line 44:
 * When you modified an existing model file (extension: .mdl) using Simlink on Matlab at /opt/rtcds/tst/x1/core/advLigoRTS/trunk/src/epics/simLink/, you need to rebuild the model.  * When you modified an existing model file (extension: .mdl) using Simlink on Matlab at /opt/rtcds/rtcore/release/src/epics/simLink/, you need to rebuild the model. If you need to change model name or add a new model, see [[KAGRA/Subgroups/DGS/Manual/ChangeModelNameSTDA|this]] page.

 * Type {{{
>rtr
}}} or {{{
>cd /opt/rtcds/rtcore/release
}}}
  * Each RTS folder under /opt/rtcds/rtscores/tags/advLigoRTS-2.X.X or /opt/rtcds/rtscores/branches/advLigoRTS-2.X.X includes
   * src/epics/simLink/
    . .mdl (RT model) files. Matlab opens these model files.
   * src/epics/simLink/lib/
    . library for RT models with Matlab. Needs to path at the beginning when Matlab open .mdl files.
Line 7: Line 59:
 * Move proper directly {{{
>cd /opt/rtcds/tst/x1/core/advLigoRTS/trunk
 * Move proper directly by typing 'rtr' or {{{
>cd /opt/rtcds/rtcore/release
Line 11: Line 63:
 * If you build x1x30 for example, {{{
>make uninstall-x1x30
>make x1x30
>make install-x1x30
>make install-daq-x1x30
>make install-screens-x1x30
}}}, instead the above, easier way is just to type {{{
./dbuild x1x30
}}} on the same directly. 'dbuiild' command is a script to make all the process above.
 * Build IOP; {{{
>make k1x01
>make install-k1x01
}}} and build RT model; {{{
>make k1vex
>make install-k1vex
}}} then, {{{
> killk1vex
>startk1x01
>startk1vex
}}} to start the new model.

----

How to edit and build a RT model

As an example, commands for the k1imc model running on k1ioo machine is shown. Please change the model names and machine names accordingly.

  1. Edit the Simulink RT model file (.mdl) with Matlab.

    $cd /opt/rtcds/userapps/release/imc/k1/models
    $matlab &
    • Run /opt/rtcds/userapps/release/cds/k1/models/startup.m on Matlab to add paths.
    • To edit the Library Blocks, single-click on the block and Ctrl-L to edit them.
    • "dcuid" (FEC) should be different for each model, and the list of DCU IDs are kept at DCUIDList page This is not managed well...

      • Do not use the number 10's DCU IDs, those numbers are pre-reserved. A maximum of 128 DCU IDs can be used. (RCG 3.6 will be extended to 512.)
      • Available DCUIDs can be listed up by the bottom right button on the CPU_STAT screen.

    • "specific_cpu" should also be different for each model on a single machine. iop model has specific_cpu=2, so slave models should have specific_cpu>=3.

      • In new version (for O4), specific_cpu=1 and >=2 should be used for iop models and slave models, respectively.

  2. ssh k1ioo (the machine running the model), and run the following commands to build the RT model.

    $cdscode (or cd /opt/rtcds/kamioka/k1/rtbuild/current)
    $make k1imc
    $make install-k1imc
    You might have to edit /opt/rtcds/kamioka/k1/target/gds/param/testpoint.par if you get error messages with testpoint.par.
  3. check related guardian is in SAFE or DOWN state.
  4. check SDF shows no difference.
  5. ssh k1ioo, and run the following commands to start the new model.

    $startk1imc
    You have to press BURT button on the GDS screen (e.g. K1IMC_GDS_TP.adl) when its starting.
  6. Edit MEDM screens. Auto-generated screens live in /opt/rtcds/kamioka/k1/medm/k1imc. Your original MEDM screens should be saved in /opt/rtcds/userapps/release/imc/k1/medm. To edit MEDM screens, start MEDM with the command

    $medm &
    and open the file (.adl). Press "Execute" button to see the screen on execution.


OBSOLETE INFO BELOW

  1. If you do not understand the meaning of modifying a model file, just stop here. Otherwise you may break whole system.
  2. When you modified an existing model file (extension: .mdl) using Simlink on Matlab at /opt/rtcds/rtcore/release/src/epics/simLink/, you need to rebuild the model. If you need to change model name or add a new model, see this page.

  3. Type

    >rtr

    or

    >cd /opt/rtcds/rtcore/release
    • Each RTS folder under /opt/rtcds/rtscores/tags/advLigoRTS-2.X.X or /opt/rtcds/rtscores/branches/advLigoRTS-2.X.X includes
      • src/epics/simLink/
        • .mdl (RT model) files. Matlab opens these model files.
      • src/epics/simLink/lib/
        • library for RT models with Matlab. Needs to path at the beginning when Matlab open .mdl files.
  4. Make it sure you are on RT PC like standalone.
  5. Move proper directly by typing 'rtr' or

    >cd /opt/rtcds/rtcore/release
  6. Build IOP;

    >make k1x01
    >make install-k1x01

    and build RT model;

    >make k1vex
    >make install-k1vex

    then,

    > killk1vex
    >startk1x01
    >startk1vex
    to start the new model.


KAGRA/Subgroups/DGS/Manual/BuildModel (last edited 2022-02-14 17:39:48 by TakahiroYamamoto)