Skip to content

Commit

Permalink
Merge pull request #146 from KaushikMalapati/stats2
Browse files Browse the repository at this point in the history
Stats2
  • Loading branch information
KaushikMalapati authored Feb 12, 2025
2 parents 56a65fe + 26ab397 commit e54ab3e
Show file tree
Hide file tree
Showing 8 changed files with 1,342 additions and 1,451 deletions.
2 changes: 1 addition & 1 deletion iocBoot/ioc-rixs-optics/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IOC_TOP = /reg/g/pcds/epics/ioc/common/ads-ioc/R0.6.1
IOC_TOP = /reg/g/pcds/epics/ioc/common/ads-ioc/R0.8.0

IOC_INSTANCE_PATH := $(shell pwd)

Expand Down
3 changes: 0 additions & 3 deletions iocBoot/ioc-rixs-optics/rixs_optics.archive
Original file line number Diff line number Diff line change
Expand Up @@ -5732,9 +5732,6 @@ MR1K1:BEND:COATING:STATE:DONE_RBV.VAL 1 scan
MR1K1:BEND:COATING:STATE:ERR_RBV.VAL 1 scan
MR1K1:BEND:COATING:STATE:ERRID_RBV.VAL 1 scan
MR1K1:BEND:COATING:STATE:ERRMSG_RBV.VAL 1 scan
MR1K1:BEND:ENC:PITCH:RMS_RBV.VAL 1 scan
MR1K1:BEND:ENC:PITCH:MEAN_RBV.VAL 1 scan
MR1K1:BEND:ENC:PITCH:STDEV_RBV.VAL 1 scan
MR1K1:BEND:ENC:X:RMS_RBV.VAL 1 scan
MR1K1:BEND:ENC:X:MEAN_RBV.VAL 1 scan
MR1K1:BEND:ENC:X:STDEV_RBV.VAL 1 scan
Expand Down
69 changes: 0 additions & 69 deletions iocBoot/ioc-rixs-optics/rixs_optics.db
Original file line number Diff line number Diff line change
Expand Up @@ -73828,75 +73828,6 @@ record(waveform, "MR1K1:BEND:COATING:STATE:ERRMSG_RBV") {
info(archive, "VAL")
}

record(waveform, "MR1K1:BEND:ENC:PITCH:ACTPOSARRAY_RBV") {
# PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.aEncActPos
field(DESC, "PRG_MR1K1_BEND.fbPit...orM1K1.aEncActPos")
field(SCAN, "I/O Intr")
field(PINI, "1")
field(TSE, "-2")
field(DTYP, "asynFloat64ArrayIn")
field(INP, "@asyn($(PORT),0,1)ADSPORT=851/POLL_RATE=1/PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.aEncActPos?")
field(FTVL, "DOUBLE")
field(NELM, "1000")
field(MPST, "On Change")
field(APST, "On Change")
info(autosaveFields_pass0, "DESC DISS SIMS UDFS")
}

record(waveform, "MR1K1:BEND:ENC:PITCH:SETPOSARRAY_RBV") {
# PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.aEncSetPos
field(DESC, "PRG_MR1K1_BEND.fbPit...orM1K1.aEncSetPos")
field(SCAN, "I/O Intr")
field(PINI, "1")
field(TSE, "-2")
field(DTYP, "asynFloat64ArrayIn")
field(INP, "@asyn($(PORT),0,1)ADSPORT=851/POLL_RATE=1/PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.aEncSetPos?")
field(FTVL, "DOUBLE")
field(NELM, "1000")
field(MPST, "On Change")
field(APST, "On Change")
info(autosaveFields_pass0, "DESC DISS SIMS UDFS")
}

record(ai, "MR1K1:BEND:ENC:PITCH:RMS_RBV") {
# PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.fCurrRMSError
field(DESC, "PRG_MR1K1_BEND.fbPit...1K1.fCurrRMSError")
field(SCAN, "I/O Intr")
field(PINI, "1")
field(TSE, "-2")
field(DTYP, "asynFloat64")
field(INP, "@asyn($(PORT),0,1)ADSPORT=851/POLL_RATE=1/PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.fCurrRMSError?")
field(PREC, "3")
info(autosaveFields_pass0, "DESC DISS HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC SIMS UDFS")
info(archive, "VAL")
}

record(ai, "MR1K1:BEND:ENC:PITCH:MEAN_RBV") {
# PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.fEncMean
field(DESC, "PRG_MR1K1_BEND.fbPit...rrorM1K1.fEncMean")
field(SCAN, "I/O Intr")
field(PINI, "1")
field(TSE, "-2")
field(DTYP, "asynFloat64")
field(INP, "@asyn($(PORT),0,1)ADSPORT=851/POLL_RATE=1/PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.fEncMean?")
field(PREC, "3")
info(autosaveFields_pass0, "DESC DISS HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC SIMS UDFS")
info(archive, "VAL")
}

record(ai, "MR1K1:BEND:ENC:PITCH:STDEV_RBV") {
# PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.fEncStDev
field(DESC, "PRG_MR1K1_BEND.fbPit...rorM1K1.fEncStDev")
field(SCAN, "I/O Intr")
field(PINI, "1")
field(TSE, "-2")
field(DTYP, "asynFloat64")
field(INP, "@asyn($(PORT),0,1)ADSPORT=851/POLL_RATE=1/PRG_MR1K1_BEND.fbPitchRMSErrorM1K1.fEncStDev?")
field(PREC, "3")
info(autosaveFields_pass0, "DESC DISS HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC SIMS UDFS")
info(archive, "VAL")
}

record(waveform, "MR1K1:BEND:ENC:X:ACTPOSARRAY_RBV") {
# PRG_MR1K1_BEND.fbXRMSErrorM1K1.aEncActPos
field(DESC, "PRG_MR1K1_BEND.fbXRM...orM1K1.aEncActPos")
Expand Down
6 changes: 3 additions & 3 deletions iocBoot/ioc-rixs-optics/st.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ epicsEnvSet("ASYN_PORT", "ASYN_PLC")
epicsEnvSet("IPADDR", "172.21.140.71")
epicsEnvSet("AMSID", "172.21.140.71.1.1")
epicsEnvSet("AMS_PORT", "851")
epicsEnvSet("ADS_MAX_PARAMS", "7948")
epicsEnvSet("ADS_MAX_PARAMS", "7943")
epicsEnvSet("ADS_SAMPLE_MS", "50")
epicsEnvSet("ADS_MAX_DELAY_MS", "100")
epicsEnvSet("ADS_TIMEOUT_MS", "1000")
Expand Down Expand Up @@ -714,8 +714,8 @@ cd "$(IOC_TOP)"
## PLC Project Database files ##
dbLoadRecords("rixs_optics.db", "PORT=$(ASYN_PORT),PREFIX=PLC:RIX:OPTICS:,IOCNAME=$(IOC),IOC=$(IOC)")

# Total records: 6948
callbackSetQueueSize(15896)
# Total records: 6943
callbackSetQueueSize(15886)

# Autosave and archive settings:
save_restoreSet_status_prefix("PLC:RIX:OPTICS:")
Expand Down
2 changes: 1 addition & 1 deletion lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ External Setpoint Generation:
</DataType>
</DataTypes>
<Project GUID="{85BF455D-934D-415A-B04C-6D4CDD9FF10E}" Name="rixs_optics" PrjFilePath="..\..\rixs_optics\rixs_optics.plcproj" TmcFilePath="..\..\rixs_optics\rixs_optics.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="rixs_optics\rixs_optics.tmc" TmcHash="{D2935A53-08DE-787D-F1C5-6E7936FE5C67}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="rixs_optics\rixs_optics.tmc" TmcHash="{8A8B75E0-9480-C7AC-F402-7BE45BD3C747}">
<Name>rixs_optics Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down
11 changes: 0 additions & 11 deletions lcls-plc-rixs-optics/rixs_optics/POUs/PRG_MR1K1_BEND.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ VAR
fMaxXRMSErrorM1K1 : LREAL;
fMinXRMSErrorM1K1 : LREAL;
{attribute 'pytmc' := '
pv: MR1K1:BEND:ENC:PITCH
'}
fbPitchRMSErrorM1K1 : FB_RMSWatch;
fMaxPitchRMSErrorM1K1 : LREAL;
fMinPitchRMSErrorM1K1 : LREAL;
// Pitch Control
fbM1K1PitchControl : FB_PitchControl;
bM1K1PitchDone : BOOL;
Expand Down Expand Up @@ -249,10 +242,6 @@ fbXRMSErrorM1K1(stMotionStage:=M14,
fMaxRMSError=>fMaxXRMSErrorM1K1,
fMinRMSError=>fMinXRMSErrorM1K1);
fbPitchRMSErrorM1K1(stMotionStage:=M16,
fMaxRMSError=>fMaxPitchRMSErrorM1K1,
fMinRMSError=>fMinPitchRMSErrorM1K1);
(*
// Pitch Control
fbM1K1PitchControl(Pitch:=GVL_M1K1.M1K1_Pitch,
Expand Down
6 changes: 3 additions & 3 deletions lcls-plc-rixs-optics/rixs_optics/POUs/PRG_Stats.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ELSIF tonNewGpiMove.Q AND ABS(M7.fPosition - M7.stAxisStatus.fActPosition) > 5 T
fGpiRangeMax := MAX(fGpiRangeMax, fbGpiPosDiffStats.fRange);
END_IF
fGpiEncoderPosDiff := M7.nEncoderCount - (M7.Axis.NcToPlc.SetPos - M7.stAxisParameters.fEncOffset) * 150;
fGpiEncoderPosDiff := ((UDINT_TO_LREAL(M7.nEncoderCount) / 150.0) - (M7.Axis.NcToPlc.SetPos - M7.stAxisParameters.fEncOffset)) * 1000;
fbGpiPosDiffCollect(
bExecute:=TRUE,
pInputAdr:=ADR(fGpiEncoderPosDiff),
Expand All @@ -68,7 +68,7 @@ tonNewGpiMove(
PT:=T#15s,
);
fMpiEncoderPosDiff := M6.nEncoderCount - (M6.Axis.NcToPlc.SetPos - M6.stAxisParameters.fEncOffset) / 0.004505;
fMpiEncoderPosDiff := ((UDINT_TO_LREAL(M6.nEncoderCount) * 0.004505) - (M6.Axis.NcToPlc.SetPos - M6.stAxisParameters.fEncOffset)) * 1000;
fbMpiPosDiffCollect(
bExecute:=TRUE,
pInputAdr:=ADR(fMpiEncoderPosDiff),
Expand All @@ -82,7 +82,7 @@ fbMpiPosDiffStats(
bAlwaysCalc:=TRUE,
);
fMR1K1PiEncoderPosDiff := M16.nEncoderCount - (M16.Axis.NcToPlc.SetPos - M16.stAxisParameters.fEncOffset) / 0.00244;
fMR1K1PiEncoderPosDiff := ((UDINT_TO_LREAL(M16.nEncoderCount) * 0.00244) - (M16.Axis.NcToPlc.SetPos - M16.stAxisParameters.fEncOffset)) * 1000;
fbMR1K1PiPosDiffCollect(
bExecute:=TRUE,
pInputAdr:=ADR(fMR1K1PiEncoderPosDiff),
Expand Down
Loading

0 comments on commit e54ab3e

Please sign in to comment.