diff --git a/src/epics/util/feCodeGen.pl b/src/epics/util/feCodeGen.pl index 1cd31cbea269e89af34468c8f81ebeabcea44023..5dd799d3eb05729dc982641087ae19187dd1b146 100755 --- a/src/epics/util/feCodeGen.pl +++ b/src/epics/util/feCodeGen.pl @@ -1431,6 +1431,7 @@ for($ii=0;$ii<$dacCnt;$ii++) } } + print OUTH "\tint ovAccum;\n"; print EPICS "OUTVARIABLE FEC\_$dcuId\_ACCUM_OVERFLOW epicsOutput.ovAccum int ao 0\n"; @@ -1458,6 +1459,13 @@ print EPICS "OUTVARIABLE FEC\_$dcuId\_EPICS_SYNC epicsOutput.epicsSync int ao 0\ if($iopModel > -1) { + + print OUTH "\tint dac_temp_c[$dacCnt];\n"; + for($ii=0;$ii<$dacCnt;$ii++) + { + print EPICS "OUTVARIABLE FEC\_$dcuId\_DAC_".$ii."_TEMP_DEG_C epicsOutput.dac_temp_c\[$ii\] int ao -1 field(HIGH,\"70\") field(HIHI,\"80\")\n"; + } + print OUTH "\tint dtTime;\n"; print OUTH "\tint dacDtTime;\n"; print OUTH "\tint irigbTime;\n"; diff --git a/src/epics/util/lib/Dac.pm b/src/epics/util/lib/Dac.pm index 2186b9dd0eef332324369bffa014d2dacdeb18b1..59a1a2c821f4ccb994631ce0e4615de628c6e111 100644 --- a/src/epics/util/lib/Dac.pm +++ b/src/epics/util/lib/Dac.pm @@ -5,7 +5,7 @@ use Exporter; require "lib/medmGen.pm"; require "lib/Dac_common.pm"; -$max_chan_index = $Dac_common::board_types{GSC_16AO16} - 1; #One less than the number of channels +$max_chan_index = $Dac_common::board_num_chans{GSC_16AO16} - 1; #One less than the number of channels #// \page Dac Dac.pm #// Dac.pm - used by RCG to produce code in support of General Standards 16 bit / 16 channel DAC modules. @@ -40,10 +40,10 @@ sub initDac { print "DAC $::dacCnt; type=$type; num=$num\n"; # Check if this is a supported board type - if ( ! defined $Dac_common::board_types{$type} ) { + if ( ! defined $Dac_common::board_num_chans{$type} ) { print "Unsupported board type\n"; print "Known board types:\n"; - foreach (keys %Dac_common::board_types) { + foreach (keys %Dac_common::board_num_chans) { print "\t$_\n"; } exit 1; @@ -228,7 +228,7 @@ sub createDac16Medm # Add DAC Channel labels $xpos = 15; $ypos = 240; $width = 35; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_16AO16};$ii+=2) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_16AO16};$ii+=2) { $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"CH $ii",$ecolors{black}); $ypos += 40; @@ -236,19 +236,19 @@ sub createDac16Medm # Add DAC Data Monitors $xpos = 50; $ypos = 238; $width = 45; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_16AO16};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_16AO16};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OUTPUT_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } $xpos = 110; $ypos = 238; $width = 45; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_16AO16};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_16AO16};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } $xpos = 160; $ypos = 238; $width = 55; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_16AO16};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_16AO16};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_ACC_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; diff --git a/src/epics/util/lib/Dac18.pm b/src/epics/util/lib/Dac18.pm index 0995302caba0c73cee6ddb21996b3a2afc3169c8..42ead921794f578917fb24f90a491f8dd6e11713 100644 --- a/src/epics/util/lib/Dac18.pm +++ b/src/epics/util/lib/Dac18.pm @@ -11,7 +11,7 @@ require "lib/Dac_common.pm"; #// \n #// \n -$max_chan_index = $Dac_common::board_types{GSC_18AO8} - 1; #One less than the number of channels +$max_chan_index = $Dac_common::board_num_chans{GSC_18AO8} - 1; #One less than the number of channels #// \n \n @@ -41,10 +41,10 @@ sub initDac { print "DAC $::dacCnt; type=$type; num=$num\n"; # Check if this is a supported board type - if ( ! defined $Dac_common::board_types{$type} ) { + if ( ! defined $Dac_common::board_num_chans{$type} ) { print "Unsupported board type\n"; print "Known board types:\n"; - foreach (keys %Dac_common::board_types) { + foreach (keys %Dac_common::board_num_chans) { print "\t$_\n"; } exit 1; @@ -227,7 +227,7 @@ sub createDac18Medm # Add DAC Channel labels $xpos = 15; $ypos = 240; $width = 35; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_18AO8};$ii+=2) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_18AO8};$ii+=2) { $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"CH $ii",$ecolors{black}); $ypos += 40; @@ -235,19 +235,19 @@ sub createDac18Medm # Add DAC Data Monitors $xpos = 50; $ypos = 238; $width = 45; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_18AO8};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_18AO8};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OUTPUT_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } $xpos = 110; $ypos = 238; $width = 45; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_18AO8};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_18AO8};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } $xpos = 160; $ypos = 238; $width = 55; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_18AO8};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_18AO8};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_ACC_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; diff --git a/src/epics/util/lib/Dac20.pm b/src/epics/util/lib/Dac20.pm index 2aa07434d71befdfbb37aabafb18f27f14270df8..235d78c762f6bf278416e4c0199ebc9a1f420c95 100644 --- a/src/epics/util/lib/Dac20.pm +++ b/src/epics/util/lib/Dac20.pm @@ -11,7 +11,7 @@ require "lib/Dac_common.pm"; #// \n #// \n -$max_chan_index = $Dac_common::board_types{GSC_20AO8} - 1; #One less than the number of channels +$max_chan_index = $Dac_common::board_num_chans{GSC_20AO8} - 1; #One less than the number of channels #// \n \n @@ -41,10 +41,10 @@ sub initDac { print "DAC $::dacCnt; type=$type; num=$num\n"; # Check if this is a supported board type - if ( ! defined $Dac_common::board_types{$type}) { + if ( ! defined $Dac_common::board_num_chans{$type}) { print "Unsupported board type\n"; print "Known board types:\n"; - foreach (keys %Dac_common::board_types) { + foreach (keys %Dac_common::board_num_chans) { print "\t$_\n"; } exit 1; @@ -229,7 +229,7 @@ sub createDac20Medm # Add DAC Channel labels $xpos = 15; $ypos = 240; $width = 35; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_20AO8};$ii+=2) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_20AO8};$ii+=2) { $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"CH $ii",$ecolors{black}); $ypos += 40; @@ -237,19 +237,19 @@ sub createDac20Medm # Add DAC Data Monitors $xpos = 50; $ypos = 238; $width = 45; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_20AO8};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_20AO8};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OUTPUT_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } $xpos = 110; $ypos = 238; $width = 45; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_20AO8};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_20AO8};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } $xpos = 160; $ypos = 238; $width = 55; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{GSC_20AO8};$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{GSC_20AO8};$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_ACC_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; diff --git a/src/epics/util/lib/Dac_common.pm b/src/epics/util/lib/Dac_common.pm index 9bbe46a7252f01bcd83cfc2e718d6dc912140996..8b3ced937370491eb6fe2e7ae55ec4a32855d2d5 100644 --- a/src/epics/util/lib/Dac_common.pm +++ b/src/epics/util/lib/Dac_common.pm @@ -4,7 +4,7 @@ use warnings; use strict; -%Dac_common::board_types = ( +%Dac_common::board_num_chans = ( GSC_16AO16 => 16, # General Standards board GSC_18AO8 => 8, # 18-bit General Standards DAC board GSC_20AO8 => 8, # 20-bit General Standards DAC board diff --git a/src/epics/util/lib/Dacligo28.pm b/src/epics/util/lib/Dacligo28.pm index c73b588e4d2f4e9d6ca18dc7dc59a645e3cb7500..4a39dcbe16fc025ce47aa3e4f6ee081d4b061dbc 100644 --- a/src/epics/util/lib/Dacligo28.pm +++ b/src/epics/util/lib/Dacligo28.pm @@ -6,7 +6,7 @@ require "lib/medmGen.pm"; require "lib/Dac_common.pm"; -$max_chan_index = $Dac_common::board_types{LIGO_28AO32} - 1; #One less than the number of channels +$max_chan_index = $Dac_common::board_num_chans{LIGO_28AO32} - 1; #One less than the number of channels #// \page Dacligo28 Dacligo28.pm #// Dacligo28.pm - provides RCG support for LIGO 28 bit, 32 channel DAC modules. @@ -22,11 +22,11 @@ $max_chan_index = $Dac_common::board_types{LIGO_28AO32} - 1; #One less than the #// if there is a new global array introduced, it will need to be addressed in sortDacs() \n\n # sub initDac { - my ($node) = @_; - $::dacPartNum[$::dacCnt] = $::partCnt; - for (0 .. $max_chan_index) { - $::partInput[$::partCnt][$_] = "NC"; - } + my ($node) = @_; + $::dacPartNum[$::dacCnt] = $::partCnt; + for (0 .. $max_chan_index) { + $::partInput[$::partCnt][$_] = "NC"; + } my $desc = ${$node->{FIELDS}}{"Description"}; printf "DAC PART TYPE description `$desc'\n"; @@ -42,20 +42,20 @@ sub initDac { print "DAC $::dacCnt; type=$type; num=$num\n"; # Check if this is a supported board type - if ( ! defined $Dac_common::board_types{$type}) { + if ( ! defined $Dac_common::board_num_chans{$type}) { print "Unsupported board type\n"; print "Known board types:\n"; - foreach (keys %Dac_common::board_types) { + foreach (keys %Dac_common::board_num_chans) { print "\t$_\n"; } exit 1; } - $::dacType[$::dacCnt] = $type; - $::dacNum[$::dacCnt] = $num; - $::card2array[$::partCnt] = $::dacCnt; - print "LIGODACINIT type = $::dacType[$::dacCnt] num = $::dacNum[$::dacCnt] card2arry = $::card2array[$::partCnt] daccnt = $::dacCnt \n"; - $::dacCnt++; + $::dacType[$::dacCnt] = $type; + $::dacNum[$::dacCnt] = $num; + $::card2array[$::partCnt] = $::dacCnt; + print "LIGODACINIT type = $::dacType[$::dacCnt] num = $::dacNum[$::dacCnt] card2arry = $::card2array[$::partCnt] daccnt = $::dacCnt \n"; + $::dacCnt++; } @@ -73,7 +73,6 @@ sub partType { #// For DAC part, nothing required to be placed in the Epics comms struct. \n\n sub printHeaderStruct { my ($i) = @_; - ; } #// \b sub \b printEpics \n @@ -82,18 +81,17 @@ sub printHeaderStruct { #// Current part number is passed as first argument \n #// For DAC part, there are no EPICS records generated. \n\n sub printEpics { - my ($i) = @_; - ; + my ($i) = @_; } + #// \b sub \b printFrontEndVars \n #// Required subroutine for RCG \n #// Print variable declarations int front-end file \n #// Current part number is passed as first argument \n\n sub printFrontEndVars { - my ($i) = @_; - ; + my ($i) = @_; } # Check inputs are connected @@ -202,7 +200,7 @@ sub createMedm $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{blue},"","",""); # Add Display Name $xpos = 55; $ypos = 4; $width = 120; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"$mdlName\_DAC_MONITOR_$::dacCardNum[$dacNum]",$ecolors{white}); + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"$mdlName\_DAC_MONITOR_$::dacCardNum[$dacNum]",$ecolors{white}); # ************* Create Background ************************************************************************** # Add Background rectangles @@ -236,12 +234,12 @@ sub createMedm # Add DAC Channel labels $xpos = 15; $ypos = 240; $width = 35; $height = 15; - for($ii=0; $ii<$Dac_common::board_types{LIGO_28AO32}/2; $ii+=1) + for($ii=0; $ii<$Dac_common::board_num_chans{LIGO_28AO32}/2; $ii+=1) { #Draw left column $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"CH $ii",$ecolors{black}); #Draw right column - my $r_indx = $ii + $Dac_common::board_types{LIGO_28AO32}/2; + my $r_indx = $ii + $Dac_common::board_num_chans{LIGO_28AO32}/2; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos + $right_shift,$ypos,$width,$height,"CH $r_indx",$ecolors{black}); $ypos += 20; @@ -249,26 +247,26 @@ sub createMedm # Add DAC Data Monitors $xpos = 50; $ypos = 238; $width = 45; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{LIGO_28AO32}/2;$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{LIGO_28AO32}/2;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OUTPUT_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); - my $r_indx = $ii + $Dac_common::board_types{LIGO_28AO32}/2; + my $r_indx = $ii + $Dac_common::board_num_chans{LIGO_28AO32}/2; $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos+$right_shift,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OUTPUT_$dacNum\_$r_indx",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } $xpos = 110; $ypos = 238; $width = 45; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{LIGO_28AO32}/2;$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{LIGO_28AO32}/2;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); - my $r_indx = $ii + $Dac_common::board_types{LIGO_28AO32}/2; + my $r_indx = $ii + $Dac_common::board_num_chans{LIGO_28AO32}/2; $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos+$right_shift,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_$dacNum\_$r_indx",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } $xpos = 160; $ypos = 238; $width = 55; $height = 15; - for($ii=0;$ii<$Dac_common::board_types{LIGO_28AO32}/2;$ii++) + for($ii=0;$ii<$Dac_common::board_num_chans{LIGO_28AO32}/2;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_ACC_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); - my $r_indx = $ii + $Dac_common::board_types{LIGO_28AO32}/2; + my $r_indx = $ii + $Dac_common::board_num_chans{LIGO_28AO32}/2; $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos+$right_shift,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_OVERFLOW_ACC_$dacNum\_$r_indx",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } @@ -294,6 +292,11 @@ sub createMedm # Add ON LINE Label $xpos = 51; $ypos = 52; $width = 100; $height = 15; $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"ON LINE",$ecolors{black}); + # Add TEMP Label and value box + $xpos = 150; $ypos = 52; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"Temp (C):",$ecolors{black}); + $xpos = 205; $ypos = 52; $width = 50; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$ifo\:FEC-$dcuid\_DAC_$dacNum\_TEMP_DEG_C",$ecolors{white},$ecolors{black},"static"); # Add WATCHDOG Label $xpos = 51; $ypos = 67; $width = 100; $height = 15; $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"WATCHDOG",$ecolors{black}); diff --git a/src/fe/controllerIop.c b/src/fe/controllerIop.c index 61ce1b2926964200098df7f8b0bc56dfe2bbbd6a..8e4525e91316300fc5bb9d511f3b0402702c191c 100644 --- a/src/fe/controllerIop.c +++ b/src/fe/controllerIop.c @@ -1373,6 +1373,18 @@ void fe_start_controller( void ) feStatus |= FE_ERROR_DAC; } + // ***************************************************************** + /// \> Cycle 700 to 700 + numDacModules, Get DAC temps + if ( hkp_cycle >= HKP_CARD_TEMP_CHK && + hkp_cycle < ( HKP_CARD_TEMP_CHK + cdsPciModules.dacCount ) ) + { + dacnum = hkp_cycle - HKP_CARD_TEMP_CHK; + if (cdsPciModules.dac_info[ dacnum ].card_type == LIGO_28AO32) { + pLocalEpics->epicsOutput.dac_temp_c[dacnum] = + ligo28ao32_get_temp_c( cdsPciModules.dacDrivers[ dacnum ] ); + } + } + // Check LIGO timing card and backplane status if (syncSource == SYNC_SRC_LTC ) diff --git a/src/include/controller.h b/src/include/controller.h index 1f8785e8dd1efe930c544491a21d42810acab620..c1737def356e8a82b171b918a4ea24620114c247 100644 --- a/src/include/controller.h +++ b/src/include/controller.h @@ -248,6 +248,7 @@ extern char fp[ 64 * 1024 ]; #define HKP_DAC_WD_CLK 400 // ONLY IOP #define HKP_DAC_WD_CHK 500 // ONLY IOP #define HKP_DAC_FIFO_CHK 600 // ONLY IOP +#define HKP_CARD_TEMP_CHK 700 // ONLY IOP #define HKP_IOC_SLOT_STATUS 1000 // ONLY IOP #define HKP_IOC_SLOT_CONFIG 1100 // ONLY IOP #define HKP_IOC_BP_CONFIG 1200 // ONLY IOP