diff --git a/src/makeBaseApp/top/vlinacApp/Db/xxVirtualLinac.db b/src/makeBaseApp/top/vlinacApp/Db/xxVirtualLinac.db index 81ad20365..e083933a2 100644 --- a/src/makeBaseApp/top/vlinacApp/Db/xxVirtualLinac.db +++ b/src/makeBaseApp/top/vlinacApp/Db/xxVirtualLinac.db @@ -3,9 +3,16 @@ record(bi,"$(user):autoC") { field(PINI,"YES") field(INP, "0") field(DTYP,"Soft Channel") - field(ZNAM,"Operator control") + field(ZNAM,"Operator Control") field(ONAM,"Computer-Auto") } +record(bi,"$(user):trajSeqOnC") { + field(DESC, "Trajectory Sequence running") + field(INP, "0") + field(DTYP,"Soft Channel") + field(ZNAM,"Not Running") + field(ONAM,"Running") +} record(bo,"$(user):gunOnC") { field(DESC,"Controls e-gun") field(ASG,"$(user)") @@ -186,6 +193,116 @@ record(ao,"$(user):BM1:setCurrentC") { field(HOPR,"250") field(LOPR,"0") } +record(ao,"$(user)A:H1:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):H1:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:V1:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):V1:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:H2:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):H2:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:V2:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):V2:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:H3:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):H3:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:V3:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):V3:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:H4:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):H4:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:V4:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):V4:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:H5:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):H5:setCurrentC.VAL PP NMS") +} +record(ao,"$(user)A:V5:setCurrentC") { + field(DESC,"set output current") + field(PREC,"2") + field(EGU,"Amps") + field(DRVH,"5") + field(DRVL,"-5") + field(HOPR,"5") + field(LOPR,"-5") + field(OROC,".1") + field(OUT,"$(user):V5:setCurrentC.VAL PP NMS") +} record(calc,"$(user):randomM") { field(CALC,"(RNDM*.1)-.05") } diff --git a/src/makeBaseApp/top/vlinacApp/misc/README b/src/makeBaseApp/top/vlinacApp/misc/README index 50ba6d35a..c824de8aa 100644 --- a/src/makeBaseApp/top/vlinacApp/misc/README +++ b/src/makeBaseApp/top/vlinacApp/misc/README @@ -1,8 +1,36 @@ +Virtual LINAC Demo + +The Virtual LINAC Demo is an EPICS ioc application that simulates +an electron beam progressing down a LINAC. Several steering coils, +BPMs, and other typical accelerator components are simulated. +See Virtual_Linac_Info.pdf for a complete explanation. + +For full functionality the sequencer module and a two +sequence programs must be built and loaded. The raw template +has these items commented out because the sequencer is not +part of base. The following steps must be accomplished: + - Uncomment the SNCSEQ definition line in + configure/RELEASE and define the link to the location + where the sequencer was installed. + + - Uncomment the following lines in src/Makefile + vlinac_SRCS += beamTrajectory.st + vlinac_SRCS += autoControl.st + vlinac_LIBS += seq pv + + - Uncomment the following lines in src/vlinacInclude.dbd + registrar(beamTrajectoryRegistrar) + registrar(autoControlRegistrar) + + - Uncomment the following lines in iocBoot/iocvlinac/st.cmd + seq &beamTrajectory, "user=xxx" + seq &autoControl, "user=xxx" + + - Rebuild the entire application and start (reboot) the ioc + This directory (misc) contains additional files to compliment the virtual linac demo application. -For full functionality the sequencer module must be built and loaded. - Virtual_Linac_Info.pdf : Description of the Virtual Linac *.adl : medm display files *.gif : images used in medm files @@ -11,6 +39,5 @@ To start the ioc, refer to the README file in the iocBoot directory. To start medm, use the following command: -medm -local -x -macro user=_USER_ Virtual_Linac.adl - +medm -local -x -macro user=nda Virtual_Linac.adl diff --git a/src/makeBaseApp/top/vlinacApp/misc/Virtual_Linac.adl b/src/makeBaseApp/top/vlinacApp/misc/Virtual_Linac.adl index c4ecffaba..1cfcbc6cc 100644 --- a/src/makeBaseApp/top/vlinacApp/misc/Virtual_Linac.adl +++ b/src/makeBaseApp/top/vlinacApp/misc/Virtual_Linac.adl @@ -240,56 +240,6 @@ rectangle { width=1 } } -"cartesian plot" { - object { - x=105 - y=23 - width=1000 - height=217 - } - plotcom { - title="Electron LINAC Beam Position" - clr=14 - bclr=2 - } - style="line" - erase_oldest="plot last n pts" - trace[0] { - xdata="$(user):PM:distancesWF" - ydata="$(user):PM:iTrajectoryWF" - data_clr=20 - } - trace[1] { - xdata="$(user):PM:distancesWF" - ydata="$(user):PM:xTrajectoryWF" - data_clr=53 - } - trace[2] { - xdata="$(user):PM:distancesWF" - ydata="$(user):PM:yTrajectoryWF" - data_clr=49 - } - trace[3] { - xdata="$(user):PM:refLocationsWF" - ydata="$(user):PM:referenceHiWF" - data_clr=30 - } - trace[4] { - xdata="$(user):PM:refLocationsWF" - ydata="$(user):PM:referenceLoWF" - data_clr=30 - } - x_axis { - rangeStyle="user-specified" - maxRange=60.000000 - } - y1_axis { - maxRange=0.000000 - } - y2_axis { - maxRange=0.000000 - } -} valuator { object { x=224 @@ -4621,3 +4571,111 @@ image { bclr=51 label=" MEDM Demo Display" } +text { + object { + x=337 + y=161 + width=591 + height=38 + } + "basic attribute" { + clr=14 + fill="outline" + } + textix="beamTrajectory sequence program is installed." + align="horiz. centered" +} +text { + object { + x=333 + y=81 + width=591 + height=38 + } + "basic attribute" { + clr=14 + fill="outline" + } + textix="A Cartesian plot of the beam trajectory" + align="horiz. centered" +} +text { + object { + x=352 + y=121 + width=591 + height=38 + } + "basic attribute" { + clr=14 + fill="outline" + } + textix="will be displayed here when the" + align="horiz. centered" +} +composite { + object { + x=129 + y=22 + width=1000 + height=217 + } + "composite name"="" + children { + "cartesian plot" { + object { + x=129 + y=22 + width=1000 + height=217 + } + plotcom { + title="Electron LINAC Beam Position" + clr=14 + bclr=2 + } + style="line" + erase_oldest="plot last n pts" + trace[0] { + xdata="$(user):PM:distancesWF" + ydata="$(user):PM:iTrajectoryWF" + data_clr=20 + } + trace[1] { + xdata="$(user):PM:distancesWF" + ydata="$(user):PM:xTrajectoryWF" + data_clr=53 + } + trace[2] { + xdata="$(user):PM:distancesWF" + ydata="$(user):PM:yTrajectoryWF" + data_clr=49 + } + trace[3] { + xdata="$(user):PM:refLocationsWF" + ydata="$(user):PM:referenceHiWF" + data_clr=30 + } + trace[4] { + xdata="$(user):PM:refLocationsWF" + ydata="$(user):PM:referenceLoWF" + data_clr=30 + } + x_axis { + rangeStyle="user-specified" + maxRange=60.000000 + } + y1_axis { + maxRange=0.000000 + } + y2_axis { + maxRange=0.000000 + } + } + } + "dynamic attribute" { + vis="if not zero" + calc="A" + chan="$(user):trajSeqOnC" + } +} diff --git a/src/makeBaseApp/top/vlinacApp/src/beamTrajectory.st b/src/makeBaseApp/top/vlinacApp/src/beamTrajectory.st index 3b30c8a66..b8a827c42 100644 --- a/src/makeBaseApp/top/vlinacApp/src/beamTrajectory.st +++ b/src/makeBaseApp/top/vlinacApp/src/beamTrajectory.st @@ -3,6 +3,9 @@ program beamTrajectory option -c; /* don't wait for all channels to connect */ option +r; /* reentrant */ +short seqRunning; +assign seqRunning to "{user}:trajSeqOnC"; + double CM1_I; assign CM1_I to "{user}:CM1:intensityM"; monitor CM1_I; @@ -107,6 +110,10 @@ state init { when() { + /* Indicate sequence is running */ + seqRunning = 1; + pvPut(seqRunning); + /* BPM Position from EGUN */ bpmFixedLocations[0] = 0.0; bpmFixedLocations[1] = 2.4;