Modules, Definitions and Entities#
This page is a top down explanation of the above key terms by referencing the example IOC instance bl45p-mo-ioc-02 used in the system tests for this project.
The explanations rely on an understanding of the difference between generic IOCs and IOC instances. See Generic IOCs and instances.
Modules#
Every generic IOC image will include a number of EPICS support modules.
The bl45p-mo-ioc-02 ioc instance example uses the generic IOC container image ioc-pmac . This image contains the support modules pmac and motor plus the common support modules from epics-modules
Each IOC instance will mount a generic IOC image and therefore be able to make use of the libraries and DB templates in any of those support modules.
The goal of ibek is to allow a developer to define an instance of an IOC and make use of functions of its support modules.
ibek uses a support module definition file to determine what features of a support module may be instantiated.
Hence there is a collection of support module definition files inside of each generic IOC.
In the code the class GenericIoc is used to represent a generic IOC and an instance of that class represent an IOC instance.
Definition#
Each support module has its own support module definition file . This
is a YAML file whose name is by convention <support_module>.ibek.support.yaml
These will all reside in a folder called /ibek in the container image.
The support module definition file contains Definitions which determine what Entities an IOC instance may instantiate.
For example the pmac support module declares the following Definitions
in pmac.ibek.support.yaml
(currently this is limited to 3 - the full implementation would have more):
Geobrick
DlsPmacAsynIPPort
DlsPmacAsynMotor
Each Definition describes a class of Entity by providing:
Entity class name
a list of arguments to supply when declaring an Entity
boot script entries to add for the Entity in the form of a jinja template that may refer to the above arguments
database templates to instantiate for the Entity with macro values from the above arguments
Expand below for the example pmac support module definition file:
pmac.ibek.support.yaml
# yaml-language-server: $schema=../_global/ibek.defs.schema.json module: pmac defs: - name: PmacAsynSSHPort description: | Add a Power PMAC asyn port to the IOC This port uses SSH to connect to the Power PMAC args: - type: id name: name description: Asyn port name - type: str name: IP description: IP address of Power pmac - type: str name: USERNAME description: Username for login default: root - type: str name: PASSWORD description: Password for login default: deltatau - type: int name: PRIORITY description: Priority of the port default: 0 - type: int name: NOAUTOCONNECT description: Disables autoconnect if set to 1 default: 0 - type: int name: NOEOS description: No EOS used if set to 1 default: 0 pre_init: - type: function name: drvAsynPowerPMACPortConfigure args: AsynPortName: "{{name}}" IPAddress: "{{IP}}" Username: "{{USERNAME}}" Password: "{{PASSWORD}}" Priority: "{{PRIORITY}}" NoAutoConnect: "{{NOAUTOCONNECT}}" NoEOS: "{{NOEOS}}" - name: PmacAsynIPPort description: | Add a Turbo PMAC asyn port to the IOC This port uses TCP to connect to the PMAC args: - type: id name: name description: Asyn port name - type: str name: IP description: IP address of pmac - type: int name: PORT description: TCP port for connection default: 1025 pre_init: - type: function name: pmacAsynIPConfigure args: AsynPortName: "{{name}}" IPAddress: "{{IP}}:{{PORT}}" - name: Geobrick description: Add a geobrick to the IOC args: - type: id name: name description: Name to use for the geobrick's asyn port - type: object name: PORT description: Asyn port name for PmacAsynIPPort to connect to - type: str name: P description: PV Prefix for all pmac db templates - type: int name: numAxes description: number of axes to initialize for the controller default: 8 - type: int name: idlePoll description: Idle Poll Period in ms default: 500 - type: int name: movingPoll description: Moving Poll Period in ms default: 100 - type: int name: TIMEOUT description: timeout in seconds for asyn default: 4 - type: int name: FEEDRATE description: feedrate below which we go into error default: 100 - type: str name: CSG0 description: Name for Coordinate System Group 0 default: "" - type: str name: CSG1 description: Name for Coordinate System Group 1 default: "" - type: str name: CSG2 description: Name for Coordinate System Group 2 default: "" - type: str name: CSG3 description: Name for Coordinate System Group 3 default: "" - type: str name: CSG4 description: Name for Coordinate System Group 3 default: "" # numAxes must be supplied for geobrick (but builder.py counted the axes created) # TODO is counting num_axes is an example of something hard to do in this new approach? pre_init: - type: function name: pmacCreateController args: AsynPortName: "{{name}}" PmacAsynPort: "{{PORT.name}}" Address: 0 NumAxes: "{{numAxes}}" MovingPollPeriod: "{{movingPoll}}" IdlePollPeriod: "{{idlePoll}}" - type: function name: pmacCreateAxes args: AsynPortName: "{{name}}" NumberOfAxes: "{{numAxes}}" databases: - file: pmacController.template args: NAXES: "{{numAxes}}" PORT: "{{name}}" P: idlePoll: movingPoll: TIMEOUT: CSG0: CSG1: CSG2: CSG3: CSG4: - file: pmacStatus.template args: PORT: "{{name}}" P: - name: DlsPmacAsynMotor description: Add a motor to a motor controller args: # IMPORTANT: all non-defaulted args must come first - type: str name: name description: Object name and gui association name - type: object name: Controller description: PMAC Controller to attach to - type: int name: axis description: which axis number this motor drives - type: str name: P description: PV prefix name for this motor - type: str name: M description: PV motor name for this motor - type: str name: DESC description: Description, displayed on EDM screen default: "" - type: float name: MRES description: Motor Step Size (EGU) default: 0.0001 - type: float name: VELO description: axis Velocity (EGU/s) default: 1.0 - type: int name: PREC description: Display Precision default: 3 - type: str name: EGU description: Engineering Units default: mm - type: float name: TWV description: Tweak Step Size (EGU) default: 1 - type: str name: DTYP description: Datatype of record default: asynMotor - type: int name: DIR description: User direction default: 0 - type: float name: VBAS description: Base Velocity (EGU/s) default: 1.0 # TODO type float - type: str name: VMAX description: Max Velocity (EGU/s) # TODO make default a UNION of type and str (for jinja) default: "{{VELO}}" - type: float name: ACCL description: Seconds to Velocity default: 0.5 - type: float name: BDST description: BL Distance (EGU) default: 0 - type: float name: BVEL description: BL Velocity(EGU/s) default: 0 - type: float name: BACC description: BL Seconds to Veloc default: 0 - type: float name: DHLM description: Dial High Limit default: 10000 - type: float name: DLLM description: Dial low limit default: -10000 - type: float name: HLM description: User High Limit default: 0 - type: float name: LLM description: User Low Limit default: 0 - type: str name: HLSV description: HW Lim, Violation Svr default: MAJOR - type: str name: INIT description: Startup commands default: "" - type: int name: SREV description: Steps per Revolution default: 1000 - type: float name: RRES description: Readback Step Size (EGU default: 0 - type: float name: ERES description: Encoder Step Size (EGU) default: 0 - type: float name: JAR description: Jog Acceleration (EGU/s^2) default: 0 - type: int name: UEIP description: Use Encoder If Present default: 0 - type: int name: URIP description: Use RDBL If Present default: 0 - type: str name: RDBL description: Readback Location, set URIP =1 if you specify this default: "0" - type: str name: RLNK description: Readback output link default: "" - type: int name: RTRY description: Max retry count default: 0 - type: float name: DLY description: Readback settle time (s) default: 0 - type: float name: "OFF" description: User Offset (EGU) default: 0 - type: float name: RDBD description: Retry Deadband (EGU) default: 0 - type: int name: FOFF description: Freeze Offset, 0=variable, 1=frozen default: 0 - type: float name: ADEL description: Alarm monitor deadband (EGU) default: 0 - type: int name: NTM description: New Target Monitor, only set to 0 for soft motors default: 1 - type: float name: FEHIGH description: HIGH limit for following error default: 0 - type: float name: FEHIHI description: HIHI limit for following error default: 0 - type: str name: FEHHSV description: HIHI alarm severity for following error default: NO_ALARM - type: str name: FEHSV description: HIGH alarm severity for following error default: NO_ALARM - type: int name: SCALE description: "" default: 1 - type: int name: HOMEVIS description: If 1 then home is visible on the gui default: 1 - type: str name: HOMEVISSTR description: "" default: Use motor summary screen - type: str name: alh description: Set this to alh to add the motor to the alarm handler and send emails default: "" - type: str name: HOME description: Prefix for autohome instance. Defaults to $(P) If unspecified default: "{{P}}" - type: str name: ALLOW_HOMED_SET description: Set to a blank to allow this axis to have its homed default: "#" - type: str name: RLINK description: not sure what this is default: "" databases: - file: dls_pmac_asyn_motor.template args: ADDR: "{{ axis }}" PMAC: "{{ Controller.P }}" PORT: "{{ Controller.name }}" SPORT: "{{ Controller.PORT.name }}" P: M: DESC: MRES: VELO: PREC: EGU: TWV: DTYP: DIR: VBAS: VMAX: ACCL: BDST: BVEL: BACC: DHLM: DLLM: HLM: LLM: HLSV: INIT: SREV: RRES: ERES: JAR: UEIP: RDBL: RLINK: RTRY: DLY: OFF: RDBD: FOFF: ADEL: NTM: FEHIGH: FEHIHI: FEHHSV: FEHSV: SCALE: HOMEVIS: HOMEVISSTR: name: alh: HOME: ALLOW_HOMED_SET: - name: DlsCsPmacAsynMotor description: add a DLS Coordinate system motor args: - type: str name: name description: Object name and gui association name - type: object name: CsController description: Coordinate system controller to attach to - type: int name: axis description: which axis number this motor drives - type: str name: P description: PV prefix name for this motor - type: str name: M description: PV motor name for this motor - type: str name: DESC description: Description, displayed on EDM screen default: "" - type: float name: MRES description: Motor Step Size (EGU) default: 0.0001 - type: float name: VELO description: axis Velocity (EGU/s) default: 1.0 - type: int name: PREC description: Display Precision default: 3 - type: str name: EGU description: Engineering Units default: mm - type: float name: TWV description: Tweak Step Size (EGU) default: 1 - type: str name: DTYP description: Datatype of record default: asynMotor - type: int name: DIR description: User direction default: 0 - type: float name: VBAS description: Base Velocity (EGU/s) default: 1.0 - type: str name: VMAX description: Max Velocity (EGU/s) default: "{{VELO}}" - type: float name: ACCL description: Seconds to Velocity default: 0.5 - type: float name: BDST description: BL Distance (EGU) default: 0 - type: float name: BVEL description: BL Velocity(EGU/s) default: 0 - type: float name: BACC description: BL Seconds to Veloc default: 0 - type: float name: DHLM description: Dial High Limit default: 10000 - type: float name: DLLM description: Dial low limit default: -10000 - type: float name: HLM description: User High Limit default: 0 - type: float name: LLM description: User Low Limit default: 0 - type: str name: HLSV description: HW Lim, Violation Svr default: MAJOR - type: str name: INIT description: Startup commands default: "" - type: int name: SREV description: Steps per Revolution default: 1000 - type: float name: RRES description: Readback Step Size (EGU default: 0 - type: float name: ERES description: Encoder Step Size (EGU) default: 0 - type: float name: JAR description: Jog Acceleration (EGU/s^2) default: 0 - type: int name: UEIP description: Use Encoder If Present default: 0 - type: int name: URIP description: Use RDBL If Present default: 0 - type: str name: RDBL description: Readback Location, set URIP =1 if you specify this default: "0" - type: str name: RLNK description: Readback output link default: "" - type: int name: RTRY description: Max retry count default: 0 - type: float name: DLY description: Readback settle time (s) default: 0 - type: float name: "OFF" description: User Offset (EGU) default: 0 - type: float name: RDBD description: Retry Deadband (EGU) default: 0 - type: int name: FOFF description: Freeze Offset, 0=variable, 1=frozen default: 0 - type: float name: ADEL description: Alarm monitor deadband (EGU) default: 0 - type: int name: NTM description: New Target Monitor, only set to 0 for soft motors default: 1 - type: float name: FEHEIGH description: HIGH limit for following error default: 0 - type: float name: FEHIHI description: HIHI limit for following error default: 0 - type: str name: FEHHSV description: HIHI alarm severity for following error default: NO_ALARM - type: str name: FEHSV description: HIGH alarm severity for following error default: NO_ALARM - type: int name: SCALE description: "" default: 1 - type: int name: HOMEVIS description: If 1 then home is visible on the gui default: 1 - type: str name: HOMEVISSTR description: "" default: Use motor summary screen - type: str name: alh description: Set this to alh to add the motor to the alarm handler and send emails default: "" - type: str name: HOME description: Prefix for autohome instance. Defaults to $(P) If unspecified default: "{{P}}" - type: str name: ALLOW_HOMED_SET description: Set to a blank to allow this axis to have its homed default: "#" databases: - file: dls_pmac_cs_asyn_motor.template args: ADDR: "{{ axis }}" PORT: "{{ CsController.name }}" CS=C: "{{ CsController.CS }}" PMAC: "{{ CsController.Controller.name }}" P: M: DESC: MRES: VELO: PREC: EGU: TWV: DTYP: DIR: VBAS: VMAX: ACCL: BDST: BVEL: BACC: DHLM: DLLM: HLM: LLM: HLSV: INIT: SREV: RRES: ERES: JAR: UEIP: RDBL: RLINK: RTRY: DLY: OFF: RDBD: FOFF: ADEL: NTM: FEHIGH: FEHIHI: FEHHSV: FEHSV: SCALE: HOMEVIS: HOMEVISSTR: name: alh: HOME: ALLOW_HOMED_SET: - name: pmacDisableLimitsCheck description: disable the limits check on an axis args: - type: object name: Controller description: Geobrick on which to disable limits - type: int name: Axis description: Axis to have limits disabled pre_init: - type: function name: pmacDisableLimitsCheck when: last args: AsynPortName: "{{Controller.name}}" Axis: "{{Axis}}" AllAxes: False - name: autohome description: setup auto home groups args: - type: object name: Controller description: the PMAC Controller - type: int name: PLC description: PLC number of the auto home PLC - type: str name: P description: Prefix for auto home PVs - type: str name: GRP1 description: name of the 'ALL' group of auto home axes default: All - type: str name: GRP2 description: name of the second group of auto home axes default: "" - type: str name: GRP3 description: name of the third group of auto home axes default: "" - type: str name: GRP4 description: name of the fourth group of auto home axes default: "" - type: str name: GRP5 description: name of the fourth group of auto home axes default: "" - type: str name: GRP6 description: name of the fourth group of auto home axes default: "" - type: str name: GRP7 description: name of the fourth group of auto home axes default: "" - type: str name: GRP8 description: name of the fourth group of auto home axes default: "" - type: str name: GRP9 description: name of the fourth group of auto home axes default: "" databases: - file: autohome.template args: { PORT: "{{Controller.name}}", CTRL: "{{Controller.P}}", P, PLC, GRP1, GRP2, GRP3, GRP4, GRP5, GRP6, GRP7, GRP8, GRP9, } - name: CS description: Create a coordinate system args: - type: id name: name description: Asyn port name for this object - type: object name: Controller description: the PMAC Controller - type: int name: CS description: Coordinate system number - type: int name: NAxes description: number of CS axes default: 9 - type: int name: Program description: PROG number for CS motion default: 10 pre_init: - type: function name: pmacCreateCS args: AsynPortName: "{{name}}" PmacAsynPort: "{{Controller.name}}" CSNumber: "{{CS}}" PLCNumber: "{{Program}}" - type: function name: pmacCreateCSAxes args: AsynPortName: "{{name}}" NumberOfAxes: "{{NAxes}}" databases: - file: pmacCsController.template args: PORT: "{{name}}" TIMEOUT: "{{Controller.TIMEOUT}}" PARENTPORT: "{{Controller.name}}" PMAC: "{{Controller.P}}" CS:
Definition is implemented in the code using a class of the same name.
Entity#
ibek can generate an IOC instance using an
IOC instance entity file. This is
a YAML file with name of the form <ioc_name>.<container>.yaml
.
The IOC instance entity file declares the Entities that the IOC instance requires.
An Entity represents any piece of functionality of an IOC that is configured through EPICS database and/or startup script.
The classes of Entity that can be instantiated for a given generic IOC are declared in the Definitions files described above.
Declaring an Entity for an IOC instance will cause ibek to generate lines in the startup script. The generated startup script will also supply the EPICS database entries using dbLoadRecords and database templates.
The example motion IOC instance bl45p-mo-ioc-02 has the following entities:
DlsPmacAsynIPPort (one instance)
represents a connection to a motion controller
configured via
pmacAsynIPConfigure in the boot script
Geobrick (one instance)
represents the motion controller itself
configured via
pmacCreateController in boot script
pmacCreateAxes in the boot script
dbLoadRecords of pmacController.template and pmacStatus.template
DlsPmacAsynMotor (two instances)
represents a single motor connected to the controller
configured via:
dbLoadRecords of dls_pmac_asyn_motor.template
The example IOC instance entity file is shown below along with the st.cmd file that ibek will generate from it.
Click the arrows to reveal the files.
bl45p-mo-ioc-02.ibek.ioc.yaml
# yaml-language-server: $schema=../schemas/pmac.ibek.support.schema.json ioc_name: bl45p-mo-ioc-02 description: an example motion ioc for ibek testing generic_ioc_image: ghcr.io/epics-containers/ioc-pmac:main.run entities: - type: pmac.PmacAsynIPPort name: BRICK1port IP: 192.168.0.12:1112 - type: pmac.Geobrick name: BL45P-MO-BRICK-01 PORT: BRICK1port P: "BL45P-MO-STEP-01:" numAxes: 8 idlePoll: 100 movingPoll: 500 - type: pmac.DlsPmacAsynMotor name: X1 motor Controller: BL45P-MO-BRICK-01 axis: 1 P: BL45P-MO-THIN-01 M: ":X1" MRES: 0.001 - type: pmac.DlsPmacAsynMotor name: Y1 motor Controller: BL45P-MO-BRICK-01 axis: 2 P: BL45P-MO-THIN-01 M: ":Y1" MRES: 0.001st.cmd
# EPICS IOC Startup Script generated by https://github.com/epics-containers/ibek cd "/repos/epics/ioc" dbLoadDatabase dbd/ioc.dbd ioc_registerRecordDeviceDriver pdbbase # pmacAsynIPConfigure AsynPortName IPAddress pmacAsynIPConfigure BRICK1port 192.168.0.12:1112:1025 # pmacCreateController AsynPortName PmacAsynPort Address NumAxes MovingPollPeriod IdlePollPeriod pmacCreateController BL45P-MO-BRICK-01 BRICK1port 0 8 500 100 pmacCreateAxes BL45P-MO-BRICK-01 8 dbLoadRecords /tmp/ioc.db iocInit
Entity is implemented in the code using a class of the same name.
Schemas#
The YAML files described above are constrained by schemas. These schemas are available to the developer and may be used to assist in generating the YAML.
Note that the author of an IOC instance needs access to <container>.schema.json in order to correctly craft a correct <ioc>.<container>.yaml. For this reason the container schema file is published as a github artifact along with the release of the container image. All other ibek operations happen within the container or during container development.
Thus, the sequence of files is as follows:
num |
Name |
Description |
---|---|---|
1 |
ibek.defs.schema.json |
Global Schema for 2 |
2 |
<support>.ibek.support.yaml |
Definition file for a support module. Generates part of 3 |
3 |
<container>.entities.schema.json |
Schema for 4. Generated by combining all of 2 from a container |
4 |
<ioc>.ibek.ioc.yaml |
Description of Entities for an IOC instance. |
5 |
IOC Startup Script st.cmd |
Startup script for booting the IOC |
The Global Schema and example IOC instance schema are below:
ibek.defs.schema.json
{ "$defs": { "BoolArg": { "additionalProperties": false, "description": "An argument with an bool value", "properties": { "type": { "const": "bool", "default": "bool", "title": "Type" }, "name": { "description": "Name of the argument that the IOC instance should pass", "title": "Name", "type": "string" }, "description": { "description": "Description of what the argument will be used for", "title": "Description", "type": "string" }, "default": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Default" } }, "required": [ "name", "description" ], "title": "BoolArg", "type": "object" }, "Comment": { "additionalProperties": false, "description": "\n A script snippet that will have '# ' prepended to every line\n for insertion into the startup script\n ", "properties": { "type": { "const": "comment", "default": "comment", "title": "Type" }, "when": { "allOf": [ { "$ref": "#/$defs/When" } ], "default": "every", "description": "One of first / every / last" }, "value": { "default": "", "description": "A comment to add into the startup script", "title": "Value", "type": "string" } }, "title": "Comment", "type": "object" }, "Database": { "additionalProperties": false, "description": "\n A database file that should be loaded by the startup script and its args\n ", "properties": { "file": { "description": "Filename of the database template in <module_root>/db", "title": "File", "type": "string" }, "args": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "description": "Dictionary of args and values to pass through to database. A value of None is equivalent to ARG: '{{ ARG }}'", "title": "Args", "type": "object" } }, "required": [ "file", "args" ], "title": "Database", "type": "object" }, "Definition": { "additionalProperties": false, "description": "\n A single definition of a class of Entity that an IOC instance may instantiate\n ", "properties": { "name": { "description": "Publish Definition as type <module>.<name> for IOC instances", "title": "Name", "type": "string" }, "description": { "description": "A description of the Support module defined here", "title": "Description", "type": "string" }, "args": { "default": [], "description": "The arguments IOC instance should supply", "items": { "anyOf": [ { "$ref": "#/$defs/FloatArg" }, { "$ref": "#/$defs/StrArg" }, { "$ref": "#/$defs/IntArg" }, { "$ref": "#/$defs/BoolArg" }, { "$ref": "#/$defs/ObjectArg" }, { "$ref": "#/$defs/IdArg" } ] }, "title": "Args", "type": "array" }, "values": { "default": [], "description": "The values IOC instance should supply", "items": { "$ref": "#/$defs/Value" }, "title": "Values", "type": "array" }, "databases": { "default": [], "description": "Databases to instantiate", "items": { "$ref": "#/$defs/Database" }, "title": "Databases", "type": "array" }, "pre_init": { "default": [], "description": "Startup script snippets to add before iocInit()", "items": { "anyOf": [ { "$ref": "#/$defs/Function" }, { "$ref": "#/$defs/Comment" }, { "$ref": "#/$defs/Text" } ] }, "title": "Pre Init", "type": "array" }, "post_init": { "default": [], "description": "Startup script snippets to add post iocInit(), such as dbpf", "items": { "anyOf": [ { "$ref": "#/$defs/Function" }, { "$ref": "#/$defs/Comment" }, { "$ref": "#/$defs/Text" } ] }, "title": "Post Init", "type": "array" }, "env_vars": { "default": [], "description": "Environment variables to set in the boot script", "items": { "$ref": "#/$defs/EnvironmentVariable" }, "title": "Env Vars", "type": "array" } }, "required": [ "name", "description" ], "title": "Definition", "type": "object" }, "EnvironmentVariable": { "additionalProperties": false, "description": "\n An environment variable that should be set in the startup script\n ", "properties": { "name": { "description": "Name of environment variable", "title": "Name", "type": "string" }, "value": { "description": "Value to set", "title": "Value", "type": "string" } }, "required": [ "name", "value" ], "title": "EnvironmentVariable", "type": "object" }, "FloatArg": { "additionalProperties": false, "description": "An argument with a float value", "properties": { "type": { "const": "float", "default": "float", "title": "Type" }, "name": { "description": "Name of the argument that the IOC instance should pass", "title": "Name", "type": "string" }, "description": { "description": "Description of what the argument will be used for", "title": "Description", "type": "string" }, "default": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Default" } }, "required": [ "name", "description" ], "title": "FloatArg", "type": "object" }, "Function": { "additionalProperties": false, "description": "\n A script snippet that defines a function to call\n ", "properties": { "name": { "description": "Name of the function to call", "title": "Name", "type": "string" }, "args": { "description": "The arguments to pass to the function", "title": "Args", "type": "object" }, "header": { "default": "", "description": "commands/comments to appear before the function", "title": "Header", "type": "string" }, "when": { "allOf": [ { "$ref": "#/$defs/When" } ], "default": "every", "description": "one of first / every / last" }, "type": { "const": "function", "default": "function", "title": "Type" } }, "required": [ "name", "args" ], "title": "Function", "type": "object" }, "IdArg": { "additionalProperties": false, "description": "Explicit ID argument that an object can refer to", "properties": { "type": { "const": "id", "default": "id", "title": "Type" }, "name": { "description": "Name of the argument that the IOC instance should pass", "title": "Name", "type": "string" }, "description": { "description": "Description of what the argument will be used for", "title": "Description", "type": "string" }, "default": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Default" } }, "required": [ "name", "description" ], "title": "IdArg", "type": "object" }, "IntArg": { "additionalProperties": false, "description": "An argument with an int value", "properties": { "type": { "const": "int", "default": "int", "title": "Type" }, "name": { "description": "Name of the argument that the IOC instance should pass", "title": "Name", "type": "string" }, "description": { "description": "Description of what the argument will be used for", "title": "Description", "type": "string" }, "default": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Default" } }, "required": [ "name", "description" ], "title": "IntArg", "type": "object" }, "ObjectArg": { "additionalProperties": false, "description": "A reference to another entity defined in this IOC", "properties": { "type": { "const": "object", "default": "object", "title": "Type" }, "name": { "description": "Name of the argument that the IOC instance should pass", "title": "Name", "type": "string" }, "description": { "description": "Description of what the argument will be used for", "title": "Description", "type": "string" }, "default": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Default" } }, "required": [ "name", "description" ], "title": "ObjectArg", "type": "object" }, "StrArg": { "additionalProperties": false, "description": "An argument with a str value", "properties": { "type": { "const": "str", "default": "str", "title": "Type" }, "name": { "description": "Name of the argument that the IOC instance should pass", "title": "Name", "type": "string" }, "description": { "description": "Description of what the argument will be used for", "title": "Description", "type": "string" }, "default": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Default" } }, "required": [ "name", "description" ], "title": "StrArg", "type": "object" }, "Text": { "additionalProperties": false, "description": "\n A script snippet to insert into the startup script\n ", "properties": { "type": { "const": "text", "default": "text", "title": "Type" }, "when": { "default": "every", "description": "One of first / every / last", "title": "When", "type": "string" }, "value": { "default": "", "description": "raw text to add to the startup script", "title": "Value", "type": "string" } }, "title": "Text", "type": "object" }, "Value": { "additionalProperties": false, "description": "A calculated string value for a definition", "properties": { "name": { "description": "Name of the value that the IOC instance will expose", "title": "Name", "type": "string" }, "description": { "description": "Description of what the value will be used for", "title": "Description", "type": "string" }, "value": { "description": "The contents of the value", "title": "Value", "type": "string" } }, "required": [ "name", "description", "value" ], "title": "Value", "type": "object" }, "When": { "enum": [ "first", "every", "last" ], "title": "When", "type": "string" } }, "additionalProperties": false, "description": "\n Lists the definitions for a support module, this defines what Entities it supports\n\n Provides the deserialize entry point.\n ", "properties": { "module": { "description": "Support module name, normally the repo name", "title": "Module", "type": "string" }, "defs": { "description": "The definitions an IOC can create using this module", "items": { "$ref": "#/$defs/Definition" }, "title": "Defs", "type": "array" } }, "required": [ "module", "defs" ], "title": "Support", "type": "object" }pmac.ibek.entities.schema.json
{ "$defs": { "EntityModel": { "discriminator": { "mapping": { "pmac.CS": "#/$defs/pmac_CS", "pmac.DlsCsPmacAsynMotor": "#/$defs/pmac_DlsCsPmacAsynMotor", "pmac.DlsPmacAsynMotor": "#/$defs/pmac_DlsPmacAsynMotor", "pmac.Geobrick": "#/$defs/pmac_Geobrick", "pmac.PmacAsynIPPort": "#/$defs/pmac_PmacAsynIPPort", "pmac.PmacAsynSSHPort": "#/$defs/pmac_PmacAsynSSHPort", "pmac.autohome": "#/$defs/pmac_autohome", "pmac.pmacDisableLimitsCheck": "#/$defs/pmac_pmacDisableLimitsCheck" }, "propertyName": "type" }, "oneOf": [ { "$ref": "#/$defs/pmac_PmacAsynSSHPort" }, { "$ref": "#/$defs/pmac_PmacAsynIPPort" }, { "$ref": "#/$defs/pmac_Geobrick" }, { "$ref": "#/$defs/pmac_DlsPmacAsynMotor" }, { "$ref": "#/$defs/pmac_DlsCsPmacAsynMotor" }, { "$ref": "#/$defs/pmac_pmacDisableLimitsCheck" }, { "$ref": "#/$defs/pmac_autohome" }, { "$ref": "#/$defs/pmac_CS" } ], "title": "EntityModel" }, "pmac_CS": { "additionalProperties": false, "properties": { "type": { "const": "pmac.CS", "default": "pmac.CS", "description": "The type of this entity", "title": "Type" }, "entity_enabled": { "default": true, "description": "enable or disable this entity instance", "title": "Entity Enabled", "type": "boolean" }, "name": { "default": null, "description": "Asyn port name for this object", "title": "Name", "type": "string" }, "Controller": { "default": null, "description": "the PMAC Controller", "title": "Controller" }, "CS": { "default": null, "description": "Coordinate system number", "title": "Cs", "type": "integer" }, "NAxes": { "default": 9, "description": "number of CS axes", "title": "Naxes", "type": "integer" }, "Program": { "default": 10, "description": "PROG number for CS motion", "title": "Program", "type": "integer" } }, "title": "pmac_CS", "type": "object" }, "pmac_DlsCsPmacAsynMotor": { "additionalProperties": false, "properties": { "type": { "const": "pmac.DlsCsPmacAsynMotor", "default": "pmac.DlsCsPmacAsynMotor", "description": "The type of this entity", "title": "Type" }, "entity_enabled": { "default": true, "description": "enable or disable this entity instance", "title": "Entity Enabled", "type": "boolean" }, "name": { "default": null, "description": "Object name and gui association name", "title": "Name", "type": "string" }, "CsController": { "default": null, "description": "Coordinate system controller to attach to", "title": "Cscontroller" }, "axis": { "default": null, "description": "which axis number this motor drives", "title": "Axis", "type": "integer" }, "P": { "default": null, "description": "PV prefix name for this motor", "title": "P", "type": "string" }, "M": { "default": null, "description": "PV motor name for this motor", "title": "M", "type": "string" }, "DESC": { "default": "", "description": "Description, displayed on EDM screen", "title": "Desc", "type": "string" }, "MRES": { "default": 0.0001, "description": "Motor Step Size (EGU)", "title": "Mres", "type": "number" }, "VELO": { "default": 1.0, "description": "axis Velocity (EGU/s)", "title": "Velo", "type": "number" }, "PREC": { "default": 3, "description": "Display Precision", "title": "Prec", "type": "integer" }, "EGU": { "default": "mm", "description": "Engineering Units", "title": "Egu", "type": "string" }, "TWV": { "default": 1.0, "description": "Tweak Step Size (EGU)", "title": "Twv", "type": "number" }, "DTYP": { "default": "asynMotor", "description": "Datatype of record", "title": "Dtyp", "type": "string" }, "DIR": { "default": 0, "description": "User direction", "title": "Dir", "type": "integer" }, "VBAS": { "default": 1.0, "description": "Base Velocity (EGU/s)", "title": "Vbas", "type": "number" }, "VMAX": { "default": "{{VELO}}", "description": "Max Velocity (EGU/s)", "title": "Vmax", "type": "string" }, "ACCL": { "default": 0.5, "description": "Seconds to Velocity", "title": "Accl", "type": "number" }, "BDST": { "default": 0.0, "description": "BL Distance (EGU)", "title": "Bdst", "type": "number" }, "BVEL": { "default": 0.0, "description": "BL Velocity(EGU/s)", "title": "Bvel", "type": "number" }, "BACC": { "default": 0.0, "description": "BL Seconds to Veloc", "title": "Bacc", "type": "number" }, "DHLM": { "default": 10000.0, "description": "Dial High Limit", "title": "Dhlm", "type": "number" }, "DLLM": { "default": -10000.0, "description": "Dial low limit", "title": "Dllm", "type": "number" }, "HLM": { "default": 0.0, "description": "User High Limit", "title": "Hlm", "type": "number" }, "LLM": { "default": 0.0, "description": "User Low Limit", "title": "Llm", "type": "number" }, "HLSV": { "default": "MAJOR", "description": "HW Lim, Violation Svr", "title": "Hlsv", "type": "string" }, "INIT": { "default": "", "description": "Startup commands", "title": "Init", "type": "string" }, "SREV": { "default": 1000, "description": "Steps per Revolution", "title": "Srev", "type": "integer" }, "RRES": { "default": 0.0, "description": "Readback Step Size (EGU", "title": "Rres", "type": "number" }, "ERES": { "default": 0.0, "description": "Encoder Step Size (EGU)", "title": "Eres", "type": "number" }, "JAR": { "default": 0.0, "description": "Jog Acceleration (EGU/s^2)", "title": "Jar", "type": "number" }, "UEIP": { "default": 0, "description": "Use Encoder If Present", "title": "Ueip", "type": "integer" }, "URIP": { "default": 0, "description": "Use RDBL If Present", "title": "Urip", "type": "integer" }, "RDBL": { "default": "0", "description": "Readback Location, set URIP =1 if you specify this", "title": "Rdbl", "type": "string" }, "RLNK": { "default": "", "description": "Readback output link", "title": "Rlnk", "type": "string" }, "RTRY": { "default": 0, "description": "Max retry count", "title": "Rtry", "type": "integer" }, "DLY": { "default": 0.0, "description": "Readback settle time (s)", "title": "Dly", "type": "number" }, "OFF": { "default": 0.0, "description": "User Offset (EGU)", "title": "Off", "type": "number" }, "RDBD": { "default": 0.0, "description": "Retry Deadband (EGU)", "title": "Rdbd", "type": "number" }, "FOFF": { "default": 0, "description": "Freeze Offset, 0=variable, 1=frozen", "title": "Foff", "type": "integer" }, "ADEL": { "default": 0.0, "description": "Alarm monitor deadband (EGU)", "title": "Adel", "type": "number" }, "NTM": { "default": 1, "description": "New Target Monitor, only set to 0 for soft motors", "title": "Ntm", "type": "integer" }, "FEHEIGH": { "default": 0.0, "description": "HIGH limit for following error", "title": "Feheigh", "type": "number" }, "FEHIHI": { "default": 0.0, "description": "HIHI limit for following error", "title": "Fehihi", "type": "number" }, "FEHHSV": { "default": "NO_ALARM", "description": "HIHI alarm severity for following error", "title": "Fehhsv", "type": "string" }, "FEHSV": { "default": "NO_ALARM", "description": "HIGH alarm severity for following error", "title": "Fehsv", "type": "string" }, "SCALE": { "default": 1, "description": "", "title": "Scale", "type": "integer" }, "HOMEVIS": { "default": 1, "description": "If 1 then home is visible on the gui", "title": "Homevis", "type": "integer" }, "HOMEVISSTR": { "default": "Use motor summary screen", "description": "", "title": "Homevisstr", "type": "string" }, "alh": { "default": "", "description": "Set this to alh to add the motor to the alarm handler and send emails", "title": "Alh", "type": "string" }, "HOME": { "default": "{{P}}", "description": "Prefix for autohome instance. Defaults to $(P) If unspecified", "title": "Home", "type": "string" }, "ALLOW_HOMED_SET": { "default": "#", "description": "Set to a blank to allow this axis to have its homed", "title": "Allow Homed Set", "type": "string" } }, "title": "pmac_DlsCsPmacAsynMotor", "type": "object" }, "pmac_DlsPmacAsynMotor": { "additionalProperties": false, "properties": { "type": { "const": "pmac.DlsPmacAsynMotor", "default": "pmac.DlsPmacAsynMotor", "description": "The type of this entity", "title": "Type" }, "entity_enabled": { "default": true, "description": "enable or disable this entity instance", "title": "Entity Enabled", "type": "boolean" }, "name": { "default": null, "description": "Object name and gui association name", "title": "Name", "type": "string" }, "Controller": { "default": null, "description": "PMAC Controller to attach to", "title": "Controller" }, "axis": { "default": null, "description": "which axis number this motor drives", "title": "Axis", "type": "integer" }, "P": { "default": null, "description": "PV prefix name for this motor", "title": "P", "type": "string" }, "M": { "default": null, "description": "PV motor name for this motor", "title": "M", "type": "string" }, "DESC": { "default": "", "description": "Description, displayed on EDM screen", "title": "Desc", "type": "string" }, "MRES": { "default": 0.0001, "description": "Motor Step Size (EGU)", "title": "Mres", "type": "number" }, "VELO": { "default": 1.0, "description": "axis Velocity (EGU/s)", "title": "Velo", "type": "number" }, "PREC": { "default": 3, "description": "Display Precision", "title": "Prec", "type": "integer" }, "EGU": { "default": "mm", "description": "Engineering Units", "title": "Egu", "type": "string" }, "TWV": { "default": 1.0, "description": "Tweak Step Size (EGU)", "title": "Twv", "type": "number" }, "DTYP": { "default": "asynMotor", "description": "Datatype of record", "title": "Dtyp", "type": "string" }, "DIR": { "default": 0, "description": "User direction", "title": "Dir", "type": "integer" }, "VBAS": { "default": 1.0, "description": "Base Velocity (EGU/s)", "title": "Vbas", "type": "number" }, "VMAX": { "default": "{{VELO}}", "description": "Max Velocity (EGU/s)", "title": "Vmax", "type": "string" }, "ACCL": { "default": 0.5, "description": "Seconds to Velocity", "title": "Accl", "type": "number" }, "BDST": { "default": 0.0, "description": "BL Distance (EGU)", "title": "Bdst", "type": "number" }, "BVEL": { "default": 0.0, "description": "BL Velocity(EGU/s)", "title": "Bvel", "type": "number" }, "BACC": { "default": 0.0, "description": "BL Seconds to Veloc", "title": "Bacc", "type": "number" }, "DHLM": { "default": 10000.0, "description": "Dial High Limit", "title": "Dhlm", "type": "number" }, "DLLM": { "default": -10000.0, "description": "Dial low limit", "title": "Dllm", "type": "number" }, "HLM": { "default": 0.0, "description": "User High Limit", "title": "Hlm", "type": "number" }, "LLM": { "default": 0.0, "description": "User Low Limit", "title": "Llm", "type": "number" }, "HLSV": { "default": "MAJOR", "description": "HW Lim, Violation Svr", "title": "Hlsv", "type": "string" }, "INIT": { "default": "", "description": "Startup commands", "title": "Init", "type": "string" }, "SREV": { "default": 1000, "description": "Steps per Revolution", "title": "Srev", "type": "integer" }, "RRES": { "default": 0.0, "description": "Readback Step Size (EGU", "title": "Rres", "type": "number" }, "ERES": { "default": 0.0, "description": "Encoder Step Size (EGU)", "title": "Eres", "type": "number" }, "JAR": { "default": 0.0, "description": "Jog Acceleration (EGU/s^2)", "title": "Jar", "type": "number" }, "UEIP": { "default": 0, "description": "Use Encoder If Present", "title": "Ueip", "type": "integer" }, "URIP": { "default": 0, "description": "Use RDBL If Present", "title": "Urip", "type": "integer" }, "RDBL": { "default": "0", "description": "Readback Location, set URIP =1 if you specify this", "title": "Rdbl", "type": "string" }, "RLNK": { "default": "", "description": "Readback output link", "title": "Rlnk", "type": "string" }, "RTRY": { "default": 0, "description": "Max retry count", "title": "Rtry", "type": "integer" }, "DLY": { "default": 0.0, "description": "Readback settle time (s)", "title": "Dly", "type": "number" }, "OFF": { "default": 0.0, "description": "User Offset (EGU)", "title": "Off", "type": "number" }, "RDBD": { "default": 0.0, "description": "Retry Deadband (EGU)", "title": "Rdbd", "type": "number" }, "FOFF": { "default": 0, "description": "Freeze Offset, 0=variable, 1=frozen", "title": "Foff", "type": "integer" }, "ADEL": { "default": 0.0, "description": "Alarm monitor deadband (EGU)", "title": "Adel", "type": "number" }, "NTM": { "default": 1, "description": "New Target Monitor, only set to 0 for soft motors", "title": "Ntm", "type": "integer" }, "FEHIGH": { "default": 0.0, "description": "HIGH limit for following error", "title": "Fehigh", "type": "number" }, "FEHIHI": { "default": 0.0, "description": "HIHI limit for following error", "title": "Fehihi", "type": "number" }, "FEHHSV": { "default": "NO_ALARM", "description": "HIHI alarm severity for following error", "title": "Fehhsv", "type": "string" }, "FEHSV": { "default": "NO_ALARM", "description": "HIGH alarm severity for following error", "title": "Fehsv", "type": "string" }, "SCALE": { "default": 1, "description": "", "title": "Scale", "type": "integer" }, "HOMEVIS": { "default": 1, "description": "If 1 then home is visible on the gui", "title": "Homevis", "type": "integer" }, "HOMEVISSTR": { "default": "Use motor summary screen", "description": "", "title": "Homevisstr", "type": "string" }, "alh": { "default": "", "description": "Set this to alh to add the motor to the alarm handler and send emails", "title": "Alh", "type": "string" }, "HOME": { "default": "{{P}}", "description": "Prefix for autohome instance. Defaults to $(P) If unspecified", "title": "Home", "type": "string" }, "ALLOW_HOMED_SET": { "default": "#", "description": "Set to a blank to allow this axis to have its homed", "title": "Allow Homed Set", "type": "string" }, "RLINK": { "default": "", "description": "not sure what this is", "title": "Rlink", "type": "string" } }, "title": "pmac_DlsPmacAsynMotor", "type": "object" }, "pmac_Geobrick": { "additionalProperties": false, "properties": { "type": { "const": "pmac.Geobrick", "default": "pmac.Geobrick", "description": "The type of this entity", "title": "Type" }, "entity_enabled": { "default": true, "description": "enable or disable this entity instance", "title": "Entity Enabled", "type": "boolean" }, "name": { "default": null, "description": "Name to use for the geobrick's asyn port", "title": "Name", "type": "string" }, "PORT": { "default": null, "description": "Asyn port name for PmacAsynIPPort to connect to", "title": "Port" }, "P": { "default": null, "description": "PV Prefix for all pmac db templates", "title": "P", "type": "string" }, "numAxes": { "default": 8, "description": "number of axes to initialize for the controller", "title": "Numaxes", "type": "integer" }, "idlePoll": { "default": 500, "description": "Idle Poll Period in ms", "title": "Idlepoll", "type": "integer" }, "movingPoll": { "default": 100, "description": "Moving Poll Period in ms", "title": "Movingpoll", "type": "integer" }, "TIMEOUT": { "default": 4, "description": "timeout in seconds for asyn", "title": "Timeout", "type": "integer" }, "FEEDRATE": { "default": 100, "description": "feedrate below which we go into error", "title": "Feedrate", "type": "integer" }, "CSG0": { "default": "", "description": "Name for Coordinate System Group 0", "title": "Csg0", "type": "string" }, "CSG1": { "default": "", "description": "Name for Coordinate System Group 1", "title": "Csg1", "type": "string" }, "CSG2": { "default": "", "description": "Name for Coordinate System Group 2", "title": "Csg2", "type": "string" }, "CSG3": { "default": "", "description": "Name for Coordinate System Group 3", "title": "Csg3", "type": "string" }, "CSG4": { "default": "", "description": "Name for Coordinate System Group 3", "title": "Csg4", "type": "string" } }, "title": "pmac_Geobrick", "type": "object" }, "pmac_PmacAsynIPPort": { "additionalProperties": false, "properties": { "type": { "const": "pmac.PmacAsynIPPort", "default": "pmac.PmacAsynIPPort", "description": "The type of this entity", "title": "Type" }, "entity_enabled": { "default": true, "description": "enable or disable this entity instance", "title": "Entity Enabled", "type": "boolean" }, "name": { "default": null, "description": "Asyn port name", "title": "Name", "type": "string" }, "IP": { "default": null, "description": "IP address of pmac", "title": "Ip", "type": "string" }, "PORT": { "default": 1025, "description": "TCP port for connection", "title": "Port", "type": "integer" } }, "title": "pmac_PmacAsynIPPort", "type": "object" }, "pmac_PmacAsynSSHPort": { "additionalProperties": false, "properties": { "type": { "const": "pmac.PmacAsynSSHPort", "default": "pmac.PmacAsynSSHPort", "description": "The type of this entity", "title": "Type" }, "entity_enabled": { "default": true, "description": "enable or disable this entity instance", "title": "Entity Enabled", "type": "boolean" }, "name": { "default": null, "description": "Asyn port name", "title": "Name", "type": "string" }, "IP": { "default": null, "description": "IP address of Power pmac", "title": "Ip", "type": "string" }, "USERNAME": { "default": "root", "description": "Username for login", "title": "Username", "type": "string" }, "PASSWORD": { "default": "deltatau", "description": "Password for login", "title": "Password", "type": "string" }, "PRIORITY": { "default": 0, "description": "Priority of the port", "title": "Priority", "type": "integer" }, "NOAUTOCONNECT": { "default": 0, "description": "Disables autoconnect if set to 1", "title": "Noautoconnect", "type": "integer" }, "NOEOS": { "default": 0, "description": "No EOS used if set to 1", "title": "Noeos", "type": "integer" } }, "title": "pmac_PmacAsynSSHPort", "type": "object" }, "pmac_autohome": { "additionalProperties": false, "properties": { "type": { "const": "pmac.autohome", "default": "pmac.autohome", "description": "The type of this entity", "title": "Type" }, "entity_enabled": { "default": true, "description": "enable or disable this entity instance", "title": "Entity Enabled", "type": "boolean" }, "Controller": { "default": null, "description": "the PMAC Controller", "title": "Controller" }, "PLC": { "default": null, "description": "PLC number of the auto home PLC", "title": "Plc", "type": "integer" }, "P": { "default": null, "description": "Prefix for auto home PVs", "title": "P", "type": "string" }, "GRP1": { "default": "All", "description": "name of the 'ALL' group of auto home axes", "title": "Grp1", "type": "string" }, "GRP2": { "default": "", "description": "name of the second group of auto home axes", "title": "Grp2", "type": "string" }, "GRP3": { "default": "", "description": "name of the third group of auto home axes", "title": "Grp3", "type": "string" }, "GRP4": { "default": "", "description": "name of the fourth group of auto home axes", "title": "Grp4", "type": "string" }, "GRP5": { "default": "", "description": "name of the fourth group of auto home axes", "title": "Grp5", "type": "string" }, "GRP6": { "default": "", "description": "name of the fourth group of auto home axes", "title": "Grp6", "type": "string" }, "GRP7": { "default": "", "description": "name of the fourth group of auto home axes", "title": "Grp7", "type": "string" }, "GRP8": { "default": "", "description": "name of the fourth group of auto home axes", "title": "Grp8", "type": "string" }, "GRP9": { "default": "", "description": "name of the fourth group of auto home axes", "title": "Grp9", "type": "string" } }, "title": "pmac_autohome", "type": "object" }, "pmac_pmacDisableLimitsCheck": { "additionalProperties": false, "properties": { "type": { "const": "pmac.pmacDisableLimitsCheck", "default": "pmac.pmacDisableLimitsCheck", "description": "The type of this entity", "title": "Type" }, "entity_enabled": { "default": true, "description": "enable or disable this entity instance", "title": "Entity Enabled", "type": "boolean" }, "Controller": { "default": null, "description": "Geobrick on which to disable limits", "title": "Controller" }, "Axis": { "default": null, "description": "Axis to have limits disabled", "title": "Axis", "type": "integer" } }, "title": "pmac_pmacDisableLimitsCheck", "type": "object" } }, "additionalProperties": false, "properties": { "ioc_name": { "description": "Name of IOC instance", "title": "Ioc Name", "type": "string" }, "description": { "description": "Description of what the IOC does", "title": "Description", "type": "string" }, "generic_ioc_image": { "description": "The generic IOC container image registry URL", "title": "Generic Ioc Image", "type": "string" }, "entities": { "description": "List of entities this IOC instantiates", "items": { "$ref": "#/$defs/EntityModel" }, "title": "Entities", "type": "array" } }, "required": [ "ioc_name", "description", "generic_ioc_image", "entities" ], "title": "NewIOC", "type": "object" }
This results in the overall generated file structure:
Commands#
The ibek commands to progress through the file sequence above are as follows
num |
Name |
Command |
---|---|---|
1 |
|
|
2 |
|
Hand crafted by the container developer. Held in the container. |
3 |
|
|
4 |
|
Hand crafted at IOC instance design time |
5 |
IOC startup script |
|