Skip to content
Snippets Groups Projects
Commit 5f313444 authored by Kyrre Ness Sjobaek's avatar Kyrre Ness Sjobaek
Browse files

First attempt at EPICS IOC

parent c0156c09
Branches
Tags
1 merge request!1Fixes output formatting and variable initialization, moving config to separate file, project folder correctly named, hopefully fixes network crashes
#
# Copyright (c) Jeong Han Lee
#
# This gconpi.proto is free software: you can redistribute
# it and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 2 of the
# License, or any newer version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt
#
#
# author : Jeong Han Lee
# email : jeonghan.lee@gmail.com
# date : Tuesday, July 28 18:58:10 KST 2015
# version : 0.2
#
# EPICS STREAM DB with STREAM for mightyohm.com Geiger Counter
# https://github.com/jeonghanlee/gconpi
#
#
# - 0.1 Tuesday, July 28 18:58:10 KST 2015, jhlee
# Software Revision
# - 0.2 Wednesday, July 29 20:03:37 KST 2015, jhlee
# Try to understand CPS_MSG and others,
# Add EGU and DESC to CPS,CPM,uSv,AvgMode records
#
record (stringin, "$(SYSDEV)MSG")
{
}
record (ai, "$(SYSDEV)POS")
{
field(DESC, "Gauge position")
field(DTYP, "stream")
field( INP, "@positionGauge.proto read_pos $(PORT))
field( EGU, "mm")
field(SCAN, "I/O Intr")
}
record (stringin, "$(SYSDEV)UNIT")
{
field(DESC, "Gauge position")
field(DTYP, "stream")
field( INP, "@positionGauge.proto read_unit($(SYSDEV)MSG) $(PORT))
# field( EGU, "")
field(SCAN, "1 second")
}
# EPICS StreamDevice driver for
# CLEAR's positionGaugeServer
# https://gitlab.cern.ch/CLEAR/arduino-positiongaugeserver/
# Developed using ESS E3 EPICS
#
# Kyrre Sjobak, May 2021
#
# Ouput format:
# I.e.
# '+0.000XX\r\n'
#
Terminator = CR LF;
ReplyTimeout = 10000;
ReadTimeout = 300;
read_pos
{
#in "%!6f%*2s";
in "%f, %*s";
}
read_unit
{
#in "%!*6f%*2s";
in "%*f, %s";
}
require stream
require iocstats
epicsEnvSet("TOP" "$(E3_CMD_TOP)")
epicsEnvSet("STREAM_PROTOCOL_PATH", ".:$(TOP)/db")
#CONNECTION CONFIGURATION
epicsEnvSet("IOCNAME", "TESTGAUGES")
epicsEnvSet("ARDUINO_IP", "192.168.1.31")
epicsEnvSet("PORT_X", "21")
epicsEnvSet("PORT_Y", "22")
drvAsynIPPortConfigure("CONN_X", "$(ARDUINO_IP):$(PORT_X)", 0, 0, 0)
#drvAsynIPPortConfigure("CONN_Y", "$(ARDUINO_IP):$(PORT_Y)", 0, 0, 0)
dbLoadRecords("$(TOP)/db/positionGauge.db", "SYSDEV=$(IOCNAME):X:,PORT=CONN_X")
#dbLoadRecords("$(TOP)/db/positionGauge.db", "SYSDEV=$(IOCNAME):Y:,PORT=CONN_Y")
dbLoadRecords("iocAdminSoft.db","IOC=$(IOCNAME):IocStat")
iocInit()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment