From 397a061d7261acbb9227dbbcc48a74e17b7db897 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 28 Jun 2022 18:24:33 -0700 Subject: [PATCH] add caputlog example --- iocBoot/iocputlog/Makefile | 5 +++++ iocBoot/iocputlog/putlog.acf | 15 +++++++++++++++ iocBoot/iocputlog/putlog.db | 26 ++++++++++++++++++++++++++ iocBoot/iocputlog/st.cmd | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 iocBoot/iocputlog/Makefile create mode 100644 iocBoot/iocputlog/putlog.acf create mode 100644 iocBoot/iocputlog/putlog.db create mode 100755 iocBoot/iocputlog/st.cmd diff --git a/iocBoot/iocputlog/Makefile b/iocBoot/iocputlog/Makefile new file mode 100644 index 0000000..79c4ce6 --- /dev/null +++ b/iocBoot/iocputlog/Makefile @@ -0,0 +1,5 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +ARCH = linux-x86_64 +TARGETS = envPaths +include $(TOP)/configure/RULES.ioc diff --git a/iocBoot/iocputlog/putlog.acf b/iocBoot/iocputlog/putlog.acf new file mode 100644 index 0000000..1b04192 --- /dev/null +++ b/iocBoot/iocputlog/putlog.acf @@ -0,0 +1,15 @@ +HAG(MYSELF) { + "$(USER)" +} + +ASG(DEFAULT) { + RULE(1,WRITE,TRAPWRITE) +} +ASG(SPECIAL) { + RULE(1,WRITE,TRAPWRITE) { + HAG(MYSELF) + } +} +ASG(RO) { + RULE(1, READ) +} diff --git a/iocBoot/iocputlog/putlog.db b/iocBoot/iocputlog/putlog.db new file mode 100644 index 0000000..06125b0 --- /dev/null +++ b/iocBoot/iocputlog/putlog.db @@ -0,0 +1,26 @@ + +record(ao, "$(P)A") { + info(Q:group, { + "$(P)G": { + "A": {+channel:"VAL", +putorder:3} + } + }) +} + +record(ao, "$(P)B") { + field(ASG , "SPECIAL") + info(Q:group, { + "$(P)G": { + "B": {+channel:"VAL", +putorder:2} + } + }) +} + +record(ao, "$(P)C") { + field(ASG , "RO") + info(Q:group, { + "$(P)G": { + "C": {+channel:"VAL", +putorder:1} + } + }) +} diff --git a/iocBoot/iocputlog/st.cmd b/iocBoot/iocputlog/st.cmd new file mode 100755 index 0000000..49c24fc --- /dev/null +++ b/iocBoot/iocputlog/st.cmd @@ -0,0 +1,35 @@ +#!../../bin/linux-x86_64-debug/softIocPVA + +# Normal IOC executables will be linked against libcaputlog +# at built time. Because pva2pva is usually built before +# caputlog, softIocPVA can't. Instead load dynamically. +# +# Requires a target and configuration w/ dynamic linking support. +# +# registerAllRecordDeviceDrivers added in Base >= 7.0.5 + +< envPaths +# or +#epicsEnvSet("CAPUTLOG", "/path/to/caputlog") + +dlload $(CAPUTLOG)/lib/$(ARCH)/libcaPutLog.so +dbLoadDatabase $(CAPUTLOG)/dbd/caPutLog.dbd +registerAllRecordDeviceDrivers + +dbLoadRecords("putlog.db","P=TST:") + +asSetFilename("$(PWD)/putlog.acf") +asSetSubstitutions("USER=$(USER)") +asInit + +var caPutLogDebug 5 +caPutLogInit localhost:3456 + +iocInit() + + +# concurrently run: +## nc -l -p 3456 + +# Then try: +## pvput TST:A 4