-
Notifications
You must be signed in to change notification settings - Fork 2
IOCs
Remember, EPICS is a collaboration! Why create an IOC when you can just use one that's already out there? If the device is not ISIS specific, before thinking about creating an IOC check whether it is listed here and, if not, email the mailing list here.
Building a new IOC? Before you get started, take a look at the relevant instrument page to see if there's any useful information for the device you're about to write an IOC for. Otherwise, let's get going. If you have problems see See IOC and device Troubleshooting.
There are two sorts of IOCs, EPICs and pycaspy. For EPICs type see the automatic creation below for pycaspy see the pycaspy ioc.
Need more than 1 IOC? See IOC Duplication
If you're building a new StreamDevice IOC you can use the IOC Generator script.
If you're not creating a StreamDevice IOC or you would like to know how an IOC could be created manually see:
- Creating an ISIS StreamDevice IOC
- Creating an LvDCOM IOC
- Creating a simple IOC - usual basic way to make an IOC on new EPICS installation, not the way we do it in ISIS.
-
You can now flesh out your IOC to work. I would encourage you to do this in a TDD style (if not write the tests afterwards) and make sure you follow the conventions. To write in a TDD style use:
If you used the script to create your IOC an empty emulator and IOC tests will have been created for you.
-
- Additional for motors:
-
Add any manuals used to the manuals directory
-
Add a page about the device in the correct categories in Specific Device IOC
-
Create an OPI and send it to instrument scientists for approval.
- aSub records
- Motor IOCs
- Libraries to include
- Creating a MODBUS IOC (page removed at some point)
- Using LVDCOM
- Convert Record
- Stream Device Tips and Tricks
- IOC Utilities includes general templates
- Removing or Renaming an IOC module
- IOC Testing framework
- Complexity of LabVIEW Drivers
- Typical start up log for an ioc
- Some Design thoughts for a serial/Ethernet IOC
- Reducing build dependencies for older iocs
- Template Substitutions
- Creating a State Machine
- Limited range on PV
When modifying and testing an IOC it helps if you chain the commands to make and run the IOC like below:
cd C:\Instrument\Apps\EPICS\support\<IOC name>\master && make clean uninstall && make && cd C:\Instrument\Apps\EPICS\ioc\master\<IOC name>\ && make clean uninstall && make && cd C:\Instrument\Apps\EPICS\ioc\master\<IOC name>\iocBoot\ioc<name>\ && runioc.bat
Debug builds of IOCs are built in jenkins and can be deployed to instruments, see here.
It can be useful to add a msgBox
to pause so you can attach a debugger, see here for instructions. If your error is during or after the db load is to call runioc.bat a
this will start he ioc but run a
as the start script. Now attach the debug and in the console type < st.cmd
.
To attach the debugger start the IOC, open visual studio with the code in you wish to debug, set breakpoints as you wish and in the top toolbar select "Debug >> Attach to process" find your process in the list and attach. You can control the debugger as you would other debuggers using the buttons on a toolbar just below the toolbar you clicked on with "Debug" in it.
For information on specific IOCs see Specific Device IOC