source: MML/trunk/mml/machine2sim.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 993 bytes
Line 
1function machine2sim(ZeroCMFlag)
2%MACHINE2SIM - loads online machine configuration to AT configuration
3%  machine2sim(ZeroCMFlag)
4%
5%  ZeroCMFlag = 0 set the machine corrector setting to the simulator
6%               1 zero the correctors in the simulator {Default}
7%
8%  NOTES
9%  1. The RF frequency of the simulator is not changed
10%  2. Use ZeroCMFlag = 1 when you think the corrector magnets on the
11%     online machine are restoring the orbit to the design orbit (or close)
12%
13%  See also sim2machine, golden2sim
14%
15%  Written by Greg Portmann
16
17
18if nargin < 1
19    ZeroCMFlag = 1;
20end
21
22
23% Get from the online machine
24ConfigSetpoint = getmachineconfig('Online');
25
26
27% Set to the simulator (don't change the simulator RF)
28if isfamily('RF')
29    RFsim = getam('RF', 'Simulator');
30end
31if isfamily('RF')
32    setmachineconfig(ConfigSetpoint, 'Simulator');
33    setsp('RF', RFsim, 'Simulator');
34end
35
36if ZeroCMFlag
37    setsp(gethcmfamily, 0, 'Simulator');
38    setsp(getvcmfamily, 0, 'Simulator');
39end
40
Note: See TracBrowser for help on using the repository browser.