PVSS Project
A projects has been installed on alitofon001.cern.ch.
Project ALI_BPTX : The following Framework components (extracted from the LHCb package lhcbfw-3.12) have been installed, as described in
this tutorial
- Fw components (installed in the
fwComponents_TFC
directory):
- fwInstallation 3.0.2
- fwAccessControl 3.1.1
- fwCore 3.2.0
- fwConfigurationDB 3.3.5
- fwExternalAlertHandler 1.2
- fwGenericExternalHandler 3.2.0
- fwDIM 15.07.0
- fwCccp 2.19
- lbFwTFC 3.3b
- fwDIP 3.2.1 (added on 2008-08-02 as requested by ACC)
The control script
lbFwTFC_Setup
is started manually to run once, to create datapoints and FSM things.
DIM connection
DIM manager n.3 is responsible for the communication with the BPIM board:
-num 3 -dim_dp_config TFCConfig -dim_dns_node alidcscom061.cern.ch -dim_dns_port 2505
ClientServices
#8836,BPIM/bpim01.Action.UpdateRegisters.Data, /TFC/bpim01/SVC/UpdateRegisters, -1, 0, 0, 1
#8384,BPIM/bpim01.Action.UpdateSubscribedRegisters.Data, /TFC/bpim01/SVC/UpdateSubscribedRegisters, -1, 0, 0, 1
#0438,BPIM/bpim01.Action.UpdateTable.Data, /TFC/bpim01/SVC/UpdateTable, -1, 0, 0, 1
#1128,BPIM/bpim01.Action.TFC_Server.Version, /TFC/bpim01/SVC/ServerVersion, -1, 0, 0, 1
#2789,BPIM/bpim02.Action.UpdateRegisters.Data, /TFC/bpim02/SVC/UpdateRegisters, -1, 0, 0, 1
#7943,BPIM/bpim02.Action.UpdateSubscribedRegisters.Data, /TFC/bpim02/SVC/UpdateSubscribedRegisters, -1, 0, 0, 1
#5191,BPIM/bpim02.Action.UpdateTable.Data, /TFC/bpim02/SVC/UpdateTable, -1, 0, 0, 1
#9391,BPIM/bpim02.Action.TFC_Server.Version, /TFC/bpim02/SVC/ServerVersion, -1, 0, 0, 1
ClientCommands
#6974,BPIM/bpim01.Action.ReadWriteRegisters, /TFC/bpim01/CMD/ReadWriteRegisters
#4541,BPIM/bpim01.Action.SubscribeRegisters, /TFC/bpim01/CMD/SubscribeRegisters
#7290,BPIM/bpim01.Action.ReadWriteTable, /TFC/bpim01/CMD/ReadWriteTable
#2533,BPIM/bpim02.Action.ReadWriteRegisters, /TFC/bpim02/CMD/ReadWriteRegisters
#0100,BPIM/bpim02.Action.SubscribeRegisters, /TFC/bpim02/CMD/SubscribeRegisters
#5089,BPIM/bpim02.Action.ReadWriteTable, /TFC/bpim02/CMD/ReadWriteTable
Datapoint structure
DIP connection
The intensity and phase values are published in the DIP hierarchy as:
- dip/ALICE/LHC/Monitoring/BPTX/A/Intensity
- dip/ALICE/LHC/Monitoring/BPTX/C/Intensity
- (phase has not been defined yet)
The simulator manager n.13 and
PVSS00DIP are responsible for the communication with the Cern DIP system.
BPIM FSM panel
ALI_BPTX FSM
ALI_BPTX Control Unit
state: NOT_READY
when ( $ANY$FwCHILDREN in_state ERROR ) move_to ERROR
when ( $ANY$FwCHILDREN in_state UNKNOWN ) move_to UNKNOWN
when ( $ALL$FwCHILDREN in_state {CONFIGURING,READY} ) move_to CONFIGURING
action: GO_READY
do GO_READY $ALL$FwCHILDREN
if ( $ALL$FwCHILDREN not_in_state {CONFIGURING,READY} ) then
move_to NOT_READY
endif
move_to CONFIGURING
action: RESET
do RESET $ALL$FwCHILDREN
if ( $ALL$FwCHILDREN not_in_state NOT_READY ) then
move_to NOT_READY
endif
move_to NOT_READY
state: READY
when ( $ANY$FwCHILDREN in_state ERROR ) move_to ERROR
when ( $ANY$FwCHILDREN in_state UNKNOWN ) move_to UNKNOWN
when ( $ANY$FwCHILDREN not_in_state READY ) move_to NOT_READY
action: RESET
do RESET $ALL$FwCHILDREN
if ( $ALL$FwCHILDREN not_in_state NOT_READY ) then
move_to READY
endif
move_to NOT_READY
action: CONFIGURE
do CONFIGURE $ALL$FwCHILDREN
if ( $ALL$FwCHILDREN not_in_state CONFIGURING) then
move_to READY
endif
move_to CONFIGURING
state: CONFIGURING
when ( $ANY$FwCHILDREN in_state ERROR ) move_to ERROR
when ( $ANY$FwCHILDREN in_state UNKNOWN ) move_to UNKNOWN
when ( $ALL$FwCHILDREN in_state READY ) move_to READY
when ( $ANY$FwCHILDREN not_in_state {CONFIGURING,READY} ) move_to NOT_READY
state: ERROR
when ( $ANY$FwCHILDREN in_state UNKNOWN ) move_to UNKNOWN
when ( $ALL$FwCHILDREN not_in_state ERROR ) move_to NOT_READY
action: RESET
do RESET $ALL$FwCHILDREN
if ( $ALL$FwCHILDREN not_in_state NOT_READY ) then
move_to ERROR
endif
move_to NOT_READY
state: UNKNOWN
when ( $ALL$FwCHILDREN not_in_state UNKNOWN ) move_to NOT_READY
BPIM Device Unit overview:
state: READY
action: CONFIGURE
action: RESET
state: NOT_READY
action: GO_READY
action: RESET
state: ERROR
action: RESET
state: CONFIGURING
state: UNKNOWN
States
#uses "lbFwTFC/lbFwTFC_General.lctl"
#uses "lbFwTFC/lbFwTFC_Odin.lctl"
#uses "lbFwTFC/lbFwTFC_BPIM.lctl"
BPIM_ALI_valueChanged( string domain, string device,
int State_dot_RunState, string &fwState )
{
if (State_dot_RunState == TFC_StateReady)
{
fwState = "READY";
}
else if (State_dot_RunState == TFC_StateNotReady)
{
fwState = "NOT_READY";
}
else if (State_dot_RunState == TFC_StateConfiguring)
{
fwState = "CONFIGURING";
}
else if (State_dot_RunState == TFC_StateError)
{
fwState = "ERROR";
}
else
{
fwState = "UNKNOWN";
}
}
Actions
#uses "lbFwTFC/lbFwTFC_General.lctl"
#uses "lbFwTFC/lbFwTFC_Odin.lctl"
#uses "lbFwTFC/lbFwTFC_BPIM.lctl"
BPIM_ALI_doCommand(string domain, string device, string command)
{
if (command == "CONFIGURE")
{
// CONFIGURE è da RIFARE!!!!!
//fwDU_getCommandParameter(domain, device, "RUN_TYPE", RunType);
//fwDU_getCommandParameter(domain, device, "PART_ID", PartitionID);
//TFC_FSMLoadRecipe(device, RunType);
//BPIM_Configure(device, PartitionID);
BPIM_GetHWInfo(device);
}
if (command == "GO_READY")
{
//BPIM_Configure(device, 0);
BPIM_GetHWInfo(device);
}
if (command == "RESET")
{
TFC_Recover(device);
}
}
Check scripts
Script bpim_phase_check (scripts)
The
bpim_phase_check.ctl
script is executed when the
phase FIFO is dumped. The first and second values of the FIFO are archived in the
BPIM/bpim01.Parameter.Readings.Phase.PFIFO1
and
BPIM/bpim01.Parameter.Readings.Phase.PFIFO2
, converted as follows:
PFIFO1 = (pfifo_values[1]>>16)&0xffff
Furthermore, in the
AliB1.pdiff datapoint memorizes the phase difference:
(PFIFO2-PFIFO1)*0.0273
To do -- a script to regularly:
- acquire data for the phase FIFO
- dump the data in the dp
- set PFIFO1, PFIFO2, the phase difference
Script bpim_check (scripts)
The
bpim_check.ctl
script is executed every 3 minutes to check the status of DIM connections. Further checks can be added to the script in the same way.
#uses "ali_bpim_check.ctl"
main()
{
time t;
const int nseconds=180;
replyCode = dpSet("aliBpimCheck.interval:_original.._value",nseconds);
replyCode = dpSet("aliBpimCheck.syncTime:_original.._value",-1);
replyCode = timedFunc("check","aliBpimCheck");
}
check()
{
checkDIMStatus("dist_1:BPIM/bpim01");
}
Script ali_bpim_check (library)
#uses "lbFwTFC/lbFwTFC_General.lctl"
#uses "lbFwTFC/lbFwTFC_Odin.lctl"
#uses "lbFwTFC/lbFwTFC_BPIM.lctl"
checkDIMStatus(string bpim)
{
// WARNING!! The dp string is not passed to fwDim_connectState function!!
int state;
string dp;
dp = bpim+".State.RunState";
dpGet(dp,state);
//DebugN("BPIM01 state = "+state);
//DebugN("TFC_StateReady = "+TFC_StateReady); // 3
//DebugN("TFC_StateNotReady = "+TFC_StateNotReady); // 1
//DebugN("TFC_StateConfiguring = "+TFC_StateConfiguring); // 2
//DebugN("TFC_StateError = "+TFC_StateError); // 0
//DebugN("TFC_StateUnknown = "+TFC_StateUnknown); // -1
fwDim_connectState("TFCConfig", "SetStatusFromDIM");
}
SetStatusFromDIM(string dimconfig, bool value)
{
bool stateTFCServer;
time t;
string dp = "dist_1:BPIM/bpim01";
if (value)
{
dpGet(dp + ".Action.UpdateRegisters.Data:_original.._aut_inv", stateTFCServer);
if (stateTFCServer)
{
dpSet(dp+".State.RunState",TFC_StateUnknown);
t=getCurrentTime();
DebugN(t+" PVSS DIM client OK, REMOTE DIM SERVER not OK ,value="+ value+" stateTFCServer="+stateTFCServer);
}
else
{
//dpSet(dp+".State.RunState",TFC_StateReady); // non basta, serve un OR con altre condizioni
//DebugN("TUTTO OK ,value="+ value+" stateTFCServer="+stateTFCServer);
}
}
else
{
dpSet(dp+".State.RunState",TFC_StateUnknown);
t=getCurrentTime();
DebugN(t+" PVSS DIM client not OK ,value="+ value);
}
}
Coming next
- Oracle archiving for intensity and phase
- a script that calculates the phase in a regular way
- many other things that I will discover while working...
--
OmbrettaPinazza - 01 Jul 2008