The unisim application

unisim emulates a set of UniDrive motor control devices all run the 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 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 idcp.