|
In addition to the functions available in the standard version http://cargocal.com/SNsOil.html and Advanced version http://cargocal.com/SNsAOil.html the following functions are made available in the Premium version. This will keep the file size small and give fast calculations. (See Calling .DLL Function vs. Visual Basic Worksheet Function) Further, you can access and call the functions in multiple projects at the same time. However, a registered Dll has to be purchased for each machine it is being used on. Select the level from Standard, Advanced, Premium or Universal according to your need. Extract the zipped file to "C:\Cargocal". Then from the Start-Run button, register the add-in by typing RegSvr32 "c:\cargocal\SNsPmOil.dll". Then from Excel, Tools-Addins, click on the 'Automation, button. Select SNsPmOil.PmOilCalc from the list or use the Browse button to the Cargocal folder and select the add-in SNsPmOil.dll With the universal addin the names are SNsUOil.UOilCalc
The functions are -
BBlsPerMT(APIDensity As MTLNGtoCFT(MT As Double, Optional RoundTo As Integer = 3) As Double ' Liquid MT to Normal CFT LiquidMTLNGtoCFT(MT As Double, Optional RoundTo As Integer = 3) As Double ' Liquid MT to Normal CFT Liquide, Optional AD As String = "D", , Optional Tables As String = "54A") As Double ' if API, pass 'A' in second parameter. Example formula =BBlsPerMT(40,"A") or BBlsPerMT(0.8247) where 0.8247 is density. Both Results =7.6408 Bbls per MT CrudePriceMT(APIorDens As Double, CostPrUSBBl As Double, Optional AD As String = "API") As Double ' if Density, pass 'd' in third parameter. Example formula =CrudePriceMT(0.8494,47.5,"d") or if in API =CrudePriceMT(35,47.5) Result for both = 352.365 OOIP(TankSideLength As Double, PayHeight As Double, EffPorosity As Double, WaterSatur As Double, Optional FeetMetres As String = "F") As Double ' Original Oil In Place - in Reservoir Barrels. If dimensions in metres instead of feet, pass 'M' in last parameter. Example formula =OOIP(125,12,0.152,1.125,"m") = 29959.87 reservoir barrels
HeelDeg(NetMoments As Double, Displacement As Double, GoM As Double) As Double ListInDeg(PortDr As Double, StbdDr As Double, Beam As Double, Optional MF As String = "M") As Double ' if drafts in feet, pass MF = "F" IntpTrimListCorr(mTrim As Double, mUll As Double, TbCol1 As Range, TbCol2 As Range, Optional delta As Double = 1) As Double 'Pass the trim as double, measured ullage as double and two corresponding columns as ranges.
IntpTOV(CorrdUll As Double, TbUlg As Range, TbVol As Range) As Double CrudeWaxPct(WtPct149 As Double, WxPct149 As Double, WtPct232 As Double, WxPct232 As Double, WtPct342 As Double, WxPct342 As Double, WtPct369 As Double, WxPct369 As Double) As Double CrudeCloudPt(Wt149 As Double, CP149 As Double, Wt232 As Double, CP232 As Double, Wt342 As Double, CP342 As Double, Wt369 As Double, CP369 As Double) As Double ViscAtTemp(oVis As Double, TkTempC As Double, BFactor As Double, ResultTempC As Double) As Double
BlendVols(TkVols As Range) As Double 'This saves tank volumes, tank-wise, in program memory. Computes percentage for each tank against total volume and stores this in memory for use by the following Blend functions. Function returns the total of all tanks BlendItem(TkItem As Range, TkVols As Range) As Double. 'Computes and returns the blended value for the selected range Item [example: API, Temp, Vanadium, etc] BlendWeight(TkApi As Range, TkVol As Range) As Double 'Computes and returns the weight for single tank basis tank API and Volume BlendVisc(TkVisc As Range, TkApi As Range, TkVols As Range) As Double 'Computes and returns the blend viscosity for all the tanks. The parameters to be passed to the function are: Ranges containing Viscosity, API and Volumes BlendPourPt(TkPourPt As Range, TkVols As Range) As Double 'Computes and returns the blend Pour Point for all the tanks. The parameters to be passed to the function are: Ranges containing Pour Point and Volumes RoofCorr(Temp As Double, CF As String, APIorDens As Double, Tables As String, WtOfRoof As Double, Optional LiqType As String = "C") As Double ShellCorr(Insu As Boolean, CF
As String,
AmbT As Double, TkT As Double, RefT As Double,
TkType As Byte)
As Double
'TkType is from 1 to
4, where coeffs are -
NetMassOrWTFmGSV(GSVol As Double, Tables As String, APIorDens As Double, Temperature As Double, FWPct As Double, SedPct As Double, Optional MassOrWt As String = "M", Optional AD As String = "D", Optional CentFarh As String = "C", Optional FWType As String = "F") As Double DensAtTankTemp(Table As String, APIorDens As Double, DegC As Double) As Double ' A more comprehensive function to obtain density at tank temperature. DensInAir(Dens As Double) As Double PlaySound(FileName As String) As Integer ' Plays the sound file once. example formula =IF(H14>2000000,PlaySound("c:\cargocal\Err.wav"),"") DraftAtLPFwd(FwdDrafts As Range, AftDrafts As Range, FwdOffset As Double, AftOffset As Double, LBP As Double) As Double DraftAtLPFwd(FwdDrafts As Range, AftDrafts As Range, FwdOffset As Double, AftOffset As Double, LBP As Double) As Double DraftMeanOfMeans(FwdDrafts As Range, AftDrafts As Range, FwdOffset As Double, AftOffset As Double, LBP As Double) As Double AppString(JoinRange As Range, Optional Separator As String = "Zm^") As String ' used in VBE or in the file UnAppString(A() As String, PassedStr As String, Optional Separator As String = "Zm^") ' used in VBE, pass an array. The function will populate the passed array with the string split by the separator value. RunFile(FilePath As String) 'Open and Run any file. Example =if(H1>20000,Runfile("c:\medJournal\cholesterol.pdf"),"") GenRandomNum(Optional FromNum As Double = 0, Optional ToNum As Double = 10, Optional WholeNum As Boolean = False)As Double GenInputBox(Prompt As String, OrigText As String, TitleBar As String,, Optional DataType As Integer = 1 + 2) 'Example =if(H1>20000,GenInputBox("Enter Last Overhaul run hours","0","Customised Solutions",8),"") Note - valid datatypes are value
Meaning
2 Text (a string) Example: 2 + 4 for Text and logical. 4
A logical value (True or
False)
OpenRunCMD(Prompt As String, Title As String) 'Shows a custom run command dialog box. ShowPCClock() as String 'Shows the PC clock icon in the system tray, Opens the Date & Time Dialog Box. Click on Excel in the task bar to bring the D&T box to the front . Example - =if(H1+1<now(),showpcclock,"") ShowControlPanel() As String 'Example =if(H1>20000,ShowControlPanel(),"") ShowRegSettings() As String 'Example =if(H1>20000,ShowRegSettings(),"") ' Region Settings ShowDispSettings() As String ' ScreenSaver tab Example =if(H1>20000,ShowDispSettings(),"") StartScreenSaver() As String 'Example =if(H1>20000,StartScreenSaver(),"") OpenExplorer() As String OpenWebPage(Url As String) ' Opens passed web page url in default browser RunOnTime(MacroName As String, AfterNSeconds As Long) 'Example = if(H1>20000,RunOnTime("TT",10),StopOnTime("TT",10,False)) Where TT is a name of a macro you have written. StopOnTime(MacroName As String, AfterNSeconds As Long) 'Example = if(H1>20000,RunOnTime("TT",10),StopOnTime("TT",10,False)) Where TT is a name of a macro you have written. LogE(dVal As Double) As Double ' Natural Log Some Derived Mathematical Functions - Sec(dVal
As Double) As Double For sake of uniformity, temperature to be passed is in degrees Centigrade to all the functions and is automatically changed to Fahrenheit internally, if required. (Unless either is allowed by the argument 'CF' as string). Though most of the functions can be used by any application (not limited to MS Excel), some of the functions need data from an Excel range. Therefore in the "Universal' addin, we have supplemented the list of functions which require ranges with the following, where the user will pass data in an array instead. Buy Universal Level Addin (not limited to MS Excel) UAppString(JoinRange()
As String, Optional Separator
As String = "Zm^")
As String STANDARD FUNCTIONS ADVANCED FUNCTIONS Users may send their queries to
This project has a limit of 100 calculations and / or prevents printing with the unregistered copy. With 100 calculations, the user can test the usefulness of this add-in substantially for a tank or two. To get the registered version, click on the button below to purchase via secure transactions and send us by e-mail the file "licSNOilPCID.pvf" generated by the project. You will find this file in 'C:\Cargocal\DllP. We will send you the release code file by return e-mail.
|
|||||||||||||||||||||||||||||||||||||