diff --git a/doc/FAQ.rst b/doc/FAQ.rst index 4554358..a85b6d8 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -29,15 +29,10 @@ How do I install IBEX Client? To install IBEX Client - see :ref:`installing_ibex_client`. -Can I run IBEX and SECI at the same time? ------------------------------------------ - -In a word - No. Running two control programs on any system is a bad idea - which program has control? If you were to run IBEX and SECI on the same system, the two would contend for control of individual devices. It would not be clear which device was controlled by which program. The results would be unpredictable. - Which version of Python does IBEX use? -------------------------------------- -IBEX currently uses Python 3.11.2. +IBEX currently uses Python 3.12 Where can I learn about Python? ------------------------------- @@ -67,11 +62,6 @@ How do I stop IBEX Server? To stop IBEX Server - see :ref:`stopping_ibex_server`. -Can I switch from running IBEX to SECI and vice-versa? ------------------------------------------------------- - -Yes, it is possible to switch from running IBEX to SECI or to switch from SECI to IBEX, but you have to be careful. See :doc:`obsolete/Switching-Between-IBEX-and-SECI` for details. - Can I write scripts to control my experiment? --------------------------------------------- diff --git a/doc/Key-Concepts-in-IBEX.rst b/doc/Key-Concepts-in-IBEX.rst index fdd381f..57001b3 100644 --- a/doc/Key-Concepts-in-IBEX.rst +++ b/doc/Key-Concepts-in-IBEX.rst @@ -166,7 +166,7 @@ A veto is a hardware signal that can, on a frame by frame basis, tell the DAE no * ISIS 50Hz veto: vetoes frames when accelerator not running at 50Hz (e.g. during beam run up or diagnostics) - * Used on IRIS/OSIRIS, but they also use ISISFREQ SECI block + * Used on IRIS/OSIRIS, but they also use ISISFREQ block .. _concept_timing: diff --git a/doc/Obsolete.md b/doc/Obsolete.md deleted file mode 100644 index a0de4fd..0000000 --- a/doc/Obsolete.md +++ /dev/null @@ -1,16 +0,0 @@ -# Obsolete information - -:::{warning} -The guides in this section are obsolete and no longer relevant, for example because they document -migrations which have already happened on all instruments. - -The information in these documents is unlikely to be useful, except for historical context. -::: - -```{toctree} -:maxdepth: 1 -:titlesonly: -:glob: - -obsolete/* -``` \ No newline at end of file diff --git a/doc/concepts/Blocks.rst b/doc/concepts/Blocks.rst index a288a65..0f6b2c1 100644 --- a/doc/concepts/Blocks.rst +++ b/doc/concepts/Blocks.rst @@ -1,7 +1,7 @@ Blocks ###### -The IBEX concept of a block is similar to SECI, in that it is a relevant piece of information chosen by the scientist that will be displayed on the instrument dashboard and, if required, can be logged into the datafile. +The concept of a block is that a relevant piece of information chosen by the scientist that will be displayed on the instrument dashboard and, if required, can be logged into the datafile. In IBEX, a block is, to all intents and purposes, an alias to a process variable. For example, the block ``Chop1Freq`` on LARMOR is defined to be the process variable ``IN:LARMOR:CS:SB:Chop1Freq``. It is much simpler to refer to a block than to refer to a process variable. Utilities like genie_python know about blocks, and you can use commands such as ``cset`` to access ``Chop1Freq``. However, you can access blocks using the name ``IN:LARMOR:CS:SB:Chop1Freq`` with any standard EPICS tool. diff --git a/doc/index.md b/doc/index.md index 10ed5c6..6899570 100644 --- a/doc/index.md +++ b/doc/index.md @@ -44,7 +44,6 @@ How-To IBEX-File-Paths-page Instrument-Specific-Guidance Device-Specific-Guidance -Obsolete ``` ## Further information & Links diff --git a/doc/inst_specific/Engin-X-Sample-Stack.md b/doc/inst_specific/Engin-X-Sample-Stack.md index 159c20d..a84f033 100644 --- a/doc/inst_specific/Engin-X-Sample-Stack.md +++ b/doc/inst_specific/Engin-X-Sample-Stack.md @@ -1,6 +1,6 @@ # Engin-X Sample Stack -The Engin X Sample Stack is controlled through IBEX but underneath IBEX link back into LabVIEW VIs from SECI hence why there are some special steps you need to use when looking at it. If you can't find the answer you are looking for in this page there is more information in the [developer wiki but beware this is quite low level](https://isiscomputinggroup.github.io/ibex_developers_manual/specific_iocs/motors/EnginX-Sample-Positioner.html). +The Engin X Sample Stack is controlled through IBEX but underneath IBEX link back into LabVIEW VIs, hence why there are some special steps you need to use when looking at it. If you can't find the answer you are looking for in this page there is more information in the [developer wiki but beware this is quite low level](https://isiscomputinggroup.github.io/ibex_developers_manual/specific_iocs/motors/EnginX-Sample-Positioner.html). ## Define a Motor Position on the Engin-X Sample Stack - Using a file explorer, go to the following location on `ndxenginx`: `C:\Labview Modules\Drivers\Galil DMC2280` diff --git a/doc/introduction/Starting-and-Stopping-IBEX.rst b/doc/introduction/Starting-and-Stopping-IBEX.rst index 5e68a30..346e1af 100644 --- a/doc/introduction/Starting-and-Stopping-IBEX.rst +++ b/doc/introduction/Starting-and-Stopping-IBEX.rst @@ -52,37 +52,3 @@ Stopping IBEX Server If you want to stop running the server, it is probably best to make sure you have stopped your client. Similar to the ``start_ibex_server.bat`` there is a ``stop_ibex_server.bat`` which you can usually access in the same ways. There will either be a shortcut in your start menu, which points to a file in the EPICS directory. - - -Starting and Stopping IBEX Server After/Before Running SECI ------------------------------------------------------------ - -There is a special case when you want to swap from IBEX to SECI when SECI is using IBEX as a *mini-inst* (this means IBEX is running an underlying ioc like the JASCO pump or a special DAE process). In this case there are multiple files that need to be changed to run in the two modes. To facilitate swapping there are scripts to allow you to do this easily. - -Starting IBEX Server after running SECI -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To start IBEX Server after running SECI, proceed as follows: - -#. Use Windows Remote Desktop Connection to log in to your instrument control PC -#. Open a command window -#. At the command prompt type the following:: - - cd c:\Instrument\Apps\EPICS - start_ibex_server_close_seci.bat - -#. Allow the script a few minutes to complete. - -Stopping IBEX Server before running SECI -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To stop IBEX Server and then start SECI, proceed as follows: - -#. Use Windows Remote Desktop Connection to log in to your instrument control PC -#. Open a command window -#. At the command prompt type the following:: - - cd c:\Instrument\Apps\EPICS - stop_ibex_server_start_seci - -#. Allow the script a few minutes to complete. diff --git a/doc/introduction/What-Is-IBEX.rst b/doc/introduction/What-Is-IBEX.rst index bb2b87f..7a5c67e 100644 --- a/doc/introduction/What-Is-IBEX.rst +++ b/doc/introduction/What-Is-IBEX.rst @@ -23,9 +23,3 @@ Introduction to genie_python ------------------------------------------------ A full reference to genie_python is available `on GitHub `_ or internally `on shadow `_. - -Previous Instrument Control at ISIS ------------------------------------------------- -You can find out more about the previous control system, SECI, and how it relates to IBEX :doc:`here<../obsolete/Previous-Instrument-Control-at-ISIS-‐-SECI>`. - - diff --git a/doc/obsolete/Converting-Open-GENIE-to-genie_python.rst b/doc/obsolete/Converting-Open-GENIE-to-genie_python.rst deleted file mode 100644 index 3b7f754..0000000 --- a/doc/obsolete/Converting-Open-GENIE-to-genie_python.rst +++ /dev/null @@ -1,66 +0,0 @@ -Converting Open GENIE to genie\_python -====================================== - -.. warning:: - This guide is obsolete; Open GENIE is no longer in use on any instrument. - -If you know a little bit of Python already, converting Open GENIE -scripts to ``genie_python`` is very often straightforward. Even if -you're new to Python, once you know a few simple pieces of syntax, -you'll be able to convert many scripts without issue. - -**Note:** If you are new to Python, consult the :external+mantid:ref:`introduction_to_python` on the Mantid web-site. - -List of functions ------------------ - -We've included some `common genie_python -commands <#common-genie_python-commands>`__ on this page, but for a full -list refer to the :external+genie_python:py:mod:`genie` reference documentation. - -Indentation ------------ - -One thing where there is no direct comparison between Python and Open GENIE is with **indentation**. -In Python, different code blocks are identified by their indentation -level. In many programming languages, code blocks are encased in curly -braces (``{...}``), but Python uses indentation. For example: - -:: - - print "No indent" - def my_func(): - print "1 indent. Inside the function" - if True: - print "2 indents. Inside the if clause" - print "2 indents. Still inside the if clause" - print "1 indent. In the function but not the if clause" - print "No indent. Outside the function" - -Typically an ``indent`` is 3 or 4 spaces. Tabs can be used too, but -Python won't recognise that a tab is the same as 4 spaces so can lead to -problems. It's often best to avoid them. This might be a new concept if -you've only ever written Open GENIE, but trust us in that it opens up a -lot of ways to make scripts more powerful, easier to read and more -reliable. - -Side-by-side comparison ------------------------ - -+-----------------------------------+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Open GENIE syntax | ``genie_python`` syntax | Comments | -+===================================+===============================================+=========================================================================================================================================================================================================================================================================================================================+ -| PROCEDURE ``my\_func`` | ``def my\_func():`` | This is the standard way to define a function in Python | -+-----------------------------------+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| ``begin`` | ``g.begin()`` | Many functions in ``genie_python`` have the same name as in Open GENIE. In these cases, prepend ``g.`` to indicate the method belongs to ``genie_python`` and append ``()`` to tell Python to execute the method with no arguments | -+-----------------------------------+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| ``my\_func\_2 100`` | ``my\_func\_2(100)`` | To execute a function, give its name and then the argument in brackets. This is a user-defined function, not a ``genie_python`` function, so it has no ``g.`` in front. | -+-----------------------------------+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| ``my\_func\_3 100 200`` | ``my\_func\_2(100,200)`` | As above, except that multiple arguments are separated by a comma | -+-----------------------------------+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| ``waitfor seconds=20`` | ``g.waitfor(seconds=20)`` | Some methods can take named arguments. In these cases you simply give named arguments in the form ``[name]=[value]``. Note that you can mix named and unnamed arguments, but unnamed arguments always appear at the start of the argument list. `This section <#argument-ordering>`__ gives a more detailed description | -+-----------------------------------+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| ``cset/nocontrol MY_BLOCK=value`` | ``g.cset('MY_BLOCK',value,runcontrol=False)`` | Some Open GENIE commands take optional arguments. The same principle applies as in the above example. | -+-----------------------------------+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| ``# This is a comment`` | ``# This is a comment`` | Comments are the same in both languages | -+-----------------------------------+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ \ No newline at end of file diff --git "a/doc/obsolete/Previous-Instrument-Control-at-ISIS-\342\200\220-SECI.rst" "b/doc/obsolete/Previous-Instrument-Control-at-ISIS-\342\200\220-SECI.rst" deleted file mode 100644 index ea9646b..0000000 --- "a/doc/obsolete/Previous-Instrument-Control-at-ISIS-\342\200\220-SECI.rst" +++ /dev/null @@ -1,37 +0,0 @@ -SECI -#### - -.. warning:: - This page is obsolete; all instruments have migrated from SECI to IBEX. - -IBEX is replacing the Sample Environment Control Interface (SECI) as the primary instrument control software. - -Before the development of IBEX, most device control was performed using LabVIEW, with SECI providing an integrated view of the various LabVIEW VIs. IBEX, on the other hand, is designed to use EPICS to provide device control. LabVIEW will not disappear entirely; when LabVIEW is required, it can be wrapped in EPICS. - -SECI used a scripting language known as Open Genie to aid in the automation of experiments at the facility. - -.. contents:: **Contents** - - -IBEX and SECI Similarities --------------------------- - -IBEX and SECI both provide integrated views for controlling neutron & muon instruments. SECI integrates information from LabVIEW VIs; IBEX integrates information from EPICS IOCs. In SECI, it is the LabVIEW VIs that directly control the individual devices attached to an instrument. In IBEX, the EPICS IOCs fulfil the role performed by the LabVIEW VIs. - -IBEX and SECI also share similar UIs, partly because they perform similar functions, but mainly by design - if they behave in similar ways, then it is easier to switch from SECI to IBEX. - -IBEX and SECI Differences --------------------------- - -IBEX is a client-server based system. The server components of IBEX run on the instrument control PC and directly control the instrument. The IBEX client is a GUI, which provides an integrated view of the information provided by the server components. The IBEX client typically runs on a separate PC (which could be in the instrument cabin, pod, or even your office). - -It is important to realise that the IBEX client is not the instrument control program. The server components of IBEX collectively constitute the instrument control program. The IBEX client provides a convenient way to communicate with the server components. You can thus close the IBEX client without stopping control of devices; you can even run multiple instances of the client on the same or different computers. You can also run the IBEX client on the instrument control PC. - -In SECI, the LabVIEW VIs all run as processes on a single PC - the instrument control PC. By contrast, in IBEX, all the server components (and the IBEX client, for that matter) are independent processes that can run anywhere on the ISIS network. Because of this, IBEX has a more flexible architecture - new components can be introduced into the architecture more easily, control processes can be distributed across multiple PCs (if necessary), instruments can more easily share infrastructure. - -In practice, in most cases, the IBEX server components will continue to run (as independent processes) on a single control PC. However, depending on individual circumstances, we will choose to run some server components on further control PCs. For example, some devices have their own dedicated control PC (e.g. cameras on IMAT). By contrast, some instruments (e.g. muon instruments) need to share infrastructure (again, controlled by a dedicated PC). The IBEX architecture provides the flexibility to accommodate both types of arrangement in a transparent fashion. - -Differences between Open Genie and genie_python ------------------------------------------------- - -A detailed description of the differences is available in :doc:`/Scripting`. \ No newline at end of file diff --git a/doc/obsolete/Switching-Between-IBEX-and-SECI.md b/doc/obsolete/Switching-Between-IBEX-and-SECI.md deleted file mode 100644 index d32d0e0..0000000 --- a/doc/obsolete/Switching-Between-IBEX-and-SECI.md +++ /dev/null @@ -1,34 +0,0 @@ -# Switching between IBEX & SECI - -:::{warning} -This guide is obsolete; there are no longer any instruments running SECI. -::: - -When an existing instrument is migrated to IBEX, the SECI installation is not deleted. This allows the instrument to temporarily switch back to SECI if needed for a particular experiment. During normal hours, you can contact the IBEX team for assistance, but this section will cover how you can carry out this yourself and any matters to watch out for. Please let the IBEX team know of the reason you needed to move back to SECI if they are not already aware. - -Switching between SECI and IBEX is possible as they both use the same underlying DAE control software (ISISICP) and sample environment logging database. This means that the run number is preserved etc. as well as other details. - -However, the following points should be born in mind: -- Only swap when in SETUP mode and you are sure any raw/nxs data file has completed being written. The control program writes files asynchronously in the background, so just being in SETUP does not guarantee that file writing has been completed. When in event mode, the file write can happen a while afterwards. So you should check the file from the last run number has appeared on the data archive (Usually d: network drive) before continuing. -- Don't have both SECI and IBEX running at the same time; they will likely try and talk to the same devices -- You may get at least one raw data file containing sample environment data from both SECI and IBEX; this is because a run contains all data from the end of the previous run up until when it ends. If this would cause confusion (maybe there are blocks in SECI and IBEX with the same name that don't mean the same thing), do a BEGIN/END to create a file and so put this data elsewhere. - -## Procedure - -### If SECI is running and you want to start IBEX: - -1. Check that the Instrument is in SETUP and previous run data files saved and copied to an archive. -2. Then close SECI (`File Menu->Exit`). -3. Then to start IBEX Server, use the shortcut in the Windows start menu or run `start_ibex_server.bat` located in `c:\Instrument\Apps\EPICS`. This will close any open IBEX client windows. -4. To start IBEX client, click on the IBEX shortcut in the Windows start menu or the taskbar. - -### If IBEX is running and you want to start SECI: - -1. Check that the Instrument is in SETUP and previous run data files saved and copied to an archive. -2. Then run stop_ibex_server.bat which will either be a shortcut on the Windows Start menu, or you can browse with explorer to `c:\Instrument\Apps\EPICS` where it is located. This will close any open IBEX client windows as well. -3. Next browse to `c:\Program Files (x86)\STFC ISIS Facility\SECI` where `SECIUserInterface.exe` is located. Click on `SECIUserInterface.exe` to start SECI. - -## Post Switch Tasks - -- Check and, if necessary, update the RB number, username and run title - either IBEX or SECI may reset this back to what it was last time they were run. -- If you don't wish your next proper run to contain both IBEX and SECI sample environment data, do a short BEGIN/END to push this into a data file to discard. diff --git a/doc/obsolete/Using-Futurize.md b/doc/obsolete/Using-Futurize.md deleted file mode 100644 index b651abc..0000000 --- a/doc/obsolete/Using-Futurize.md +++ /dev/null @@ -1,44 +0,0 @@ -# Futurize - -:::{warning} -This guide is obsolete; scripts were migrated to Python 3 many years ago. -::: - -Futurize takes in your Python 2 code and turns it into valid Python 3 code, and also makes it backwards compatible with Python 2 using future package. - -## Using Futurize: -There are mainly two ways on how you can translate your script using Futurize. More information could be found [here](http://python-future.org/futurize_cheatsheet.html). - -### Translating a single file -* Open Command Prompt -* **cd** `C:\Instrument\Apps\Python\Scripts` -* **futurize** `path\to\your\script` - -Now it should suggest some changes, to overwrite your current file with the suggested changes run the following command. - -* **futurize -w** `path\to\your\script` - - -### Translating multiple files at once -You have to manually create a list of python scripts you want to translate and place them in a separate folder. Replace `path\to\your\recently\created\folder` with the name of the folder where you have bundled all your script. - -* Open Command Prompt -* `cd C:\Instrument\Apps\Python\Scripts` -* `futurize path\to\your\recently\created\folder -wno name_of_your_output_folder` - -`name_of_your_output_folder` = name of the folder where you want to save the output, does not require to be created beforehand. - -The output will be saved in `path\to\your\folder\name_of_your_output_folder` - -## Common Problems and troubleshooting: - -### Separating Unicode from bytes: -Python 2 str is equivalent to python 3 bytes and Python 2 Unicode is now Python 3's default string literal. Unicode in Python 2 is implicitly converted to bytes when it is being compared against bytes `b'123' == u'123` will result to `True` in Python 2 whereas in Python 3 this will result to `False`. - -### Division: -In Python 3, all divisions between int values will result into float. If you want an integer division/floor division '//' can be used in both python 2 and 3. - -## Additional Resources: -[More on Futurize](https://python-future.org/futurize.html) - -[Cheatsheet on writing Python2/3 compatible code](https://python-future.org/compatible_idioms.html) \ No newline at end of file