#!/bin/sh

caput FBCK:FB05:GN01:STATE 0

# 10 Hz
caput -a FBCK:FB05:GN01:POI1 21 0 0 0 0 0 0 0 32 0 0 55 0 0 0 0 0 0 0 0 0 0

# F matrix
caput -a FBCK:FB05:GN01:FMATRIX 3 1 1 1

# G matrix
caput -a FBCK:FB05:GN01:GMATRIX 1 1

# Loop configs
caput FBCK:FB05:GN01:NAME BunchChargeFILE
caput FBCK:FB05:GN01:INSTALLED 1
caput FBCK:FB05:GN01:TOTALPOI 1
caput FBCK:FB05:GN01:ITERATEFUNC BunchCharge

# Measurements
caput FBCK:FB05:GN01:M1DEVNAME FILE:/data/GN01/BPMS:IN20:221:TMIT
caput FBCK:FB05:GN01:M1USED 1
caput FBCK:FB05:GN01:M1CAMODE 1

caput FBCK:FB05:GN01:M2USED 0
caput FBCK:FB05:GN01:M3USED 0
caput FBCK:FB05:GN01:M4USED 0
caput FBCK:FB05:GN01:M5USED 0
caput FBCK:FB05:GN01:M6USED 0
caput FBCK:FB05:GN01:M7USED 0
caput FBCK:FB05:GN01:M8USED 0
caput FBCK:FB05:GN01:M9USED 0
caput FBCK:FB05:GN01:M10USED 0
caput FBCK:FB05:GN01:M11USED 0
caput FBCK:FB05:GN01:M12USED 0
caput FBCK:FB05:GN01:M13USED 0
caput FBCK:FB05:GN01:M14USED 0

# States
caput FBCK:FB05:GN01:S1DES 0.08
caput FBCK:FB05:GN01:S1NAME "Charge"
caput FBCK:FB05:GN01:S1USED 1

caput FBCK:FB05:GN01:S2USED 0
caput FBCK:FB05:GN01:S3USED 0
caput FBCK:FB05:GN01:S4USED 0

# Actuators
caput FBCK:FB05:GN01:A1DEVNAME FILE:/data/GN01/IOC:IN20:LS11:PCTRL
caput FBCK:FB05:GN01:A1USED 1
caput FBCK:FB05:GN01:A1CAMODE 1

caput FBCK:FB05:GN01:A2USED 0
caput FBCK:FB05:GN01:A3USED 0
caput FBCK:FB05:GN01:A4USED 0

#enable loop
caput FBCK:FB05:GN01:INSTALLED 1

caput FBCK:FB05:GN01:MEASNUM 1
caput FBCK:FB05:GN01:STATENUM 1
caput FBCK:FB05:GN01:ACTNUM 1
caput FBCK:FB05:GN01:PGAIN 0.2
caput FBCK:FB05:GN01:IGAIN 0

caput -a FBCK:FB05:GN01:REFORBIT 1 0
caput -a FBCK:FB05:GN01:ACTENERGY 1 0
