.. index:: single: unisim ======================= The unisim application ======================= unisim emulates a set of `UniDrive `_ motor control devices all run the :doc:`uniserv ` program. unisim is an `EPICS `_ application that implements an `IOC `_ and uses the `SocketCAN `_ interface for accessing the `CAN bus `_. By defining a `Virtual CAN Bus interfaces `_ on your system, it is possible to run unisim and and :doc:`idcp ` your system without any specialized hardware. This can be used to test IDCP, unisim acts as a digital twin of the undulator. Download the application ------------------------ You download the sources with `mercurial `_ with this command:: hg clone http://hg.code.sf.net/p/idcs-unisim/code unisim Configure and build ------------------- You configure the project with the script ``configure.sh``. The script has an online help that can be shown with:: ./configure.sh -h .. note:: If you work from the internal network of the `Helmholtz-Zentrum Berlin `_, always run configure.sh with option ``--local custom-HZB.sh``. Use this option also when you display the online help since the help text is changed by this option. The configure script ensures that `sumo `_, `bii_scripts `_ and `pyexpander `_ are installed. If one of these applications is missing it is downloaded and installed in a `Python Virtual Environment `_. `sumo `_ is then called to download and compile `EPICS Base `_ and other EPICS device supports needed by the application. Finally, 'configure.sh' can also compile the application itself. For a simple local build of everything run:: ./configure -v -y For a display of other configure.sh options run:: ./configure -h Set up of your environment variables ------------------------------------ If at some point you want to recompile the application, you have to configure your environment first. Run:: source ./setenv.sh .. note:: If configure.sh didn't have to install any programs, setenv.sh is empty. Configure the virtual CAN Bus ----------------------------- .. note:: This only works when the application was built before since scripts from the SOCAN device support are used for initialization. .. note:: You need 'sudo' rights on your system for the following command. In order to set up the virtual CAN bus interfaces run:: ./setup-vcan.sh Start the application --------------------- .. note:: When your Linux host has more than one IP address select one of these addresses where the IOC should run and append ``--ip IP-ADDRESS`` to the command below. .. note:: You may omit option '--sudo' when you don't have 'sudo' rights on your system. However, in this case the program cannot run with Linux real time priorities. Run:: ./start-ioc.sh --sudo Now you are ready to go to run :doc:`idcp `.