Implemented missing wait state (now missing only HVON states)

This commit is contained in:
Martino Ferrari
2026-01-27 16:30:57 +01:00
parent 1fcc12525f
commit 68c62d7623
5 changed files with 190 additions and 25 deletions

View File

@@ -21,7 +21,6 @@
} }
} }
} }
+WaitStandby = { +WaitStandby = {
Class = RealTimeState Class = RealTimeState
+Threads = { +Threads = {
@@ -64,14 +63,13 @@
} }
} }
} }
/*
+WaitPermit = { +WaitPermit = {
Class = RealTimeState Class = RealTimeState
+Threads = { +Threads = {
Class = ReferenceContainer Class = ReferenceContainer
+Thread1 = { +Thread1 = {
Class = RealTimeThread Class = RealTimeThread
Functions = { Timer1kHzGAM CCPSWaveformGAM WFRecordGAM PreProgrammedGAM FHPSSetpointGAM FHPSRampupGAM InWaitPermitGAM choiseGAM EPICSOutputGAM GoWaitReadyFromWaitPermitGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM GoWaitHVONGAM GoWaitHVON_PREP_GAM GoWaitHVON_SDN_GAM GoWaitHVON_SDN_PREP_GAM GoErrorGAM } Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM WFRecordGAM PreProgrammedGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM GoWaitReadyFromWaitPermitGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM GoWaitHVONGAM GoWaitHVON_PREP_GAM GoWaitHVON_SDN_GAM GoWaitHVON_SDN_PREP_GAM GoErrorGAM }
CPUs = 0x100 CPUs = 0x100
} }
+Thread2 = { +Thread2 = {
@@ -81,11 +79,12 @@
} }
+Thread3 = { +Thread3 = {
Class = RealTimeThread Class = RealTimeThread
Functions = { Timer100kHzGAM NI6528P3GAM NI6528P4GAM NI6528P5GAM NI6528P3PV2PortGAM NI6528P4PV2PortGAM NI6528P5PV2PortGAM NI6528P3WriteGAM NI6528P4WriteGAM } Functions = { FastTimerGAM NI6528P3GAM NI6528P4GAM NI6528P5GAM NI6528P3PV2PortGAM NI6528P4PV2PortGAM NI6528P5PV2PortGAM NI6528P3WriteGAM NI6528P4WriteGAM }
CPUs = 0x400 CPUs = 0x400
} }
} }
} }
/*
// Real-Time state for HVPS sequence timing control. // Real-Time state for HVPS sequence timing control.
+WaitHVON = { +WaitHVON = {
Class = RealTimeState Class = RealTimeState
@@ -195,4 +194,3 @@
} }
} }
} }

View File

@@ -83,6 +83,31 @@
PVName = "EC-GN-P01-GAF-FHPS:STAT-MANM" PVName = "EC-GN-P01-GAF-FHPS:STAT-MANM"
Type = uint32 Type = uint32
} }
//# Guncoil state readback
GCPS_ACT_RB = {
PVName = "EC-GN-P01-GAF-GCPS:PSU2130-ACT-RB"
Type = uint32
}
//# Guncoil current monitor
GCPS_CURR_MON = {
PVName = "EC-GN-P01-GAF-GCPS:PSU2130-CURR-MON"
Type = float32
}
//# Main coil state readback
MCPS_ACT_RB = {
PVName = "EC-GN-P01-GAF-MCPS:PSU2120-ACT-RB"
Type = uint32
}
//# Main coil current monitor
MCPS_CURR_MON = {
PVName = "EC-GN-P01-GAF-MCPS:PSU2120-CURR-MON"
Type = float32
}
//# Pre-program flag
PREP_MODE = {
PVName = "EC-GN-P01-GAF:STAT-PREP-MODE"
Type = uint32
}
} }
} }
+EPICSCAOutput = { +EPICSCAOutput = {

View File

@@ -22,36 +22,49 @@
+NI6528_DI = { +NI6528_DI = {
Class = GAMDataSource // TODO Change Class = GAMDataSource // TODO Change
Signals = { Signals = {
//# PXI 6528 Board Status
PXI6528_Status = { PXI6528_Status = {
Type = uint32 Type = uint32
} }
//# DI.1
GYA_APS_FLT = { GYA_APS_FLT = {
// DI.1
Type = uint32 Type = uint32
} }
//# DI.3
GYA_BPS_FLT = { GYA_BPS_FLT = {
Type = uint32 Type = uint32
// DI.3
} }
//# DI.4
MHVPS_OV = { MHVPS_OV = {
Type = uint32 Type = uint32
// DI.4
} }
//# DI.5
MHVPS_OC = { MHVPS_OC = {
Type = uint32 Type = uint32
// DI.5
} }
//# DI.6
MHVPS_FLT = { MHVPS_FLT = {
Type = uint32 Type = uint32
// DI.6
} }
//# DI.9 or DI.14
PLC_ITL = { PLC_ITL = {
Type = uint32 Type = uint32
// DI.9 or DI.14
} }
//# DI.15
PLC_STANDBY = { PLC_STANDBY = {
Type = uint32 Type = uint32
// DI.15 }
//# DI.16
PLC_READY = {
Type = uint32
}
//# DI.21
PLC_SYNCMODE = {
Type = uint32
}
//# DI.18
PLC_PERMIT = {
Type = uint32
} }
} }
} }

View File

@@ -32,5 +32,13 @@
MHVPS_REF = { MHVPS_REF = {
Type = float32 Type = float32
} }
//# FHPS Rump Up completed
FHPS_RU = {
Type = float32
}
//# CCPS In operation flag
CCPS_IN_OPERATION = {
Type = uint32
}
} }
} }

View File

@@ -152,32 +152,28 @@
Operation = "AND" Operation = "AND"
InputSignals = { InputSignals = {
MCPS_ACT_RB = { MCPS_ACT_RB = {
DataSource = NI6528_DI // EPICSCAInput DataSource = EPICSCAInput
Type = uint32
Comparator = "EQUALS" Comparator = "EQUALS"
Value = 3 Value = 3
} }
GYA_MCPS_CURR_MON = { MCPS_CURR_MON = {
DataSource = NI6259_AI DataSource = EPICSCAInput
Type = float32
Comparator = "GREATER" Comparator = "GREATER"
Value = 0.0 Value = 0.0
} }
GCPS_ACT_RB = { GCPS_ACT_RB = {
DataSource = NI6528_DI DataSource = EPICSCAInput
Type = uint32
Comparator = "EQUALS" Comparator = "EQUALS"
Value = 3 Value = 3
} }
GYA_GCPS_CURR_MON = { GCPS_CURR_MON = {
DataSource = NI6259_AI DataSource = EPICSCAInput
Type = float32 Type = float32
Comparator = "GREATER" Comparator = "GREATER"
Value = 0.0 Value = 0.0
} }
FHPS_RU = { FHPS_RU = {
DataSource = NI6528_DI DataSource = DDB1
Type = uint32
Comparator = "EQUALS" Comparator = "EQUALS"
Value = 1 Value = 1
} }
@@ -201,8 +197,7 @@
Operation = "AND" Operation = "AND"
InputSignals = { InputSignals = {
CCPS_IN_OPERATION = { CCPS_IN_OPERATION = {
DataSource = NI6528_DI DataSource = DDB1
Type = uint32
Comparator = "EQUALS" Comparator = "EQUALS"
Value = 1 Value = 1
} }
@@ -236,3 +231,129 @@
Function = GoWaitStandby Function = GoWaitStandby
} }
} }
//# GAM in WaitPermit state. Check Permit and States of Operation Modes.
+GoWaitReadyFromWaitPermitGAM = {
Class = JAMessageGAM
Operation = OR
InputSignals = {
PLC_STANDBY = {
DataSource = NI6528_DI
Comparator = "EQUALS"
Value = 0
}
PLC_READY = {
DataSource = NI6528_DI
Comparator = "EQUALS"
Value = 0
}
}
+Event = {
Class = Message
Destination = StateMachine
Function = GoWaitReady
}
}
+GoWaitHVONGAM = {
Class = JAMessageGAM
Operation = AND
InputSignals = {
PLC_SYNCMODE = {
DataSource = NI6528_DI
Operator = "EQUALS"
Value = 0
}
PREP_MODE = {
DataSource = EPICSCAInput
Operator = "EQUALS"
Value = 0
}
PLC_PERMIT = {
DataSource = NI6528_DI
Operator = "EQUALS"
Value = 1
}
}
+Event = {
Class = Message
Destination = StateMachine
Function = GoWaitHVON
}
}
+GoWaitHVON_PREP_GAM = {
Class = JAMessageGAM
Operation = AND
InputSignals = {
PLC_SYNCMODE = {
DataSource = NI6528_DI
Operator = "EQUALS"
Value = 0
}
PREP_MODE = {
DataSource = EPICSCAInput
Operator = "EQUALS"
Value = 1
}
PLC_PERMIT = {
DataSource = NI6528_DI
Operator = "EQUALS"
Value = 1
}
}
+Event = {
Class = Message
Destination = StateMachine
Function = GoWaitHVON_PREP
}
}
+GoWaitHVON_SDN_GAM = {
Class = JAMessageGAM
Operation = AND
InputSignals = {
PLC_SYNCMODE = {
DataSource = NI6528_DI
Operator = "EQUALS"
Value = 1
}
PREP_MODE = {
DataSource = EPICSCAInput
Operator = "EQUALS"
Value = 0
}
PLC_PERMIT = {
DataSource = NI6528_DI
Operator = "EQUALS"
Value = 1
}
}
+Event = {
Class = Message
Destination = StateMachine
Function = GoWaitHVON_SDN
}
}
+GoWaitHVON_SDN_PREP_GAM = {
Class = JAMessageGAM
Operation = AND
InputSignals = {
PLC_SYNCMODE = {
DataSource = NI6528_DI
Operator = "EQUALS"
Value = 1
}
PREP_MODE = {
DataSource = EPICSCAInput
Operator = "EQUALS"
Value = 1
}
PLC_PERMIT = {
DataSource = NI6528_DI
Operator = "EQUALS"
Value = 1
}
}
+Event = {
Class = Message
Destination = StateMachine
Function = GoWaitHVON_SDN_PREP
}
}