NAME: aIntro- Using the cgen routines: The cummings generators are monitored using some modbus routines. Data is written to disc (/share/phildat/cummings/) once a minute (if the generators are on). Each file contains a months worth of data (filename: cgen_yyyymm.dat). The routines in the cgen package let you access and plot this data. The main routines used by users are: @phil @cgeninit - these routines will initialize the cgen routines cgeninpmonth() - input data for 1 month. cgenplot() - plot some datainput and plot the data for a day, or continually monitor The data structure used for each record: IDL> help,d,/st ** Structure CGENINFO, 6 tags, length=664, data length=664: RECMARKER BYTE Array[4] : "RECm" RECNUM LONG : 1.. N within file YYYYMMDD LONG : 20131121 yyyymmdd when data read SECMID LONG : 12964 secMid ast for data read JD DOUBLE : julian data for data read (gmt based) GENI STRUCT CGEN1 Array[4]: holds data for each generator The data for 1 generator: IDL> help,d[500].geni[2],/st ** Structure CGEN1, 40 tags, length=160, data length=160: DEVTYPE LONG 3 CTRLSW LONG 2 STATE LONG 3 FAULTCODE LONG 0 FAULTTYPE LONG 0 KWPERCENT FLOAT 76.0000 TOTKWST FLOAT 755.000 NFPA110 LONG 24576 EXTENDEDST LONG 0 FREQ FLOAT 59.0000 TOTPF FLOAT 0.921850 TOTKVA FLOAT 821.000 TOTKW FLOAT 755.000 TOTKVAR FLOAT 319.000 VOLTSAB FLOAT 4169.00 VOLTSBC FLOAT 4174.00 VOLTSCA FLOAT 4171.00 VOLTSA FLOAT 2408.00 VOLTSB FLOAT 2411.00 VOLTSC FLOAT 2413.00 AMPSA FLOAT 111.000 AMPSB FLOAT 111.000 AMPSC FLOAT 112.000 AMPSAPERCENT FLOAT 64.5000 AMPSBPERCENT FLOAT 64.0000 AMPSCPERCENT FLOAT 64.5000 BATVOLT FLOAT 27.1000 OILPRES FLOAT 54.4037 OILTEMP FLOAT 91.8400 COOLANTTEMP FLOAT 80.1400 MISCTEMP1 FLOAT 6280.34 MISCTEMP2 FLOAT 37.5400 FUELRATE FLOAT 0.00000 <-- this is not loaded by cummings ENGRPM FLOAT 1770.00 ENGSTARTS LONG 684 ENGRUNTIME FLOAT 1754.36 TOTKWH FLOAT 530280. TOTFUEL FLOAT 55177.3 STARTCTRL LONG 590 RESETCTRL LONG 4169 cgengetmonth will input an array of these structures d[n]. You can use cgenplot to plot the data, or you can use the normal idl plot routines for plotting. the d.genI.state variable will tell which generators were in used: ii=where(b.geni.state ne 0) EXAMPLES: ; start idl idl @phil @cgeninit input month of nov13 nrecs=cgengetmonth(1311,d) plot a summary of the data cgenplot,d
(See /pkg/rsi/local/libao/phil/cgen/aIntro.pro)
NAME: cgendiag - plot generator diagnostic data SYNTAX: cgendiag,d,title=title,drange=drange,cs=cs,font=font,sym=sym,$ labadate=labadate,wait=wait,hard=hard,psname=psname ARGS: d[n]:{cgeninfo} array of generator data KEYWORDS: title : string title to add to the top of each page drange[2] : long [yyyymmdd,numdays] to plot cs : float character size scaling if single plot. default=2 font : int 1-truetype, -1 hershey, 0 device def:hershey sym : int symbol to using when plotting x vs y. 1,2,3 .. plot a symbol at each measured position. 1 +, 2 *, 3 . , Negative number -1,-2,-3 will plot the symbol and the connecting lines. default:4 title : string add this to top of each page labadate : string if supplied, then this is the output format for label_date call: %M-monName,%N-monNun,%D-dayNo,%Z-yy,%H-hr,%I-min default is "%D%M" (ddMon) wait : if set then wait for enter between plots hard : if set then write a .ps file. psname : string name for psfile. Default="cgensum_yyyymm.ps" lastpwr : ifset then print time, value for last power reading DESCRIPTION: Plot the cummings generator data passed in. The first page plots combined data (from the 4 generators) 1. total power vs time. 2. oil pressure for each mot/gen set 3. oil temp for each mot/gen set 4. coolant temp for each mot/gen set Page 2: 1. power by generator 2. power factor by generator 3. generator current 3 phases for each gen 4. generator voltage (phase to gnd) 3 phases for each gen The /hard keyword will generate a hardcopy file (ps). The default name is cgensum_yyyymm.ps . You can change the psname using the psname keyword. You can limit the data plotted using the drange= keyword drange[0]= yyyymmdd start of data drange[1]= ndays number of days (from drange[0] to plot). if ndays can be positive or negative.
(See /pkg/rsi/local/libao/phil/cgen/cgendiag.pro)
NAME: cgengetdays - input requested days of data SYNTAX: n=cgengetdays(yymmdd,d,ndays=ndays,hhmmss=hhmmss,badpnts=bandpnts,nbad=nbad,allmon=allmon) ARGS: yymmdd: long starting day to read KEYWORDS: hhmmss : long start time for first day. ndays : long number of days to read (def:1) if Less than 0, then count back from yymmdd. (-1 gives current day from midnite) badpnts[m] : {} array of pnts with bad values read in nband : long number of bad pnts found. allmon : int if set then all data for month in yymmdd ignores ndays. hhmmss still used RETURNS: n : long number of records we read. > 0 number of records returned a warning message is output if we don't get all the data 0 - no data for this date -1 - read error. no data returned -2 - open error d[n]: {} array of structs holding the info DESCRIPTION: Read in n days of cummings generator data. ISSUES: When stopping totkw looks like it goes negative? force it positive - When gen are taken offline , they give garbage results.. for now check genI.state=255 .. if true, set these values to 0
(See /pkg/rsi/local/libao/phil/cgen/cgengetdays.pro)
NAME: cgengetfiles - find the files for the specified date(s) SYNTAX: nfiles=cgengetfiles(yymmdd1,yymmdd2,filelist,ndays=ndays) ARGS: yymmdd1: long date for first day to read yymmdd2: long date for last day of interest KEYWORDS: ndays: long find files for ndays starting at yymmdd1. In this case ignore yymmdd2. RETURNS: nfiles: number of files found. filelist[nfiles]: list of files. yymmdd2: will return the actual last day used (in case you have requested something in the future. DESCRIPTION: Return the list of filenames that contain the data for yymmdd1 through yymmdd2. If keyword ndays is provided then return the list of filenames for the ndays of data starting at yymmdd1 and return yymmdd2. The data is stored by month. EXAMPLE: Get the files for oct02 through dec02 nfiles=cgengetfiles(021001,021230,filelist) print,nfiles 3 print,filelist
(See /pkg/rsi/local/libao/phil/cgen/cgengetfiles.pro)
NAME: cgengetmonth - input file with 1 month of data SYNTAX: n=cgengetmonth(yymm,d,badpnts=bandpnts,nbad=nbad)) ARGS: yymm: long month to read KEYWORDS: badpnts[m] : {} array of pnts with bad values read in nband : long number of bad pnts found. RETURNS: n : long number of records we read. > 0 number of records returned a warning message is output if we don't get all the data 0 - no data for this date -1 - read error. no data returned -2 - open error d[n]: {} array of structs holding the info DESCRIPTION: Read in 1 month of cummings generator data. ISSUES: When stopping totkw looks like it goes negative? force it positive
(See /pkg/rsi/local/libao/phil/cgen/cgengetmonth.pro)
NAME: cgenpath - return path for cgen data SYNTAX: path=cgenpath() RETURNS: path : string path to cgen data DESCRIPTION: return the path to the cgen data. Trailing / is in included.
(See /pkg/rsi/local/libao/phil/cgen/cgenpath.pro)
NAME: cgenplot - plot generator data SYNTAX: cgenplot,d,title=title,drange=drange,cs=cs,font=font,sym=sym,$ labadate=labadate,wait=wait,hard=hard,psname=psname ARGS: d[n]:{cgeninfo} array of generator data KEYWORDS: title : string title to add to the top of each page drange[2] : long [yyyymmdd,numdays] to plot cs : float character size scaling if single plot. default=2 font : int 1-truetype, -1 hershey, 0 device def:hershey sym : int symbol to using when plotting x vs y. 1,2,3 .. plot a symbol at each measured position. 1 +, 2 *, 3 . , Negative number -1,-2,-3 will plot the symbol and the connecting lines. default:4 title : string add this to top of each page labadate : string if supplied, then this is the output format for label_date call: %M-monName,%N-monNun,%D-dayNo,%Z-yy,%H-hr,%I-min default is "%D%M" (ddMon) wait : if set then wait for enter between plots hard : if set then write a .ps file. psname : string name for psfile. Default="cgensum_yyyymm.ps" lastpwr : ifset then print time, value for last power reading DESCRIPTION: Plot the cummings generator data passed in. The first page plots combined data (from the 4 generators) 1. total power vs time. 2. fuel rate (gallons/hour) vs time. 3. fuel rate vs total power. 4. efficiency vs total power. (KW for 1gallon/hour) Page 2: 1. combined fuel usage (gallons) since start of this dataset. 2. cumulative hours run for each generator (since installation). each generator is a separate color. The /hard keyword will generate a hardcopy file (ps). The default name is cgensum_yyyymm.ps . You can change the psname using the psname keyword. You can limit the data plotted using the drange= keyword drange[0]= yyyymmdd start of data drange[1]= ndays number of days (from drange[0] to plot). if ndays can be positive or negative.
(See /pkg/rsi/local/libao/phil/cgen/cgenplot.pro)