Hands-on examples: Virtual Linac - Download and install: https://www.aps.anl.gov/epics/download/examples/vlinac_2013-04-12.tgz - Start "MEDM Virtual Linac" - Start "Start Virtual Linac" - Play with Virtual Linac Run MEDM in edit mode: - Copy VirtualLinac/startMedm to VirtualLinac/startMedmEdit, and edit so that MEDM starts in Edit mode. Note that you must delete not only "-x" but also "-macro ..." to run MEDM in edit mode. - Run startMedmEdit - We can't launch Virtual_Linac.adl directly from MEDM in edit mode, because it contains macros. Instead, we must launch it from a related display. - Use "File/New" and "File/Save As" to make the display "top.adl" - Add a related display widget that calls up the Virtual_Linac.adl display and supplies the macro "user" to it. RightMouseButton/Object/Controllers/Related Display Explore MEDM menus, tearoffs, RightMouseButton menu. Play with MEDM - Add a "Graphics/Text" widget to top.adl - Add a "Monitors/Text Monitor" on "$(user):GV1:positionM" - Add a Text Entry for "$(user):H1:setCurrentC" Exercises: 1 Make a disposable copy of Virtual_Linac.adl with which to play. 2 Look at "Beam On !!!" static text on Virtual_Linac.adl to see how one form of dynamic visibility works. 3 Make a new Graphic/Text object that is visible only when the beam is on "$(user):gunOnC" and the gate valve "$(user):GV1:positionM" is open. - Start with a copy of "Beam On !!!" - Use visibility mode "calc", rather than "if not zero" - Add the calc expression "a!=0" and test for beam on only - Add "$(user):GV1:positionM" as variable B - Change the calc expression to include "a!=0&&b==VVV" - Use "RightMouseButton/PV Info" to discover the desired numeric value VVV of "$(user):GV1:positionM") 4 Make a new display, PM.adl, containing position monitor fields "$(user):PM1:intensityM" "$(user):PM1:XpositionM" "$(user):PM1:YpositionM" copied from Virtual_Linac.adl. Size the display so that is has minimal extra space. Edit all occurrences of "PM1" to "PM$(N)". This display can now be used for any position monitor. 5 Make a new display, Two_PM.adl, and edit the related display widget in top.adl to call it up and supply the macro "user=xxx" to it. 6 Add two copies of PM.adl to Two_PM.adl - Make a rectangle - Group the rectangle - Note that the Resource Palette now contains a "Composite File" entry. - Edit the "Composite File" entry, specifying "PM.adl;user=$(user),N=1" - Make a second copy in the same way, this time specifying "N=2".