Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOC: Convert an IOC to Lua #4288

Closed
John-Holt-Tessella opened this issue Apr 25, 2019 · 4 comments
Closed

IOC: Convert an IOC to Lua #4288

John-Holt-Tessella opened this issue Apr 25, 2019 · 4 comments

Comments

@John-Holt-Tessella
Copy link
Contributor

As a developer I want an IOC converted to use LUA because it is a nicer language to use to start an IOC.

Acceptance criteria

  1. IOC st.cmd uses LUA instead
  2. Database is still updated
  3. Devsim and rec sim tests still run in the IOC test framework
  4. Log is still captured as log file and in the database
  5. Errors in missing macros, db files are still reported
@Alistair-McGann-Tessella
Copy link

Alistair-McGann-Tessella commented Aug 9, 2019

I started writing a lua boot script as part of another ticket; I had to stop because it was getting too much work. The issue I came across was that asynSetOption was not available to be called from lua.

The remedy to this is adding asynSetOption to the lasynlib.cpp file in core lua. There are other asyn functions already called from this file which can be used as templates.

We also need to find a place for generally useful lua scripts. We decided these would go in the utilities repository so they can be accessed everywhere. I wrote a few functions which are generally useful to all IOC boot files; I didn't get as far as moving them out of a single lua script though.

The lua script I wrote is on this branch:
https://github.com/ISISComputingGroup/EPICS-ioc/tree/Ticket4288_sample_lua_code

@JamesKingWork
Copy link
Contributor

A lua script is now called from st-common.cmd to run the regular functionality of st-common.cmd

Lua utility scripts now placed in utilities module and used in the st-common.lua

IocTestFramework tests for oercone pass. However, the code can definitely be cleaned up and not all acceptance criteria are met.

Still to do:

  • Launch lua version of st.cmd from cpp main function and do functionality of st.cmd in lua
  • Clean up dead code
  • Test against hardware

@JamesKingWork
Copy link
Contributor

See new ticket for future work on this issue #4811

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants