diff --git a/iocBoot/Makefile b/iocBoot/Makefile new file mode 100644 index 0000000..91e47d0 --- /dev/null +++ b/iocBoot/Makefile @@ -0,0 +1,6 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS += $(wildcard *ioc*) +DIRS += $(wildcard as*) +include $(CONFIG)/RULES_DIRS + diff --git a/iocBoot/README b/iocBoot/README new file mode 100644 index 0000000..9dd5d00 --- /dev/null +++ b/iocBoot/README @@ -0,0 +1,18 @@ +Demo IOCs + +ioccircle and ioccircle together demonstrate PVA groups and links. +ioccircle maintains a "phase" counter which counts from 0 to 359 +then rolls over. + +From this phase are calculated an X and Y which are points on a circule with radius 1. + +A group PVA PV is defined which includes both and X and Y. + +ioccircle2 contains two calc records which subscribe to the X and Y +from ioccircle and multiply each by 2. + +A second group PVA PV is defined including the multipled X and Y. + +Due to the atomicity of a group PV it is certain that pairs of +X and Y will not be mixed. In this example, the magnitude +sqrt(X*X+Y*Y) will never change by more than floating point epsilon. diff --git a/iocBoot/ioccircle/Makefile b/iocBoot/ioccircle/Makefile new file mode 100644 index 0000000..89d66d0 --- /dev/null +++ b/iocBoot/ioccircle/Makefile @@ -0,0 +1,5 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +ARCH = linux-x86_64-debug +TARGETS = envPaths +include $(TOP)/configure/RULES.ioc diff --git a/iocBoot/ioccircle/circle.db b/iocBoot/ioccircle/circle.db new file mode 100644 index 0000000..aa04ac3 --- /dev/null +++ b/iocBoot/ioccircle/circle.db @@ -0,0 +1,53 @@ +record(ao, "circle:step") { + field(VAL , "1.0") + field(DRVL, "0.0") + field(DRVH, "359") + field(PINI, "YES") +# field(TPRO, "1") +} + +record(ao, "circle:period") { + field(VAL , "1.0") + field(PINI, "YES") + field(OUT , "circle:y.ODLY NPP") +# field(TPRO, "1") +} + +record(calc, "circle:angle") { + field(PINI, "RUNNING") +# field(SCAN, "2 second") + field(INPA, "circle:angle NPP") + field(INPB, "circle:step NPP") + field(INPD, "360") + field(CALC, "C:=A+B;(C>D)?C-D:C") + field(FLNK, "circle:x") + field(PREC, "3") +# field(TPRO, "1") + info(pdbGroup, "circle|angle=VAL") +} + +record(calc, "circle:x") { + field(INPA, "circle:angle NPP") + field(CALC, "cos(A*PI/180)") + field(TSEL, "circle:angle.TIME") + field(FLNK, "circle:y") + field(PREC, "3") + info(pdbGroup, "circle|x=VAL") +} + +record(calc, "circle:y") { + field(INPA, "circle:angle NPP") + field(CALC, "sin(A*PI/180)") + field(TSEL, "circle:angle.TIME") + field(PREC, "3") + field(FLNK, "circle:tick") + info(pdbGroup, "circle|y=VAL") + info(pdbTrigger,"circle|y>*") + +} + +record(calcout, "circle:tick") { + field(ODLY, "1.0") + field(OUT , "circle:angle.PROC CA") # loop +# field(TPRO, "1") +} diff --git a/iocBoot/ioccircle/st.cmd b/iocBoot/ioccircle/st.cmd new file mode 100755 index 0000000..0a096fc --- /dev/null +++ b/iocBoot/ioccircle/st.cmd @@ -0,0 +1,5 @@ +#!../../bin/linux-x86_64-debug/softIocPVA + +dbLoadRecords("circle.db","") + +iocInit() diff --git a/iocBoot/ioccircle2/Makefile b/iocBoot/ioccircle2/Makefile new file mode 100644 index 0000000..89d66d0 --- /dev/null +++ b/iocBoot/ioccircle2/Makefile @@ -0,0 +1,5 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +ARCH = linux-x86_64-debug +TARGETS = envPaths +include $(TOP)/configure/RULES.ioc diff --git a/iocBoot/ioccircle2/circle2.db b/iocBoot/ioccircle2/circle2.db new file mode 100644 index 0000000..67718bd --- /dev/null +++ b/iocBoot/ioccircle2/circle2.db @@ -0,0 +1,27 @@ +record(calc, "circle2:x") { + field(INPA, "pva://circle.x CP") + field(CALC, "2*A") + field(FLNK, "circle2:y") + info(pdbGroup, "circle2|x=VAL") +# field(TPRO, "1") +} + +record(calc, "circle2:y") { + field(INPA, "pva://circle.y") + field(CALC, "2*A") + field(TSEL, "circle2:x.TIME") + field(FLNK, "circle2:mag") + info(pdbGroup, "circle2|y=VAL") +# field(TPRO, "1") +} + +record(calc, "circle2:mag") { + field(INPA, "circle2:x NPP") + field(INPB, "circle2:y NPP") + field(CALC, "SQRT(A*A+B*B)") + field(MDEL, "-1") + field(TSEL, "circle2:x.TIME") + info(pdbGroup, "circle2|mag=VAL") + info(pdbTrigger,"circle2|mag>*") +# field(TPRO, "1") +} diff --git a/iocBoot/ioccircle2/st.cmd b/iocBoot/ioccircle2/st.cmd new file mode 100755 index 0000000..ea3ad06 --- /dev/null +++ b/iocBoot/ioccircle2/st.cmd @@ -0,0 +1,5 @@ +#!../../bin/linux-x86_64-debug/softIocPVA + +dbLoadRecords("circle2.db","") + +iocInit()