Skip to content

Ticket6056 add ioc attocube #1

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

Merged
merged 13 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.cpp text
*.h text
*.hpp text
*.java text
*.sh text eol=lf
*.bat text
*.cmd text
*.db text
*.dbd text
*.template text
*.substitutions text
*.py text
*.rst text
*.uxf text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.class binary
*.vi binary
7 changes: 7 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Linter
on: [pull_request]
jobs:
call-workflow:
uses: ISISComputingGroup/reusable-workflows/.github/workflows/linters.yml@main
with:
compare-branch: origin/main
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
O.*/
/db
/bin
/dbd
/include
/lib
/templates
test-reports
envPaths
cdCommands
dllPath.bat
runIOC.bat
runIOC.sh
relPaths.sh
*.tag
/data/
/doc/
*_info_positions.req
*_info_settings.req
*.py[cod]
__pycache__/
30 changes: 30 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD 3-Clause License

Copyright (c) 2024, Science and Technology Facilities Council
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Makefile for Asyn attocube support
#
# Created by ooy64575 on Thu May 16 16:34:28 2024
# Based on the Asyn streamSCPI template

TOP = .
include $(TOP)/configure/CONFIG

DIRS += configure
DIRS += $(wildcard *Sup)
DIRS += $(wildcard *App)
DIRS += $(wildcard *Top)
DIRS += $(wildcard iocBoot)

# The build order is controlled by these dependency rules:

# All dirs except configure depend on configure
$(foreach dir, $(filter-out configure, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += configure))

# Any *App dirs depend on all *Sup dirs
$(foreach dir, $(filter %App, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS))))

# Any *Top dirs depend on all *Sup and *App dirs
$(foreach dir, $(filter %Top, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS))))

# iocBoot depends on all *App dirs
iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS))

# Add any additional dependency rules here:

include $(TOP)/configure/RULES_TOP

ioctests:
.\system_tests\run_tests.bat
10 changes: 10 additions & 0 deletions attocubeSup/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TOP=..
include $(TOP)/configure/CONFIG
#=======================================

# Install .dbd and .db files
DB += attocube.db
DATA += attocube.proto

#=======================================
include $(TOP)/configure/RULES
131 changes: 131 additions & 0 deletions attocubeSup/attocube.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
record(bo, "$(P)SIM")
{
field(SCAN, "Passive")
field(DTYP, "Soft Channel")
field(ZNAM, "NO")
field(ONAM, "YES")
field(VAL, "$(RECSIM=0)")
field(PINI, "YES")
}

record(bo, "$(P)DISABLE")
{
field(DESC, "Disable comms")
field(PINI, "YES")
field(VAL, "$(DISABLE=0)")
field(OMSL, "supervisory")
field(ZNAM, "COMMS ENABLED")
field(ONAM, "COMMS DISABLED")
}

record(ai, "$(P)ANGLE")
{
field(DESC, "Angle")
field(EGU, "deg")
field(PREC, "2")
field(SCAN, "1 second")
field(DTYP, "stream")
field(INP, "@attocube.proto get_angle $(PORT)")
field(SIML, "$(P)SIM")
field(SIOL, "$(P)SIM:ANGLE")
field(SDIS, "$(P)DISABLE")
info(INTEREST, "HIGH")
info(archive, "VAL")
info(alarm, "ATTOCUBE")

}

record(ao, "$(P)ANGLE:SP")
{
field(DESC, "Angle Set Point")
field(EGU, "deg")
field(PREC, "2")
field(DRVH, "170")
field(DRVL, "-170")
field(DTYP, "stream")
field(OUT, "@attocube.proto set_angle $(PORT)")
field(SIML, "$(P)SIM")
field(SIOL, "$(P)SIM:ANGLE:SP")
field(SDIS, "$(P)DISABLE")
field(UDFS, "NO_ALARM")
info(archive, "VAL")
}

record(ai, "$(P)ARK")
{
field(DESC, "Ark")
field(EGU, "deg")
field(PREC, "2")
field(SCAN, "1 second")
field(DTYP, "stream")
field(INP, "@attocube.proto get_ark $(PORT)")
field(SIML, "$(P)SIM")
field(SIOL, "$(P)SIM:ARK")
field(SDIS, "$(P)DISABLE")
info(INTEREST, "HIGH")
info(archive, "VAL")
info(alarm, "ATTOCUBE")
}

record(ao, "$(P)ARK:SP")
{
field(DESC, "Ark Set Point")
field(EGU, "deg")
field(PREC, "2")
field(DRVH, "19")
field(DRVL, "-19")
field(DTYP, "stream")
field(OUT, "@attocube.proto set_ark $(PORT)")
field(SIML, "$(P)SIM")
field(SIOL, "$(P)SIM:ARK:SP")
field(SDIS, "$(P)DISABLE")
field(UDFS, "NO_ALARM")
info(archive, "VAL")
}

record(bo, "$(P)INIT")
{
field(DESC, "Initialisation commands")
field(PINI, "YES")
field(SCAN, "Passive")
field(DTYP, "stream")
field(OUT, "@attocube.proto initialise $(PORT)")
field(SDIS, "$(P)DISABLE")
}

record(bo, "$(P)STOP")
{
field(DESC, "Stop commands")
field(PINI, "NO")
field(SCAN, "Passive")
field(DTYP, "stream")
field(OUT, "@attocube.proto stop $(PORT)")
field(SDIS, "$(P)DISABLE")
}

record(bi, "$(P)BUSY")
{
field(DESC, "Busy")
field(SCAN, "1 second")
field(DTYP, "stream")
field(INP, "@attocube.proto get_busy $(PORT)")
field(ZNAM, "NOT BUSY")
field(ONAM, "BUSY")
field(SDIS, "$(P)DISABLE")
}

record(ao, "$(P)SIM:ANGLE")
{
field(SCAN, "Passive")
field(DTYP, "Soft Channel")
}

alias("$(P)SIM:ANGLE","$(P)SIM:ANGLE:SP")

record(ao, "$(P)SIM:ARK")
{
field(SCAN, "Passive")
field(DTYP, "Soft Channel")
}

alias("$(P)SIM:ARK","$(P)SIM:ARK:SP")
45 changes: 45 additions & 0 deletions attocubeSup/attocube.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ReadTimeout = 100;
OutTerminator = "\r\n";
InTerminator = "\r\n:";

get_angle {
out "ATANGLE=";
in "%f";
}

set_angle {
out "ATTO=%f";
out "ATGO=1";
}

get_ark {
out "Y=";
in "%f";
}

set_ark {
out "ARK=%f";
out "ARGO=1";
}

initialise {
out "VERBOSE=0";
out "AB0";
out "MO";
out "XQ #SXD";
out "MG \"stop 1\" {P2}";
}

stop {
out "AB0";
out "MO";
out "XQ #SXD";
out "MG \"stop 1\" {P2}";
}

get_busy {
ExtraInput = Ignore;
out "BUSY=";
in "%1i";
}

29 changes: 29 additions & 0 deletions configure/CONFIG
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CONFIG - Load build configuration data
#
# Do not make changes to this file!

# Allow user to override where the build rules come from
RULES = $(EPICS_BASE)

# RELEASE files point to other application tops
include $(TOP)/configure/RELEASE
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common
ifdef T_A
-include $(TOP)/configure/RELEASE.Common.$(T_A)
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A)
endif

CONFIG = $(RULES)/configure
include $(CONFIG)/CONFIG

# Override the Base definition:
INSTALL_LOCATION = $(TOP)

# CONFIG_SITE files contain other build configuration settings
include $(TOP)/configure/CONFIG_SITE
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common
ifdef T_A
-include $(TOP)/configure/CONFIG_SITE.Common.$(T_A)
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
endif

43 changes: 43 additions & 0 deletions configure/CONFIG_SITE
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# CONFIG_SITE

# Make any application-specific changes to the EPICS build
# configuration variables in this file.
#
# Host/target specific settings can be specified in files named
# CONFIG_SITE.$(EPICS_HOST_ARCH).Common
# CONFIG_SITE.Common.$(T_A)
# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)

# CHECK_RELEASE controls the consistency checking of the support
# applications pointed to by the RELEASE* files.
# Normally CHECK_RELEASE should be set to YES.
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
# continue building even if conflicts are found.
CHECK_RELEASE = YES

# Set this when you only want to compile this application
# for a subset of the cross-compiled target architectures
# that Base is built for.
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-ppc32

# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</absolute/path/to/install/top>

# Set this when the IOC and build host use different paths
# to the install location. This may be needed to boot from
# a Microsoft FTP server say, or on some NFS configurations.
#IOCS_APPL_TOP = </IOC's/absolute/path/to/install/top>

# For application debugging purposes, override the HOST_OPT and/
# or CROSS_OPT settings from base/configure/CONFIG_SITE
#HOST_OPT = NO
#CROSS_OPT = NO

# These allow developers to override the CONFIG_SITE variable
# settings without having to modify the configure/CONFIG_SITE
# file itself.
-include $(TOP)/../CONFIG_SITE.local
-include $(TOP)/configure/CONFIG_SITE.local

Loading